Controlling Stepper Motors

With your MotorVator you can control Stepper Motors.

You need to use a BiPolar Stepper motor (that is, one with 4 leads, or a 6 lead unipolar Stepper converted to Bipolar mode).

For a primer in Stepper Motors, see

The key issue with Stepper Motors is current control - it is very easy to overheat them with too much current.

You can use a wide range of BiPolar Stepper Motors, but many stepper motors use low voltage but high current, so not suitable for MotorVator control.

We (through offer a simple stepper (48 steps per revolution), matched to the MotorVator current driving capacity and able to be driven using anywhere from 6V to 12V without the need for current limiting resistors. ... bcc22830f8d13df5d97671ae9

Open in new window
This stepper motor is easily mounted into the Meccano geometry, as it will fit diagonally across any 3x3 hole face:

Open in new window

To drive a BiPolar stepper motor, you will use two of the Motor Outputs - one for each coil. The Stepper Motor connects directly to the MotorVator - no need for additional control- or interface-boards.

Then it is a simple matter of powering both coils (i.e. using SetMotor command for both motors) in the correct combination of Forward and Back.

Coil 2 Direction                         Coil 1 Direction
                F                                           F
                B                                           F
                B                                           B
                F                                           B

to turn clockwisemove down the table
to turn counterclockwisemove up the table

So the MotorVator code needs to set the two motors in the correct directions, wait (for the current to create the magnetic field in the coils), change to the next combination of motor directions, wait, etc.

Attached below is
(a) some sample code that handles this, for one motor.
(b) sample code that handles one or two stepper motor simultaneously.

Sample code to Drive one Stepper motor. Sample code (for MeccCompiler II) that will drive one stepper motor.

Sample code to run two steppers simultaneously. Operates one or two stepper motors.
When running two stepper motors, it scales the timing of the steps so that both movements finish at the same time. E.g. if one stepper is to move 48 steps, and the other only 12 steps, then the first will move 4 times as quickly as the second.