User's Manual
PMAC2 User Manual
64 Setting Up PMAC2 for Pulse-and-Direction Control
3. Assign an M-variable to the output command register pointed to by Ix02, double-checking to be sure
that that this address is one of the Output Command C registers that can drive a PFM circuit. For
example, define M102->Y:$C004,8,16,S to look at the Output Command Register 1C. Now
monitor the M-variable in the Executive program's Watch window or in the Terminal window as you
issue O commands. The value should change. The reported value should be equal to Ix69 * (O-
command magnitude) / 100. (Note: The command register is really a 24-bit register. By assigning
the M-variable to the top 16 bits only, the reported value is in the units of the Ix69 limit.)
5. If not getting changes in the reported M-variable, recheck Ix02 and the Why Am I Not Moving?
window. If getting changes here, next check variable I9n6 for the machine interface channel n that
you are using to make sure you are permitting the pulse and direction signals to be output.
6. To check the feedback path, first look at I9n0 for the machine interface channel n that is being used.
It should be set to 8 to take the internal pulse and direction signal into encoder counter n, or to 0 or 4
for external pulse and direction. Next, look at the setup of the Encoder Conversion Table under the
Configure menu of the Executive program. It should contain an entry specifying the quadrature
conversion of the address of the encoder counter n (listed above) that is being used, possibly with 1/T
interpolation, but preferably without. Remember that a PMAC Executive program released before
PMAC2 may identify the name of the source address incorrectly. Check the actual hexadecimal
address value (e.g. $C000 for Encoder 1, $C008 for Encoder 2). Note the address of the result
register in the table (e.g. $0720 for the first entry).
7. Now check Ix03 and Ix04. They should contain the address of the result register from the conversion
table that was just noted above. This tells the motor to use the processed value in the conversion table
as its feedback.
8. Once the presence of a pulse train and its feedback into the encoder counter and the motor position
registers have been verified, check to see if the frequency range desired is achieved. Issue an O100
command. Check the frequency by looking at the reported velocity in the window and/or by
examining the output pulse train on an oscilloscope or frequency counter. Check the frequency at
several other positive and negative command values (e.g. O50, O-50, O-100) so that the frequency
is proportional to the command and covers the range wanted.
9. If not getting the proper frequency range, double check the setting of I903 or I907 that sets the
PFMCLK frequency. Also check y the our value of Ix69 that determines the maximum frequency
(O100 frequency) at this PFMCLK frequency.
Executing the Closed-Loop Test
Next, close the loop with a J/ command. The reported position should hold steady, and the reported
velocity should be zero. Set up the jogging I-variables Ix19 to Ix22 to get the speeds and accelerations
wanted. Issue a J+ command; it should count up at the rate specified by Ix22 (watch the units). Issue a
J- command; it should count down at this same rate.
Now that what PMAC considers to be closed-loop moves is executing, the servo loop gain parameters are
important. The easiest way to monitor performance is with the position window in the PMAC Executive
Program, configured to display position, velocity, and following error for the current motor. More
detailed analysis can be done with the data gathering plots.
Troubleshooting the Closed-Loop Test
When troubleshooting these jogging moves, it is important to note what PMAC thinks the motor is doing
based on the pulse feedback compared to what the motor is actually doing. For example, if the motor has
stopped, but it is verified through the position window that PMAC keeps counting position, the motor has
probably stalled. Possibilities here include excessive velocity command, excessive load, and resonance
problems. However, if PMAC is also reporting a stop, something in the PMAC simulated loop has failed,
probably causing a shutdown on excessive following error. The main possibilities here are values set too
low for Ix30 proportional gain, Ix32 velocity feedforward, or Ix69 output limit.