Close

Microstepping tests

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/12/2022 at 09:270 Comments

As usual, the input PWM pin P0.7 is not the UART pin P0.5.  Fortunately the UART pin isn't used, so that needs to be bodged over.  Then, the PWM lowpass filtering capacitor had to be removed.  The rest was a routine UART bringup & GPIO bit banging.

Note the MOSFET part number is under the MOSFETs.  They're complementary PN pairs in a single package.

So full stepping the motor initially stalled it.  Undoubtedly, this was already discovered with the L6234 since that was using microstepping.  The problem with copying a UART code to GPIO pins is microstepping requires switching at microsecond resolution.  The UART goes at 20khz if it's lucky.  It needs a UART code for phase & a hardware PWM timer the same as lions did before.

The SIL F330 is prehistoric, dating back to 2004, yet it still has a 3 phase motor driver called the PCA.  Even then, it has to be optimized 7 ways to sunday.  Nothing but copying variables is possible in the interrupt handler.  They got an awful lot to work in BL heli, but it was also assembly.

1 problem is the UART goes at 10khz while PWM goes at 32khz.  The timing of the UART commands is much more coarse than what the L6234 was giving, but torque is higher.  A test program which stepped it in the F330 at the PWM frequency didn't yield any increase in speed.  It needed delays equivalent to the delays between UART characters.  It's not practical to step it in the F330 because the timelapse mode requires direct control from the ARM.

Instead of calculating a step size when you have a motor driver on GPIOs, the maximum step between UART codes is always 1 & 10,000 steps can be sent per second.  Speed has to be controlled by the delays between steps rather than the size of the steps.

After a few days of banging on microstepping, full stepping was giving better results with longer delays & a lot more torque.  Either the interrupt handler or the transistor switching wasn't going fast enough for the microstepping to be smooth.  Full stepping still wasn't as fast as the L6234 but it had a lot more torque.

Discussions