J105 STMC
As can be seen from Section 5, using the STMC simply involves initialising it with the parameters of your stepper motor, issuing commands and (optionally) reading the state of the motor when motion has stopped. However, the following three precautions should be taken.
If the motor is moving, the only commands that can be written to it are stop commands (motion commands 0 and 1)
The controller has an input buffer for commands and data, and commands and data should only be written to the controller when the input buffer is empty.
Data is read from an output buffer, and a valid data byte is only present when this buffer is full.
Information on all these situations is contained in the status register at address 3B1.
Bit 2 of this register contains a 1 if the motor is running, so motion commands (except for stop commands) can only be written if this bit is 0.
Bit 1 of this register contains a 0 if the input buffer is empty and commands can be written.
Bit 0 of this register contains a 1 if the output buffer is full, when data can be read.
To summarise, here is a list of some possible states and the appropriate action to take.
Bit 2 1 0 | Action |
---|---|
1 1 x | The motor is running and the input buffer is full. Wait until the input buffer is empty. |
1 0 x | The motor is running and the input buffer is empty. You can write a stop command if you wish. |
0 0 x | The motor has stopped and the input buffer is empty. Any command can be written. |
0 0 0 | The motor has stopped, the input buffer is empty, and so is the output buffer. If a read register command is now issued it will lead to the following state |
0 0 1 | There is a data byte in the read register, which should be read out before issuing a new command. |
The connection details of the front 50-way connector, PL3 are given in Appendix B. PL3 is a general-purpose I/O connector which has several signals that have not yet been mentioned. Some are intended for connection to custom-buiIt drive boards. The use of the prototyping signal-conditioning board could be considered. Some of the signals are the active-low limit switch inputs that have already been mentioned. There is also one input and one output port on PL3. The input port is at 3B2 (hex) and is read only. The output port is also at 3B2 and is write only.
The output port may be jumpered via LK3 and LK4 to the limit switch inputs of the controller IC. This feature is to allow the situation where the motor has to run continuously until stopped by some condition defined by software. To use this feature, set the output lines of the port high, by writing FF (hex) to address 3B2. Jumper the appropriate limit switch lines by inserting jumpers on LK3 or LK4, and start the motor running with a 'move to limit switch' command. The motor will now run until you reset the appropriate bit of the output port. Limit switches should not be connected to inputs which are jumpered in this way.
Inputs to the controller are active-low, except for the MON input. This controls whether the motor starts. If it is high, the motor can start running. This is the default state. Setting this input low cannot stop the motor if it is already running, however.
Motor phase outputs are active in ascending order. The unbuffered outputs are available on PL3, and the buffered outputs are on PL2, which is a two-part removable screw-terminal connector. As an example, connections to an RS stepper motor type 332-082 are shown in Appendix B. See Section 3 about motor grounding and the use of LK5.
The driver IC is a four phase bipolar device which can sink or source 2 amps continuously on each channel. For 10 ms pulses of 80% duty cycle, 2.5 amps can be output. The constraint on output current is the onboard heatsink. With two phases energised, 2 amps can be output at ambient temperatures of up to 50°C. At 70°C, the output should be derated to 1.7 amps.
If the motor does not move smoothly there are several points to check.
Are the connections correct? Usually the motor will only move by one step, at irregular intervals, if they are not. Note that the phase outputs are numbered in ascending order - not all motors are described in this way.
Is the speed to high for the motor to start? Try a lower speed.
Do you have the correct resistors in L/R mode? Consult data sheet for details on how to calculate this.
Are you trying to move the motor into a limit? Try reading back the finish status to see where the controller thinks the motor is.
Are you sending a command before the last one finished? Make sure that you are checking that the input buffer is empty before sending another command. Also, if you write a 'read register' command, you must read back the correct number of data bytes before the command will complete.
The controller requires a reset pulse after power-up. Jumper your STEbus CPU to send SYSRST* out to the bus, so that the STMC receives this pulse.