SMC04 high-power motor controller-bs2sx example program

Hi, I’m new in PID and want to try to use 2 Pololu SMC04 high-power motor controllers to control 2 12V-DC motors in a constant speed (say 300 rpm) (bidirectional). Could anyone give me an example program in BS2SX, please?


300 RPM is quite slow for our controller, so you would need a high-resolution encoder to get decent results. The motor controller counts the number of ticks per update cycle and tries to make that match the 10-bit target. Even at a low 20-Hz update rate, that requires about 20kHz top tachometer frequency, or about 4000 counts per revolution at 300 RPM.

Here’s what happens if you have a low-resolution tachometer, say 10 counts per revolution: 300 RPM is 5 rotations per second, or 50 tachometer ticks per second. With a 20 Hz update rate, that’s only 2.5 ticks per period. Setting the speed to 3 (out of 1023) would already max out the motor, and speed control would not be good since speed 2 would be so far away from speed 1.

Do you have access to a shaft that spins faster, such as the motor shaft?

- Jan

Hello, Jan.

I’m sorry to not mention that 300 rpm is after the gearbox, so at the motor shaft is around 30,000 rpm.

If you can get at least a few pulses per revolution on the motor shaft, you should be able to get decent results.

- Jan