Close

Microstepping bug fix

A project log for Convert a brushless servo into a stepper motor

Brushless servos could have great value in pointing cameras, but only with the more precise motion of stepper motors.

lion-mclionheadlion mclionhead 10/15/2022 at 05:310 Comments

So the 2 key parameters are the PWM frequency & the total power.  The frequency has to be at least 24khz to avoid making noise but not 32khz to have enough clockcycles.

The total power determines how much of the total time the MOSFETS are moving current.  The total power has to be less than 100% to create time for the interrupt handlers to fire.  If it's too high, the motor will be jerky, intermittently short circuiting.  You want the P MOSFETS to all turn on, then all switch to N some time afterwards to give the interrupt handlers time to fire.

With these parameters correctly calculated, the movement possible with the F330 is smooth, torquey, & silent but still prone to stalling at the same speeds previously found.  The step size can be fractional again without making it stutter.

The decision was made to use a 4 byte packet, 2 sync bytes, a power level, & a phase.  The trick is to ramp the power based on speed so it doesn't fry.  Even at 300mA, those MOSFETs get blazing hot so they might be shorting during the PN switching.

Blheli has delays (NFETON_DELAY, PFETON_DELAY) when switching from P to N fets.  It just decrements a counter in a loop to create the delay.  The lion kingdom found the given value of 15 made it stall.  Any nonzero delay made it rougher.  It was going to be a compromise between delay & heat, but any delay was essential.

Without the L6234, the control board was a grotesque waste of an STM32F405.  There's nothing an 8 bitter couldn't do.  The F330 could probably do everything except the radio.  There's still 1 SIL F330 based servo left.  Time to button it up & mount it on the camera pole.

Final view of the programming pin positions.

Discussions