Hello, I’m a couple days in working with my shiny new Panda board. It rocks.
I’m building an autopilot and need smooth clean servo control. I have used the sample code provided somewhere using the PWM driver. I don’t even remeber where I got the same because it’s the most common PWM demo.
That works, but my code loop controls the servo on a timed loop that’s independent of the PWM clock cycle. Instead of smooth steady movement, the servo is jittery, even when I generate a smooth sweep with a loop in my code.
I think my call to SetPulse in the control loop interrupts the PWM signal and sometimes sends the sends the servo only part of the high pulse, basically giving it an error value. I don’t have a scope so I have no good way to confirm this.
Is there a way to use hardware PWM but make sure that a cycle is never interrupted? I imageI’d have the same problem with OutputCompare. I could write my own software driver but I’d rather use h/w PWM. I know I can not call SetPulse if my value hasn’t changed, but I will be making small changes to the values and need smooth output.
Has anyone ran into this? I can paste code here but it’s spread across several classes so I’d have to write a simple demo function, but I can do that.