Electronics Projects

Working with stepper motors

The purpose of this experiment was to check bipolar and unipolar stepper motors that I purchased in a surplus store and to evaluate their torque. The driving circuit in both cases is very similar. It consists of a microcontroller that generates pulses for switching motor coils in a right sequence, power MOSFET transistors for driving the coils, a pot for the rotation speed control and a button for changing the motor direction. Right after powering on the motors start to rotate in some direction. The direction is reversed as long as the button is pressed.

Driving bipolar motors

I tested two bipolar motors: Sanyo (type 103-4901-0142,see the image below) and Applied Motion HT17-068 (not shown). The connection is straightforward. The Sanyo motor (I do not have its data-sheet) provides pretty decent torc enough for using it in small vehicles. A bit surprise was waiting for me as I attached the other motor to the circuit. It is very powerful indeed, I was not able to stop it with my fingers. I bet it can easily open house doors. It consumes a lot of power and becomes hot though.

Schematic Layout

Bipolar motors as a rule have 2 coils and the current through them flows in different directions during the operation. Hence, an H-bridge is needed to reverse the current. Each of 2 H-bridges is built on AOP635 MOSFETs that contain a pair of complimentary (one N-channel and one P-channel) transistors in one package.

The main program loop consists of throwing a certain code to the output port according to the standard algorithm described elsewhere. The code number is controller by variable step and is returned by method getStep. After a new state is set, we perform a software delay before passing to the next step. The delay is needed to slow down the change of currents in motor coils. The stepper motors are designed to a relatively slow operation (up to about 1 rotation per second), so if the control sequences are changing faster the motor cannot catch up and just stops or rotates incorrectly in terms of speed or direction or both.

The delay is controlled by the position of the pot wiper, which is monitored by measuring a voltage across it with the PIC's ADC. The direction is moved by stepping through the control codes in the opposite order. For this we just decrement the step number as along as the button is pressed.

Driving unipolar motors

The hardware is pretty similar to the previous experiment, but no H-bridge is needed, since the current through the coils flows in one direction only. Thus, just N-channel MOSFETs are used to drive the coils.

The testing motors are Airpax model C82290-M2, 7.5° per step, 6 Ohm per coil (motor 1) and TEAC model 1Y07 (#14769070-09, motor 2). I also do not have their data-sheets. All I know on them is that the first one was used in floppy drives of old Apple computers, and the second one was used in 5" PC floppy drives. I powered both from 5 volts, which is probably incorrect, but I just wanted to confirm their functionality.

Schematic Motor 1 Motor 2

Unipolar motors can be driven is full-step mode and half-step mode. In the first case the cycle consists just of 4 steps, and just 1 coil is energized during each step. In the second case the cycle consists of 8 steps, during which 2 coils are energized. The software difference is minor. The difference is in functions getStep (full-step mode) and getStep2 (half-step mode). It was a bit tricky to figure out the polarity of coils for the first motor. The MOSFETS on the image are driven from left to right in cyclic order, but the coils have to be energized in alternating order. For the second motor the wiring was easier: the rightmost wire (on the image) is the common one, which can be easily found with an ohmmeter.

Downloads:


Last modified:Mon, Jan 23, 2023.

09528