Hopefully some of you are still with me, and you haven’t blown up your supply, switching device or coil.
Before we continue I’d like to ask a question; what current can your supply handle? Let’s take a brief look at Ohm’s Law, or at least the mathematical equation describing Ohm’s Law. The equation V=IR is incredibly important in electronics, and so you should have it burned into the back of your skull. Assuming a 5V supply (not uncommon), and a coil resistance of 1.6ohms (again, not unheard of) – this gives a current of 3.125 Amps PER COIL. Please also bear in mind that by using the Full Stepping method we would be drawing 6.25 Amps and you could be facing some current issues. I was using an old PC power supply as they have reasonably hefty current ratings, and although the 5V rail was fine, running off the 12V kept tripping the thermal fuse when trying to switch just a single coil.
Stepping a single step is easy enough, but you will invariably try to spin your stepper fast. You will hit a certain point where the stepper just stalls and lets out a whine (corresponding to the switching frequency). This is not necessarily a limitation of the motor, but of your driver circuitry. You have reached a point where you can’t energise the coils quickly enough, but there is a solution. By increasing the drive voltage it is possible to decrease the time taken for the current to saturate the coil, and so increase your switching speed. We have already ascertained that an increased voltage leads to an increased current and a blown supply, so we must find a way to increase voltage and keep current the same. There are a number of ways to do this, but I am going to cover the two simplest; linear resistive current limiting, and a chopper drive circuit.
Linear resistive current limiting is far simpler than it sounds. In fact, it is just adding a resistor in series with each coil. Similar to a current limiting resistor when driving an LED, this resistor limits the current going through the coil. Most motor manufacturers actively encouraged this technique up to the mid-80’s, but it has fallen out of fashion – either way this is probably the easiest and cheapest method available. The major disadvantage of this method is that the current is getting dumped in this resistor, and so the resistor will get HOT. This is NOT a job for the 1/4W resistor.
The chopper drive circuit uses PWM to limit the current in the coil. Either this can be open-loop control where the electronics has no knowledge of the current levels, and the duty cycle is determined either through experimentation or calculation. Alternatively, closed-loop control can be implemented through the use of more complex electronics measuring coil current. The disadvantage of this method is based purely around the PWM frequency. Higher frequencies will cause RF issues, and lower frequencies (i.e. audio frequencies) the motor will literally “squeel”.
Next article I will be dealing with actual schematics, and including some code used to step the motor using a PIC18F.