230 likes | 427 Views
Note. Motor[x].Servo.Kp Proportional Gain (K p ) Motor[x].Servo.Kvfb Derivative Gain (K d ) Motor[x].Servo.Kvff Velocity Feedforward (K vff ) Motor[x[.Servo.Ki Integral Gain (K i ) Motor[x].Servo.SwZvInt Integration Mode Motor[x].Servo.Kaff Acceleration Feedforward (K aff )
E N D
Note • Motor[x].Servo.Kp ProportionalGain (Kp) • Motor[x].Servo.Kvfb DerivativeGain(Kd) • Motor[x].Servo.Kvff Velocity Feedforward (Kvff) • Motor[x[.Servo.Ki IntegralGain(Ki) • Motor[x].Servo.SwZvInt Integration Mode • Motor[x].Servo.Kaff Acceleration Feedforward (Kaff) • Motor[x].Servo.Kfff Friction Feedforward (Kfff)
Set Motor[x].Servo.SwZvInt (Motor xx PID Integration Mode) – can be changed on the fly as needed =1, position error integration is performed only when Motor xx is not commanding a move =0, position error integration is performed always When tuning the feedforward gains, set Motor[x].Servo.SwZvInt =1 so that the dynamic behavior of the system may be observed without integrator action. After tuning these, set Motor[x].Servo.SwZvInt back to your desired setting. 2. Using the Step Response, tune the following parameters in this order: Proportional Gain, Kp (Motor[x].Servo.Kp) Derivative Gain, Kd (Motor[x].Servo.Kvfb) Integral Gain, Ki (Motor[x[.Servo.Ki) 3. Using the Parabolic Move, tune the following parameters in this order: Velocity Feedforward, Kvff (Motor[x].Servo.Kvff) Acceleration Feedforward, Kaff (Motor[x].Servo.Kaff) Friction Feedforward, Kfff (Motor[x].Servo.Kfff) Note that if your amplifier closes the velocity loop, you can set the derivative gain terms (Motor[x].Servo.Kvfb, Kvifb, Kvff, and Kviff) to 0.
Select the Motor Number here Input the move size here
Select “Position Step” under “Trajectory Selection.” Choose a “Step Size” (under “Step Move”) that is within ½ to ¼ of a revolution of the motor if it is a rotary motor, or within ½ to ¼ of one electrical cycle if it is a linear motor. The step move’s commanded position profile should look somewhat like this: Commanded Position [cts] Time [sec] Now, compare your motor’s actual position to the commanded position profile. Depending how the actual position looks, adjust the servo loop gains until you achieve the desired response.
Observing the table below, match your actual position response to one of the response shapes below, and then adjust the appropriate gain as listed next to each plot:
Start by increasing Kp until you observe the “Overshoot and Oscillation” condition (upper left corner’s plot), and then increase Kd and Kiuntil the performance goals for the step response are achieved. Be sure when executing the step response that you plot the Servo Command on the Right Axis (see image on right below). If you see a truncation of the servo command at the beginning of each move, you have reached the maximum output command as determined by Motor[x].MaxDac. In this case, adding more Kp will not improve the Step Response’s performance.
A saturation of the servo command looks like a flat spot at the peak or valley of the yellow servo command curve as shown below:
Select “Parabolic Velocity” under the “Trajectory Selection” in the Interactive Tuning Window. Select a move size and speed that will simulate the fastest, harshest moving conditions you expect your machine to experience. Tune the motor at these settings, and then the motor should be able to handle all easier moves.
This is what the velocity and acceleration commanded profiles should look like: Velocity Commanded Profile Acceleration Commanded Profile
Observing the table below, match your following error response to one of the response shapes below, and then adjust the appropriate gain as listed next to each plot:
The magnitude of the gain you need to use will vary depending on your system. The higher the resolution your motor’s feedback is, the smaller the gains will be. As a reference point, for an unloaded 24 VDC Brushless motor that can handle 4 Amps Continuous and 8 Amps Peak, with a 2000 counts/rev encoder, the order of magnitude of the gains is as follows: • Kp ~ 0 – 100 • Kvfb ~ 250 – 2000 • Ki ~ 10-3 • Kvff ~ Kvfb • Kaff ~ 104 • Kfff ~ 100 – 1000
Motor[x].Servo.Kvifb • Alternative feedback derivative gain. • Is added to the input of the integrator rather than the output, causing the integrator to act on velocity error, rather than position error as is the case when using Kvfb. • Kvifb provides better disturbance rejection. Kvfb provides better trajectory tracking. • Motor[x].Servo.Kviff • Alternative feedforward derivative gain. • Is added to the input of the integrator, rather than the output. • Kviff provides better disturbance rejection. Kvff provides better trajectory tracking with minimal following error.
Is this a Cross-Coupled Gantry? • Tune both motors individually, then activate gantry cross-coupled control. • Motor[x].Ctrl=Sys.GantryXCtrl for lower-numbered motor in gantry • Motor[x].ExtraMotors=1 for lower-numbered motor in gantry • Motor[x].ServoCtrl=1 for lower-numbered motor, =8 for higher-numbered • Then, tune Motor[x].Kxpg, Kxig, and Kxvg for each motor. • Is the load varying dynamically? • Use Adaptive Control. • Motor[x].Ctrl=Sys.AdaptiveCtrl • Motor[x].Servo.EstTime • Motor[x].Servo.EstMinDac • Motor[x].Servo.EstGain • Motor[x].Servo.GainFactor, MinGainFactor, MaxGainFactor
Is this an AC Induction motor? • Motor[x].SlipGain • Motor[x].IdCmd • Is this a stepper motor with a pulse-and-direction drive? • Use pulse-and-direction output with simulated feedback: • Gaten[i].Chan[j].OutputMode=8 • Gaten[i].Chan[j].EncCtrl=8 • Set prescribed gains: • Motor[x].Servo.Kp=1 • Motor[x].Servo.Kvff=1.5 • Motor[x].Servo.Ki=0.001 • Motor[x].Servo.Kbreak=0 // Zero gain in deadband area • Motor[x].Servo.BreakPosErr=1 // Prevent standby power mode in amp • Set PFM-Related Gate settings: • Gate3[i].Chan[j].OutFlagD=1 • Gate3[i].Chan[j].PfmWidth=10 • Gate3[i].Chan[j].packoutdata=0 • Gate3[i].Chan[j].packindata=0
Is this a stepper motor with a Direct PWM Drive? • Use Direct Microstepping: • EncTable[n].type=11 • EncTable[n].pEnc=Motor[x].IqCmd.a • EncTable[n].index5=63 • EncTable[n].index4=1 • EncTable[n].ScaleFactor=1.0/65536.0 • Motor[x].pEnc=EncTable[n].a • Motor[x].pEnc2= EncTable[n].a • Motor[x].Servo.Kp=4 • Motor[x].Servo.Kvfb=Motor[x].Servo.Kvifb=0.0 • Motor[x].Ki=0.0 • Motor[x].Servo.Kvff=4 • Motor[x].Servo.Kviff=0.0 • Motor[x].Servo.Kaff=4
Motor[x].PhaseCtrl=6 Motor[x].PhaseOffset=±512 Motor[x].PhaseMode=1 Motor[x].PhaseFindingTime=0 Tune Motor[x].IpfGain, IpbGain, and Iigain just as for brushless motors Motor[x].pAbsPhasePos=Gaten[i].Chan[j].PhaseCapt.a Motor[x].AbaPhasePosSf=Motor[x].AbsPhasePosOffset=0 Motor[x].PhasePosSf=0 Motor[x].SlipGain=Sys.PhaseOverServoPeriod/(4.0) Set Motor[x].IdCmd to get the desired current in the motor. Increase for more torque, decrease for more speed. Motor[x].PhaseFindingStep=1
Is this a piezoelectric motor? • Treat the motor as being in position mode, meaning you only need Kp and Ki, and potentially Kfff. • Add deadband to help the motor to break free of static friction.