Re: screening / glitchy operation - sanity check
Indeed it doesn't happen consistently, it's a spurious thing, a few smooth starts and then you get two or three with glitches, then back to smooth starts again. Also I get those dreaded positioning errors again, which forces me to power cycle the driver. If it was only glitches on ramp up I'd be willing to let it go, but it causes positioning errors, which stops the whole thing from running, so I need to resolve it.
Regards,
dsc.
1 Attachment(s)
Re: screening / glitchy operation - sanity check
Kudos to Jonathan for recommending the logic analyser, here's what I've found on the PWM channel:
Attachment 10926
This was due to the fact that I was updating the PR2 without waiting for the PWM cycle to finish (I was doing that before, but you need to clear the TMR2IF flag before you go into the while loop; normally the flag gets set and sits like that forever, unless the TMR2 interrupt is enabled). I've now changed the code slightly and voila! no glitches.
Regards,
dsc.