User's Manual
PMAC2 User Manual
62 Setting Up PMAC2 for Pulse-and-Direction Control
Output (Frequency) Limit: Ix69
Ix69 controls the maximum pulse frequency for a given PFMCLK frequency. At the maximum Ix69
value of 32,767, the maximum pulse frequency is one-half of PFMCLK (this would require that the pulse
width set by I904 or I908 be only 1 PFMCLK cycle). Typically a maximum frequency substantially
below this is wanted. The formula for setting Ix69 is:
536,65*
)MHz,kHz(PFMCLK
)MHz,kHz(MaxFreq
69Ix =
Note:
Ix70 must be set to 0 on a motor using PFM outputs for internal PMAC
computational reasons. Otherwise, slow drift can occur (Ix70 effectively acts as a
fractional bias term).
For example, with PFMCLK at the default of 9.83 MHz, and a desired maximum frequency of 500 kHz,
Ix69 = (0.5 MHz / 9.83 MHz) * 65,536 = 3333.
Parameters to Set Up Motor Servo Gains
If using real feedback sensors, the motor should be tuned as a normal servo motor would be tuned. If
feeding the pulse train back into the encoder counter to create a fully electronic loop, the loop response is
very predictable and the tuning gains can be set by formula as explained here. In either case, the control
loop appears to PMAC2 to act as a velocity-mode servo drive.
To create a closed-loop position response with a natural frequency of 25 Hz and a damping ratio of 1
(suitable for almost all systems), use the gain settings as calculated in the following sections.
Proportional Gain: Ix30
The proportional gain term Ix30 is set according to the equation:
)MHz(PFMCLK*08Ix
000,660
30Ix =
For example, with PFMCLK at the default of 9.83 MHz, and Ix08 at the default of 96, Ix30 = 660,000 /
(96 * 9.83) = 700.
Derivative Gain: Ix31
The derivative gain term Ix31 is set to zero, because the loop behaves like a velocity-loop servo drive, and
there is no need to have the PMAC2 add damping.
Velocity Feedforward Gain: Ix32
The velocity feedforward gain term Ix32 is set according to the equation:
)kHz(ServoFreq*666032Ix
=
where ServoFreq is the frequency of the servo interrupt as established by I900, I901, and I902. For
example, with ServoFreq at the default of 2.26 kHz (I900=6527, I901=0, I902=3), Ix32 = 6660 * 2.26 =
15,050.
If Ix30 is set differently from what its above formula dictates, Ix32 should be changed from the value its
above formula dictates in inverse proportion to the change in Ix30. For instance, if Ix30 is half of what is
calculated above, Ix32 should be twice what is calculated above.
Integral Gain: Ix33, Ix34
Typically, the integral gain term Ix33 is set to zero because there are no offsets or disturbances to the
digital electronic loop. Some people will use integral gain to force zero steady-state errors, even when
other gains are not well set.