Hello,
There is something called "pulse width modulator", but do we always need them to control stepper motor?
I mean, there are plenty of GPIO pins on the chip. We can simply assign GPIO pins, say, 1 to 4, to two pairs of wires in a stepper motor, or to six wires, and control the high-low output of these GPIO bits, and using these bits to open/close transistors to let current flow or block them. In order to generate a pulse of desired width, we simply add a delay function to control the GPIO's high/low voltage period. using software control routine in this manner, we can completely control the motion of any stepper motor with arbitrary number of wires since we have so many GPIOs.
I strongly believe this is possible. Then the question is: why do we still need PWMs? Why TI still bother to make them in the chip?
Another question is on the number of PWMs. I looked through a number of chips and found that it seems TI chips have at most 3 PWMs. But how can three PWMs control a stepper motor, which usually has at least four wires, and sometimes five or six? How can a small number of signals be used on a larger number of outputs?
Do we need some other "selecting" signals, such as two GPIO outputs to determine which of the four wire ends will the PWMs voltage be applied to? If we use additional selecting signals like this, then one PWM is enough for controlling a stepper motor. In theory, it can also be used to control any number stepper motors by using more GPIO outputs to do the "selection" between different wires on different stepper motors.
Can anyone give some comments on this?
I am also puzzled by the difference between the six-wire and four-wire type motor. I figure that four wires are sufficient, since they can be used to drive two electromagnets and their work in conjunction can drive (attract) the motor to move in desired direction and degree. Why do we still need the two additional wiring in the middle (O and O-complement the left part of the stepper motor wiring figure)?
Garry