Power Brick Controller User Manual
Special Functions & Troubleshooting
177
PowerBrick[0].Chan[0].EncCtrl = 8
// Internal Pulse And Direction
PowerBrick[0].Chan[0].TimerMode = 3
// Read as PFM when looped back in with EncCtrl = 8
Motor[1].ServoCtrl = 1
// Activate channel
Motor[1].pLimits = 0
// Disable overtravel limits
Motor[1].pAmpFault = 0
// Disable amplifier fault
Motor[1].pDac = PowerBrick[0].Chan[0].Pfm.a
// Command output, point to PFM
Motor[1].MaxDac = 2 * 32768 / (MaxPfmFreq * 1000 / (1000000 / (Puls MinPulseWidth)))
Motor[1].Servo.Kp = 50
Motor[1].Servo.Kvfb = 0
Motor[1].Servo.Kvff = 50
Motor[1].Servo.Ki = 0.001
Motor[1].InPosBand = 10
Motor[1].Servo.BreakPosErr = 1
Motor[1].Servo.Kbreak = 0
// Servo PID Kp Gain
// Servo PID Kvfb Gain
// Servo PID Kvff Gain
// Servo PID Ki Gain
// In position Bandwidth [motor units]
// Deadband size [motor units]
// Deadband gain
Motor[1].FatalFeLimit = 0
Motor[1].WarnFeLimit = 0
// Fatal following limit
// Fatal following warning
Controlling an External Stepper Amplifier / Motor
"Closing the loop" or jogging a motor driven by an external amplifier requires the following settings.
Example for Channel #1/ Motor #1:
The
MaxDac,
computed empirically
,
is the maximum command output which produces the maximum PFM
speed (frequency) with a 100% open loop output. Do not issue this command with the signals connected to
an amplifier/motor/device.
The servo PID gains can be tuned experimentally. And since this is a synthetic loop, the goal is to have
sufficient gains to allow the maximum desired speed, and no pulsing at stand still. Adding a small Deadband
can be helpful alleviating small pulses at zero velocity (due to quantization) when higher PFM frequencies
are used.
Note
The maximum value(s) to which
Motor[
x
].JogSpeed
or
Motor[
x
].MaxSpeed
can/should be set is the previously computed
PfmMaxSpeed.
Note
It is impossible to generate a PFM frequency higher than the encoder
sampling rate in this mode. The encoder clock frequency
PowerBrick[
i
].EncClockDiv
may need to be increased from the
default of 3.125 MHz if higher frequencies are required.