Difference between revisions of "Tuning position controller"

From Granite Devices Knowledge Wiki
Jump to: navigation, search
[checked revision][checked revision]
(Steps to do after tuning finished)
(Steps to do after tuning finished)
Line 87: Line 87:
 
*Undo all temporary changes made to settings
 
*Undo all temporary changes made to settings
 
*Save settings to drive memory by clicking ''Save settings on drive non-volatile memory'' button
 
*Save settings to drive memory by clicking ''Save settings on drive non-volatile memory'' button
 +
*Set preferred setpoint source [[CRI]], also consider the use of [[CIS]]
 +
*If setpoint signal scaling is needed, adjust [[MUL]] and [[DIV]] values
  
{{tip|If drive will be controlled by an external motion [[controller]] with acceleration & velocity limits, such as CNC controller programs like '''Mach3''' or '''EMC2''', then its recommended to increase acceleration limit [[CAL]] to the maximum value of 32767 to prevent drive's internal acceleration limiter modifying the [[setpoint signal]]. Setting [[CAL]] to value 32767 effectively disables the internal acceleration limit and let's external controller to control accelerations.}}
+
{{tip|If drive will be controlled by an external motion [[controller]] with acceleration & velocity limits, such as CNC controller programs like '''Mach3''' or '''EMC2''', then its recommended to increase acceleration limit [[CAL]] to the maximum value of 32767 and disable setpoint smoothing [[CIS]] to prevent drive's internal acceleration limiter modifying the [[setpoint signal]]. Setting [[CAL]] to value 32767 effectively disables the internal acceleration limit and let's external controller to control accelerations.}}
  
 
[[category:Granity user guide]]
 
[[category:Granity user guide]]
 
[[category:Tuning guide]]
 
[[category:Tuning guide]]

Revision as of 21:01, 28 August 2013

Position controller tuning means finding the correct drive settings and feedback gain values to achieve a proper Servo stiffness and response to a position setpoint change.

Position control tuning method

This article describes a practical approach for finding proper drive parameters to achieve a stable and stiff position control.

Preparations

An example of Testing tab settings for position controller tuning. Different settings should be experimented during the process to observe the stability and behavior of the settings.

Steps to do to begin position tuning:

  • Ensure that motor is parameterized correctly and working and torque control tuning has been properly done.
  • Attach motor to the target machine in a position where it can rotate in both directions
  • Make following parameter changes to Granity and click apply afterwards:
    • Set drive in position control mode CM
    • Choose Serial only setpoint input CM
    • Make other necessary adjustments to have drive powered and enabled
  • Optional but recommended:
    • Untick Setpoint smoothing CIS
    • Set Goals tab DIV and MUL to 50
  • Set-up the test stimulus and capture settings from Testing tab (an example, may be varied):
    • Set target setpoint 1 TSP1 to 100
    • Set delay 1 TSD1 to 0.25 seconds
    • Set target setpoint 2 TSP2 to -100
    • Set delay1 STD2 to 0.25 s
    • Choose sample rate TSR of 500 to 2500 Hz
    • Choose Capture setpoint change in positive direction from the dropdown
    • Tick Continuously repeating capture
    • Tick Position setpoint and Position achieved from signals
    • Tick Start capture to begin continous capture.
    • Tick Enable test stimulus TSE to begin a continuous position back and forth motion generation

Once the steps above are done, motor should be generating short distance back and forth motion motion and position response graphs should appear on the right side of Granity about once in 3-5 seconds.

Finding velocity & position control gain values


The task here is to adjust the MR and ML parameters to achieve near optimum step response for the torque controller. Observe the images below for guidance.

Posgains1.png

The image above represents the initial position step response with low feedback gains. As seen, motor reaction is sluggish, lagging and has overshooting.

Posgains2.png

The next step is to increase KVP gain as much as possible. The graph may start looking acceptable but it motor still has low stiffness thus it will get lag once mechanical load increases.

To try different gains, go to Tuning tab, change value and click the Apply settings button.

Posgains3.png

When KVP has been increased too much, the system becomes unstable and may start oscillating. In such case, you may hit Esc button to disable drive, reduce the gain and enable drive again.

Tip: torque bandwidth has significant effect on the behavior of KVP value and the point where it goes unstable. One may experiment different TBW settings to find the optimum.

Posgains4.png

Once a maximum perfectly stable KVP value has been found, start increasing KVI gain by a similar fashion. The higher KVI value is, the better servo stiffness.

Posgains5.png

If KVP is increased too much, the result is instability and oscillation. The cure is similar to the too high KVP gain as described earlier.

Posgains6.png

Once both KVP and KVI has been optimized, the next step is to increase KPP gain the same way. Increasing KPP gives better servo stiffness but may also increase overshooting. Overshoot less than 10 feedback device counts is generally considered good.

Posgains7.png

Finally after playing little bit with all of KVP, KVI and KPP gains experimentally, we find a less overshooting response without losing much stiffness.

Curing tracking error and overshoot

If servo overshoots too much, or can't follow the trajectory precisely, several cures may be tried.

Posgains8.png

Reducing acceleration CAL and/or velocity CVL limits makes the trajectory easier to follow and reduces tracking error and overshooting.

Posgains9.png

The same may be also achieved by utilizing Feed-forward gains VFF and AFF which essentially compensate system friction and mass limiting the dynamic performance.

The recommended way to tune FF gains, is to start increasing velocity feed-forward VFF until the optimum level has been found. After that, increase acceleration feed-forward AFF until the optimum point has been reached.

Steps to do after tuning finished

  • Stop test stimulus by unticking TSE
  • Stop scope catpure by unticking Continuously repeating capture
  • Undo all temporary changes made to settings
  • Save settings to drive memory by clicking Save settings on drive non-volatile memory button
  • Set preferred setpoint source CRI, also consider the use of CIS
  • If setpoint signal scaling is needed, adjust MUL and DIV values