Hi,
I am working on a PIC project where driving the two servos for the robot movement has the least priority in the code. Unfortunately I can't use the hardware PWM modules of the PIC since the servo pulse i much longer 20ms with 1.5ms for idle.
Therefore I wrote a simple code to software drive the two servos. Because there are more tasks that the PIC has to do some times there are small delays in the PWM duty cycle, ~50us and possibly more in the future as I add more features. This is not a problem if the rotation is fast. But I have a problem with the idle position. Periodic delays move the servo just a bit but you can see it and the result is not "right". I dont like it.
So, I was thinking to add a couple of transistors to control the power to the servos and when in idle to completely cut the off power.
It's a dirty solution and I dont completely like it.
So I am asking for your opinion.
Thanks!
I am working on a PIC project where driving the two servos for the robot movement has the least priority in the code. Unfortunately I can't use the hardware PWM modules of the PIC since the servo pulse i much longer 20ms with 1.5ms for idle.
Therefore I wrote a simple code to software drive the two servos. Because there are more tasks that the PIC has to do some times there are small delays in the PWM duty cycle, ~50us and possibly more in the future as I add more features. This is not a problem if the rotation is fast. But I have a problem with the idle position. Periodic delays move the servo just a bit but you can see it and the result is not "right". I dont like it.
So, I was thinking to add a couple of transistors to control the power to the servos and when in idle to completely cut the off power.
It's a dirty solution and I dont completely like it.
So I am asking for your opinion.
Thanks!