PWM motor controllers using Arduino - jittery

This topic has been discussed in the past a few times but I have not been able to sort through the noise for a solution.

I have a project where I wish to speed control a CIM using a PWM motor controller (in this case an old Spark). Using the Servo.h library in the Arduino IDE does result in speed control but the motor seems to jitter at times and the Motor controller flashes back to the blue state. Even when I command 90deg the Spark LED hold solid Blue but flashes occasionally. I suspect it is the PWM signal from the Arduino that is dropping out. my code its self seem to run fine.

I have loaded just a simple servo sketch into the Arduino and the stutter is present there too just not as bad. I suspect its something to do with the hardware timing and my other tasks that use the hardware.

Has anyone got any suggestions to look deeper into?

If you wish to peek at the code it on my Serial Two way branch

Other observations
Loop time doesn’t seem to effect the motor. Simple Servo with a 15ms to 2000ms delay results the same.

Well that would do it. I am most definitely using FastLED. I will have to use a DIO to control a second micro controller.

After Dinner I’ll try the Adafruit_TiCoServo.h
Easiest today is to move the servo
hardest tomorrow would be to move the FastLED to an ESP32

The Adafruit_TiCoServo fixed the stutter.

Reading the FastLED issues thread does make me question my serial data and pulseIn() usage. It all seems to work well on the bench. We will see next weekend in Fargo how it works on the field.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.