Wednesday, November 28, 2018

Driving a unipolar stepper motor with the NXP PCA9537

The NXP PCA9537 is a 10-pin CMOS totem pole GPIO with an SMBus and I2C two-wire bus so it can interface to most microcontrollers (Figure 3).



Figure 3: The NXP PCA9537 is a totem pole GPIO that takes the I2C byte sequences from the host controller and provides the requisite waveforms to the gate inputs G1 through G4. (Image source: NXP)

In the diagram, the motor is a 12-V unipolar nema 23 stepper motor with a current rating of 1.25 A. For users that want to modify the diagram and tweak it to their own application, there is a fully interactive schematic of the unipolar driver available on Schematics.com.

The PCA9537 has a 4-bit configuration register, 4-bit input port register, and a 4-bit output port register, and a 4-bit polarity inversion register for “active high” or “active low” operation. The GPIO has a fixed I2C-bus slave address of 92H and it takes the I2C byte sequences from the host controller and provides the requisite waveforms to the gate inputs G1 through G4.

The diagram also shows the NXP PCA9665, an IC that serves as an interface between most standard parallel-bus microcontrollers/microprocessors and the serial I2C-bus allowing the parallel bus system to communicate bidirectional with the I2C-bus. The type of waveform will be one corresponding to wave, two-phase or half-step drive, as chosen by the user. The duration of the pulses is controlled by time delay implemented in the host controller firmware. It is shown as a reference for the various waveforms. The maximum I2C-bus speed supported by PCA9537 is 400 kHz.

To drive the stepper motor best price at approximately 18 RPM, use the following byte sequence, where ‘S’ stands for I2C-bus START condition, and ‘P’ stands for STOP condition. Also, DLY1 and DLY2 are time delays implemented by the microcontroller firmware. Numbers are represented in hexadecimal notation:

S, 0x92, 0x03, 0x00, P // Set all 4 IO pins of PCA9537 as OUTPUT pins;
// IO Configuration Register = 0x00
Set DLY1 = 300 ms // Time delay between steps; 18 RPM for a 7.5˚ motor

//Start of waveform loop
S, 0x92, 0x01, 0x08, P // Start the half-step sequence waveform
Execute time delay between steps = DLY1
S, 0x92, 0x01, 0x0C, P // outputs for the next step
Execute time delay between steps = DLY1
S, 0x92, 0x01, 0x04, P // outputs for the next step
Execute time delay between steps = DLY1
S, 0x92, 0x01, 0x06, P // outputs for the next step
Execute time delay between steps = DLY1
S, 0x92, 0x01, 0x02, P // outputs for the next step
Execute time delay between steps = DLY1
S, 0x92, 0x01, 0x03, P // outputs for the next step
Execute time delay between steps = DLY1
S, 0x92, 0x01, 0x01, P // outputs for the next step
Execute time delay between steps = DLY1
S, 0x92, 0x01, 0x09, P // outputs for the next step
Execute time delay between steps = DLY1
// Loop through waveform sequence to keep running motor
// OR execute next two steps if desired
Execute time delay = DLY2 // Hold in current position for time = DLY2
S, 0x92, 0x01, 0x00, P // Turn off motor

(Byte sequence source: NXP)
Of course, some users may want to drive multiple motors. For this, many single-chip options are also available. In the meantime, it’s good to practice on the PCA9537 and the unipolar, single-motor, interactive schematic shown here.

No comments:

Post a Comment

How to achieve innovation in hybrid stepper motors?

 Hybrid stepper motor is a type of motor that combines permanent magnet and reactive stepper motors. It has the advantages of high efficienc...