.........The motor control commands are used to set the operating conditions for running the stepper motor, and to actually move the motor. Various commands set relevant parameter values, and two commands cause actual motor motion. In addition, the JOG signal may be used to move the motor manually at any time.
Three commands set up the basic step rate functions for the CY545. They are:
R Rate.....Set maximum step
rate
F Rate.....Set initial step rate
S Slope....Set acceleration slope
The rate parameters for Rate and FirstRate are single byte values that select the initial and maximum step rates for the motor. These parameters are pointers into the CY545 Rate Table, shown in a later section of this manual. The actual step rate in steps per second comes from a combination of the Rate Table and the operating frequency of the CY545. The step per second values of the Rate Table have been computed for a crystal frequency of 12 MHz. The use of other frequencies causes a linear scaling of the rates, and may be derived by multiplying the given rates by Fcy/12, where Fcy is the actual crystal frequency (in MHz) used for the CY545.
The slope parameter for the Slope command determines how quickly the CY545 accelerates and decelerates while stepping. It is also a single byte value, and should range from 1 to 255. Slowest accelerations are selected by small values of slope, while fast accelerations use larger values for slope. In practice, you must experiment with the slope parameter value to determine the optimal acceleration for your specific application. Initial values in the 175 to 225 range might be tried, with adjustments made as required.
Acceleration and deceleration are symmetrical, and are controlled by the single slope parameter. For small values of slope, the CY545 can take a very large number of steps to go from the initial rate to the maximum rate. If the distance to travel is too short to allow the CY545 to reach the maximum rate, it will perform a partial acceleration, reaching the highest possible rate under the current slope parameter, before having to decelerate to stop at the target position.
Three commands set relative mode values for the CY545. They are:
N Num24 Set number of steps + Select CW direction -.......... Select CCW direction
The Number command specifies the number of steps the CY545 is to take in the relative step mode. It uses a 24-bit parameter, so the CY545 can travel + or - 16 million steps from its current position in the relative mode. No stepping occurs when the Number command is issued, the command simply defines the number of steps to take, and this value is stored in an internal N register of the CY545.
The + command selects the clockwise direction for stepping. This command causes the CCW signal to go low.
The - command selects the counter-clockwise direction for stepping. The CCW signal will go high when this command is used. Also, stepping direction may be controlled externally, by driving the CCW pin with the desired level. If this function is used, the - command should be issued, so the CCW signal is high. It can then be pulled low externally to force clockwise stepping.
If the CCW pin is being driven low by the CY545, it is a stronger sink device, and will require a very strong external signal to force the pin into the high state for CCW stepping. However, if the CCW pin is held high by the CY545, from a - command, it can easily be driven low for CW stepping.
Two CY545 commands control step operation modes for the CY545. They are:
A Pos24 Set current step position C.......... Select continuous step mode
The At command sets the current position kept by the CY545 to the value of its parameter. This number is a 24-bit value, so any position from 0 to 16777215 may be specified. Normally, this command is used after stepping to a known mechanical position, such as a “home” position sensor, and can calibrate the CY545 to make this position always be the same number.
While the CY545 is stepping, the internal current position is always updated. The position is incremented during CW stepping, and decremented during CCW stepping. You may query the CY545 for its current position while it is not stepping.
The position value is not too important for relative mode stepping, in which the direction and number of steps are specified. However, it is very important for absolute mode stepping, in which a target position is specified, and the CY545 computes the direction and number of steps required to reach the target.
The Continuous command sets a special step mode in the CY545. In this mode, the CY545 will accelerate from the initial rate to the final rate, and then run continuously. It will not ramp down or stop at any particular position or number of steps.
In order to stop a continuous motion, the INHIBIT-ABORT signal must be pulled low, forcing the CY545 into a deceleration mode, and then be kept low to stop the CY545. The CY545 will stop, after it has decelerated to the starting rate, if the INHIBIT _ABORT signal is still low.
The continuous mode is set by the C command, but stepping does not begin with this command. The continuous mode may also be selected by external signal. This is done by forcing the SLEW signal low as the CY545 starts stepping.
Finally, two commands are used to actually make the motor move, based on the currently defined parameters. They are:
G ........ Step in a relative mode P Pos24 Step to the specified target position
The Go command selects relative mode stepping. The CY545 will step based on the last Number of steps specified and the selected step direction. A continuous mode step motion may also be started by this command.
Absolute mode stepping is selected by the Position command. This command both specifies the desired target position and starts the motion. When the target is specified, the CY545 will compute the number of steps to take and the direction of motion, based on the current position register.
If the target position is greater than the current position, the CY545 steps in the CW direction. If the target position is less than the current position, the CY545 steps in the CCW direction.
Recall that the current position is defined by the At command, and is updated with every motion. It is a 24-bit value, ranging from 0 to 16777215. The Position command limits stepping to a number of steps within this range.
If a relative motion causes overflow or underflow of the current position register, an absolute move would now work within the new block of 16 million steps. For example, if the current position is 00000020, and the following commands are executed:
N 30<cr>
-<cr>
G<cr>
The motor will step 30 steps CCW, and the current position register will underflow to a value of -10, which is 16777205. If you now command:
P.0<cr>
The motor will step 16 million steps in the CCW direction, since the CY545 believes the motor is at position 16777205. It does not remember that an underflow occurred, and will not take 10 steps CW to get back to the original position 0.
This behavior also allows stepping to regions beyond the 16 million step block supported by the CY545. As long as you can work within a block of 16 million steps, relative mode stepping can be used to move from one block to the next, with the host computer keeping track of which block the CY545 is currently located in.
![[Figure 5.1]](gif/545-12.gif)
00 Contents ..|..
01 Intro ..|..
02 Pins & Packages ..|..
03 Cmd Interfaces ..|..
04 Commands..|..
05 Motor Cmds
06 Bit Cmds..|..
07 Memory Cmds..|..
08 Prog Branch Cmds..|..
09 Mode Cmds ..|..
10 Misc Cmds
11 Circuits ..|..
12 External Memory ..|..
13 Thumbwheel Switch
..|.. 14 Output
Display ..|..
15 Proto Boards
16 Timing & Control
..|.. 17 Rate
Tables ..|..
18 Electrical Specs ..|..
19 Examples ..|..
20 Up & Running
Back to CY545 Data Sheet
© 1988 - 1999 Cybernetic Micro Systems, Inc.
All rights reserved.
CY545 Manual 22MAR99