Kitronik Robotics Board for Raspberry Pi Pico (CE07854)

Hi @Peter242324,

I contacted Kitronik for a bit more insight into why we’d hit a 50Hz speed limit with the robotics board and their technical team has provided a great explanation about how it works and the trade-offs between designing for servos, brushed motors, and stepper motors in one device. I’ll quote their advice below.

The PCA only supports 1 PWM frequency at a time on all pins.
As we are driving servos that gets set to 50Hz – so that the servos will work correctly.
As it happens 50Hz is a not terrible PWM frequency for most DC motors.

Stepper motors are not the same as DC motors (obvious statement).
A brushed DC motor contains a commutator. This ‘effectively’ (if you squint a bit) steps a DC motor.
Steppers have this commutation externally – usually in a dedicated stepper controller.

Because the commutator is fixed to the output shaft of the brushed DC motor as the motor speeds up it also speeds up.
This speeds up the rate of steps, to a maximum where the energy into the coils is equal to the drag on the motor.
This acceleration occurs very quickly in most cases and so is not normally noticed.
You just demand the motor goes (by applying power) and it accelerates as fast as it can to the fastest speed it can.

Now come back to a stepper motor.
Because the commutation is external it is not coupled to the motor shaft.
So it doesn’t have a locked feedback to provide the acceleration.
This is why to get a stepper motor turning you have to start at a relatively low speed, and then if you want to go faster you gradually speed up the pulses – which accelerates the motor.
If you exceed the motors acceleration curve (which is mostly made up from rotor inertia) then the magnetic lock which is driving the motor is lost and you miss a step.
In some cases that’s all that happens and the motor ‘stumbles’ but caries on, in other cases the motor stops and starts to ‘shake’ forwards and backwards as the steps occur.

The way you accelerate a stepper motor is to speed up the pulses.
This is possible on the PCA by pausing between the pulses at the slow end, and then gradually not pausing until you are sending a pulse every time the PCA would do on its normal PWM.
As it happens the steppers I tested would reliably start and step at 50Hz, so there was no need to write any complicated acceleration code to get them running.

To get the steppers running faster than 50Hz would mean that the servo part of the board (probably) doesn’t work with most hobby servos. I say most because some servos will accept a higher frame rate (the 50hz repetition).
Because you can’t just start a stepper at a higher speed the code would have to include an acceleration term, and that would have to reprogram the PCA PWM module as the acceleration continues.
Whilst this code is possible it isn’t trivial, and as most of our users do not use steppers, or are happy to have them used for ‘slow speed’ positioning, we haven’t written it.

From quick calculations, the code would have to up the step rate from 50hz to about 665hz (assuming 200 step motor) to give 200 rpm.
The period it would have to accelerate over depends on what is attached to the motor (the force required).
We could support a user who wants to write their own code to do this, but we don’t have plans to do it.

Since your project needs the stepper motor to hit around 200RPM you’ll probably be better off swapping to a dedicated stepper motor driver. If you did want to return that unit please reply to your order confirmation email with a link back to this thread and we can get that sorted ASAP.

Ultimately this is a great product for beginners wanting to experiment with multiple different types of motors, but higher speed stepper applications would be best served with dedicated stepper drivers that are optimised for those higher step rates.

1 Like