SVP-324 motor control

Hello everybody!
I need help to control motors in SVP-324. I wrote an extremely simple program

#include <pololu/orangutan.h>
int main() {
   int M1_PWM = 50;
   clear(); // just to remove garbage from display
   while(1) { ; }

I cannot say it does not work, but it does not work as I expect. The program sets the speed of Motor 1 to low value (+255 is the maximum). The motor starts to spin, but non-uniformly. With period of about 2 seconds it speeds up and slows down. Speed variations are of about 80% at this speed value (M1_PWM = 50). When I increase it, the speed increases and relative variations become smaller, but still clearly noticeable. Another motor behaves exactly in the same way.

I worked wit DC motor control in my previous projects with PICs. Even without PID control motor speed was pretty constant. At least variations were unnoticeable without precise measurements. What do I do wrong? I am lost is three commands!

Just in case I provide some information about my circuit. Recently I updated SVP-324 firmware to version 1.01, because I was planning to run PID control and I have quadrature sensors on each motor. Probably, the version of the Firmware does not matter at this time, because the auxiliary PIC does not control H-bridges. I did not run this code before updating the Firmware. I have motors from Pololu (2 x #1101 100:1 Micro Metal Gearmotor HP) with encoder set (1 x #1218 Pololu 42x19mm Wheel and Encoder Set). I power my controller from 6V 1200mA adaptor. I tried to power it from 7.5V 2500 mA adaptor just to see if I have enough power. Motors behavior does not change.

Can anybody help?

Thank you.


Hello, Konstantin.

The behavior you describe for your motor is definitely not good.

Are you sure that your tire is not hitting something as it turns? While I was testing your code using my SVP-324 and an encoder set, my tire was hitting my chassis and it caused a problem similar to what you describe.

If that doesn’t solve your problem, then make sure you are using the right version of the Pololu AVR Library: the link step should have this command-line option: -lpololu_atmega324p.

Also, I’d like to know what your motor indicator LEDs are doing. When you set the speed to 50, the motor 1 green forward indicator LED should light dimly but steadily.


Hello, David!
You were right. It was pure mechanical problem. The rim of the wheel periodically touched the base. Now everything works fine.

Thank you.