I am trying to control precisely (without glitches) several servo-motors from a computer through GPIO. Final position, speed and ideally acceleration need to be controlled.
Currently I generate the PWM signal by software, but software seem not precise enough (due mostly to kernel context switches, the PWM signal is some times several micro-seconds late, producing some "shaking"). I know several way to improve, for instance implementing the signal from a driver (kernel) context, but the problem will inherently stay.
How to generate a PWM signal, based on software indications. Which solution is recommended?
- Building the logic myself: That seem an overkill: 2 clocks, plenty of logical gates.. Even if probably achievable, the final result would take too much space.
- Using an intermediate pic, dedicated to provide precise PWM, the protocol between the computer and the pic to be defined. Could be a solution, I am not sure however of the result or if there are better ways.
- Looking over internet shops by PWM, servo controller, ... I did not found any chip which integrate this feature. Probably I miss an important concept.