Controlling Stepper Motors with the MCP-1200

Being able to control stepper motors adds versatility to the MCP-1200 so that the same hardware can be used in a motion control system that incorporates both stepper and servo motors. Having the same hardware should provide additional cost savings and make the software development simpler.

Stepper Control Mode

The PWM port is reconfigured in the Stepper Control Mode to pulse and direction commands. The step pulse polarity and width are programmable. To insure adequate set-up time, any change in the direction output precedes the step pulse by a fixed amount.

The inherent "open-loop" nature of stepper motor operation results in the compensation filters not being used. The step and direction output is fed directly into the position counter. The maximum practical step rate is generally limited by the stepper motor, it's driver, and the mechanical system being driven.

Step Encoder Follower

This feature allows for the use of a position encoder while operating in step mode. Normally a stepper motor operates in an "open-loop" manner where a known distance is moved on each step pulse. However, synchronization between the motor movement and the step signal may be lost if the motor stalls (due to over speed or overload) or if a problem occurs in the driver circuits. By adding a quadrature position encoder and activating this feature, you can detect such faults.

The two phase outputs of the encoder should be fed into the Channel A and B input pins. The same decoding and filter circuits used by a servo motor encoder are employed. The filter clock and A/B swap functions work the same as in the servo motor case.

When an error is detected the Maximum Error Flag is activated. The action taken in the event of this error is programmable using the Exception Handling Register. The operation of this register is detailed in the Programmable Exception Handling section. To reset the Maximum Error Flag, write any value to the Status Register.

To deactivate the step encoder feature, write zero values to both Encoder/Step Ratio Registers.  At power-up this feature defaults to the deactivated state.