30
Automatic stall detection operates continuously once it is initiated. The
current desired position (target position) is compared with the actual
position (fromthe encoder) and if the difference between these two
values exceeds a specified limt a stall condition is detected.
To initiate automatic stall detection the host must specify the number of
encoder counts per output mcro step. This is accomplished using the
command SET_STEP_RATIO. The following equation shows how this
value should be set for various values of encoder count resolution.
Ratio = (Ncounts/Npulses)*256.
where:
Ratio is the ratio value specified to the SET_STEP_RATIO
command
Ncounts is the number of encoder counts per motor
rotation.
Npulses is the number of output mcro steps per motor
rotation. This value 12,800 for a 1.8 degree step motor
and 3,200 for a 7.2 degree step motor
For example if a step motor with 1.8 degree full step size is used with
an encoder which has 4,000 counts per motor rotation, the ratio
specified in the SET_STEP_RATIO command would be
(4,000/12,800)*256, or 80.
Although the MC1241A supports stall detection with encoders that have
a different number of counts then pulses, the ratio provided with the
SET_STEP_RATIO command must be an exact integer. For example
in the above example an encoder with 4,000 counts per rotation which
gives a ratio value of 80 is acceptable however an encoder with 4,096
which gives a ratio value of 81.92 is not acceptable.
Position Error
The difference between the desired position, also called the target
position, and the actual encoder position is known as the position error,
or the actual position error.
The position error is continuously maintained by the chipset and can be
read by the host at any time. To read the position error the command
GET_ACTL_POS_ERR is used.
To performthe stall detection function the position error is continuously
compared with the maximumallowed position error, which is set using
the command SET_POS_ERR. To read this value back the command
GET_POS_ERR is used. The units of the maximumposition error is
encoder counts.
If the maximumposition error value is exceeded (stall is detected), then
the axis is said to be in a "motion error" condition. When this occurs the
motion error bit in the axis status word is set, and further pulse
generation may be halted, depending on the state of the automatic
motor shutdown mode (see SET_AUTO_STOP_ON and
SET_AUTO_STOP_OFF host command descriptions).
If the automatic motor stop mode is not set than only the motion error
status bit is set.
Recovering From A Motion Error
To recover froma motion error which results in the mcrostep output
being halted, the following sequence should be performed:
1)
Determne cause of motion error and correct problem(this may
require human intervention).
2)
Re-enable motor output using the MTR_ON command
After the above sequence the axis will be at rest, and the position error
between the target position and the actual encoder position will be set
to zero.
Resetting the position error is useful not only for motion error recovery
but also when the coordinate systemis changed. Several commands
reset the position error to zero. These commands are
SET_ACTL_POS, which sets the actual as well as the target position to
a particular value, and SYNCH_PRFL, which sets the actual position
equal to the target position. The SYNCH_PRFL command will not take
affect until an UPDATE command is given.
Mcrostepping
In addition to trajectory generation the MC1241A chipset provides direct
internal generation of mcrostepping signals for 2-phase as well as 3-
phase stepper motors.
The following diagramshows an overview of the control flow of the
mcrostepping scheme:
Trajectory
Generator
Phase A
command
Phase B
command
Motor command register
(SET_MTR_CMD)
To
Amp.
Motor Output
(PWMor DAC16)
The mcrostepping portion of the chipset generates a sinusoidal
waveformwith 64 distinct output values per full step (one full step = a
quarter electrical cycle).
The output frequency of the mcrostepping signals are controlled by the
trajectory generator. The amplitude of the mcrostepping signals are
controlled using a register that can be set by the host processor known