Presentation on theme: "Copyright 2006 Tuning with SPiiPlus Controllers Time Domain Approach Boaz Kramer Control & Applications Development Manager."— Presentation transcript:
Copyright 2006 Tuning with SPiiPlus Controllers Time Domain Approach Boaz Kramer Control & Applications Development Manager
2 Copyright 2006 Basic Control System General control system can be divided into: Controller – control laws Drive – power converter Machine – plant, motors and feedback devices The plant receives two types of signals: Controller output from the drive Disturbances
3 Copyright 2006 Basic Control Principles The goal of the control system: Make the plant follow the command as good as possible despite the presence of disturbances while ensuring that the system is stable. The process of tuning: Adjusting the parameters of the control laws to attain a quick, stable command response. Robust operation: Control laws must be designed with enough margins to accommodate reasonable changes in the system, and from one system to another, such as change in motor constant, driver gain…
4 Copyright 2006 SPiiPlus Control Loops Cascaded control loops structure, ideal for motion control applications: Current loop (external / internal drive) Velocity loop Position loop The position loop generates a command to the velocity loop. The velocity loop generates a command to the current loop.
5 Copyright 2006 SPiiPlus Servo Algorithm Position and Velocity Loops
6 Copyright 2006 Tuning Approach (1) An inner loop should be faster than an outer loop Current response should be faster than velocity response Velocity response should be faster than position response Faster => higher bandwidth The inner loops operates with higher bandwidth, at a higher frequency zone. Typical values of bandwidths : Current loop – 0.5 kHz- 1 kHz Velocity loop – 50 Hz – 200 Hz Position loop - 10 Hz – 50 Hz High Frequency zone Low Frequency zone
7 Copyright 2006 Tuning Approach (2) An inner loop should be faster than an outer loop Current response should be faster than velocity response Velocity response should be faster than position response Each closed loop looks like a low pass filter To the velocity loop, the current closed loop looks almost like an amplifier with pure gain To the position loop, the velocity closed loop looks almost like an amplifier with pure gain Current loop Velocity loop Position loop Hz 1,
8 Copyright 2006 Zone-based Tuning Approach (1) A frequency zone-based tuning approach: Tune one loop at a time, in the following order: Current loop (the fastest control loop) Velocity loop Position loop (the slowest control loop While tuning a control loop, turn off all outer loops When tuning the current loop, turn off the velocity and position loops When tuning the velocity loop, turn off the position loop Inside the loop, turn off all low frequency elements and tune high frequency elements first The higher the bandwidth of an inner loop (= the internal loop responds faster), the better the stability of the outer loop. So the goal is to tune a loop the maximum bandwidth possible while keeping it stable and robust (= low sensitivity to small changes)
9 Copyright 2006 Zone-based Tuning Approach (2) Always tune the control loop with higher frequency zone first. Turn off all outer, slower loops and tune the inner loop first. Inside the loop turn off all lower frequency elements and tune high frequency elements first. When inner loop is tuned, it acts like a low-pass filter within the outer loop. Continue and tune the next outer loop. Higher bandwidth of internal loop (the internal loop responds faster) improves the stability of the external loop.
11 Copyright 2006 Zone-based Tuning Approach (4) Current loop: SLIKP SLIKI Velocity loop: SLVSOF SLVKP SLVKI Position loop: SLPKP Tune the PI filter in the current loop (first proportional gain, then integral gain) Set the low pass filter to 700 Hz. Disable the Notch filter. Tune the PI filter in the velocity loop (first proportional gain, then integral gain) Tune the low-pass filter/ Notch filter to attenuate high-frequency resonances. Tune the P filter in the position loop High Frequency zone Low Frequency zone
12 Copyright 2006 Control algorithms in the SPiiPlus Control elements used in the SPiiPlus control algorithm: PI filter Low pass filter Notch filter
13 Copyright 2006 PI Filter (1) The proportional-integral (PI) filter is a basic control element. It is included in the current loop and velocity loop. In certain cases also in the position loop. Sum of two signals: One proportional to the error = P x Error One proportional to the integral of the error = The proportional term (SLxKP) provides responsiveness, affects the bandwidth (how fast the response is) The integral term (SLxKI) ensures that the average error is driven to zero.
14 Copyright 2006 PI Filter (2) Frequency response of a PI filter: The proportional gain dominates the higher frequency zone. The integrator gain dominates the lower frequency zone. So, first tune the gain, while turning off the integrator! In SPiiPlus the frequency of the PI zero is always at: SLxKI/20 [Hz] SLxKI/20 [Hz]
15 Copyright 2006 PI Filter (3) PI Filter Digital Implementation:
16 Copyright 2006 SPiiPlus provides a second order low-pass filter. In many cases, it can be used to increase the overall bandwidth of the velocity loop. It attenuates high frequency noise and resonances (=phenomenon in which the plant has high gain around one frequency). Low Pass Filter (1) Bode plot of 2 nd order low-pass filter with different damping factors.
17 Copyright 2006 The second order low-pass filter attenuates all signal components above a certain frequency. The frequency is specified by the SLVSOF variable. Filter damping is determined by SLVSOFD variable. In many cases a proper reduction of the low pass filter bandwidth (relative to its default value) allows to further increase the velocity gain. The major disadvantage of the second order low pass filter is that it affects stability by adding a significant amount of phase lag and thus reducing the phase margin. Usually, SLVSOF has to be times above the velocity loop bandwidth. Thumb rule: set SLVSOF=SLVKI. Low Pass Filter (2)
18 Copyright 2006 SPiiPlus provides a Notch Filter. In many cases, it can be used to increase the overall bandwidth of the velocity loop. The Notch filter attenuates only a narrow band of frequencies. It is usually set above the bandwidth of the velocity loop. Notch Filter(1) Bode plot of Notch filter with different widths
19 Copyright 2006 Notch filter advantage: less phase lag contribution in comparison to the low-pass filter. Notch filter disadvantages Usually the transfer function of the plant has to be known in order to place the Notch filter properly. The Notch bandwidth has to be sufficiently wide : resonant frequencies may vary slightly in different machines of the same kind. The resonant frequency may depend also on the position of the axes. Notch Filter(2)
20 Copyright 2006 Notch filter parameters: SLVNFRQ – Notch frequency SLVNWID – Notch width (3 dB points) SLVNATT – attenuation (absolute units) It is not recommended to use the Notch filter before measuring the frequency response of the system using SPiiPlus FRF Analyzer. Notch Filter(3)
21 Copyright 2006 Before starting tuning… Open the Adjuster Define the Safety Parameters Define the drive/motor/encoder parameters in Axis Setup dialog
22 Copyright 2006 Important Safety Parameters Critical position error: CERRI(idle) CERRV(velocity) CERRA(acceleration) RMS protection : XRMS (nominal current in %) XRMST (time constant in msec) Current limits: XCURI(idle) XCURV(velocity) Maximum velocity: XVEL has important effect on velocity scale factor! Maximum acceleration: XACC
23 Copyright 2006 Axis Setup Define the following: Control configuration: single loop or dual loop control. Drive type and parameters: DC amplifier, DC brushless amplifier with hardware or software commutation. Motor type and parameters: type, number of poles (for rotary motor), magnetic pitch (for linear motor). Encoder type and parameters: primary/secondary encoders, type (AQB, SIN-COS etc), resolution, multiplier(internal/external). Some parameters (like amplifier/motor ratings) are not used by the controller.
24 Copyright 2006 Current Loop Tuning Open the Current Loop Adjustment in the Adjuster. Set SLIKI to zero, or set it very low (like 100). Set SLIKP low (like 10). Apply a square wave : set the amplitude 5-10% Set the pulse length 4-10msec. Press Run. Raise SLIKP gradually as long as high frequency effects (noise) are not noticed and there is little or no overshoot. Changing SLIKI should not require returning to change SLIKP. Raise SLIKI starting with zero, until overshoot is excessive, usually 10% - 15%. Typical values : ,000 If later on, you notice that the current loop is noisy, then it is recommended to further reduce SLIKP.
25 Copyright 2006 Current Loop Tuning
26 Copyright 2006 Before Going on… Before going on to velocity and position loop tuning. There are few additional steps that should be made Commutation for Brushless motors Open loop verification
27 Copyright 2006 Commutation In any electrical motor, the electromagnetic torque is generated because of an interaction between a magnetic field and a current. The produced torque is proportional to the following cross product: where: :magnetic flux vector :current vector :angle between the vectors If the two vectors are perpendicular, the torque is proportional to the current, which is the basic and most important requirement for high performance servo action.
28 Copyright 2006 DC –Brush Motor Commutation The magnetic field is generated by permanent magnets. The brushes and commutator make sure the armature current is always maintained perpendicular to the magnetic field.
29 Copyright 2006 Brushless Motor Commutation (1) In case of DC Brushless motor (permanent magnet synchronous motor): The magnetic field is generated by the permanent magnets. 3-phase sinusoidal currents generate a current vector. Sinusoidal Commutation: The commutation angle determines the current vector orientation. It is desirable to keep the current vector perpendicular to the magnetic field.
30 Copyright 2006 Brushless Motor Commutation (2) In the commutation process of brushless motors: A stationary current vector is generated.The motor jumps to align with it The current vector is then shifted 90. The current vector is maintained perpendicular: If the permanent magnet field moves, the current vector moves with it.
31 Copyright 2006 Brushless Motor Commutation (3) If the encoder is incremental, the process has to be repeated after each controller powerup. We have to distinguish between: Initial commutation adjustment (during the first setup) Commutation after each powerup. Initial commutation setup also includes: Phase sequence identification Commutation parameters verification
32 Copyright 2006 Commutation Preferences (1) First-time commutation is executed by running commutation setup from the Adjuster.
34 Copyright 2006 Commutation Preferences (3) Excitation Current - define amplitude of generated current vector in %, sufficiently high to overcome system friction and active load. Default is 0.95 x XRMS. Search Velocity – determines velocity of commutation process in user units/second. It is recommended to set velocity between 1 – 1/5 of magnetic pitch per second. Settling Time - determines time assigned to motor for settling in detent points. Default is 1000 msec. Initial Commutation Offset – determines initial detent point in degrees. By setting a proper value (if known, for example, if the axis is known to rest close to a limit when off) user can avoid or decrease an initial motor jump. Default value is 0 degrees.
35 Copyright 2006 Commutation Preferences (4) Commutation Schemes –different commutation schemes are provided: Detent Point (default) – encoder based only. Index based commutation schemes: finds the correct commutation phase at the index. The value can be used later on in startup/homing programs. Hall commutation scheme (for SPiiPlus CM) – commutation is initiated based on Hall sensors, and closed-loop operation can start immediately after powerup. Maximum Search Distance – sets maximum allowed distance for searching for a limit or an index. Check Motor & Feedback Parameters Default (button) – loads default values.
36 Copyright 2006 After Powerup…. Method 1: The Adjuster can generate a startup program based on the chosen commutation scheme. The program can be used as part of the homing routine. In all schemes the motor initially jumps to align with the current vector. Method 2: Use the COMMUT command: brings the current vector to the motor in closed-loop. The current vector can be controlled with high bandwidth and motor hardly moves. Method 3: Initial hall-based commutation: Move in six steps till the first hall transition and automatically switch to sinusoidal commutation.
37 Copyright 2006 Commutation Method 1 When the commutation bit (MFLAGS.9) is off and motor is enabled: the commutation phase is incremented according to the desired position (stepper mode): K POLE converts encoder counts to electrical degrees When fields are aligned it is assumed: DP=CP When MFLAGS.9 =0 and motor is disabled: the commutation phase is incremented according to the feedback position. When MFLAGS.9 =1 the commutation phase is incremented according to the feedback position and 90 degrees are added:
38 Copyright 2006 Commutation Method 1 Example for Method 1: X_MFLAGS.9 = 0 ! Commutation bit off X_DCOM = 30 ! Constant drive command ENABLE X ! Align fields WAIT 1000 ! Wait for motor to settle PTP/RVE X, X_SLCPRD/4, X_SLCPRD/4 ! Move slowly WAIT 1000 ! Wait for motor to settle DISABLE X X_DCOM = 0 ! Reset constant drive command X_MFLAGS.9=1 ! Commutation on STOP Q: Is it really required to move ? Q: What about hard stops ? Vertical axis ? Important note: When MFLAGS.9 = 0 the motor can be moved in stepper mode, without relaying on feedback. This is an important feature, that can also be used for troubleshooting the hardware !
39 Copyright 2006 COMMUT Command Closed loop control of the commutation phase: Examples: COMMUT X!use default current and settling time COMMUT X, 10 !use 10% current and default settling time COMMUT X, 10, 1000 ! Use 10% current and 1000msec The algorithm is executed 3 times (3 ticks) to eliminate unstable equilibrium. Before using COMMUT for the first time: First time Adjustment must be performed. Motor has to adjusted with proper stability margins.
40 Copyright 2006 Open Loop Verification Required to eliminate positive feedback for DC motors. Positive drive command should yield positive move (=encoder counts up). Can be also used to compensate amplifier offset. In case of brushless motors: after the initial commutation process the polarity is guaranteed.
41 Copyright 2006 Velocity Loop Tuning Set SLVKI to zero, or set it very low. Set SLVKP low. Enable the motor. If it is noisy – reduce SLVKP Apply a square wave velocity command and raise SLVKP no higher than the high frequency effects (noise, resonances) allow. When motor is noisy or oscillating, it is recommended to lower SLVKP by 50% (to ensure gain margin). Changing SLVKI should not require returning to change SLVKP. Raise SLVKI from zero until overshoot is excessive, usually 10% - 15%.
42 Copyright 2006 Velocity Loop Tuning
43 Copyright 2006 Verify the value of the maximum velocity, XVEL before starting the velocity loop tuning! The parameter has two major roles: Limits the amplitude of the velocity command. Defines the feedback velocity scale factor. If XVEL is larger than 2E+6 counts/sec, the velocity scale factor is reduced proportionally to the XVEL parameter. This affects the dynamic range of the velocity gain SLVKP. Effect of XVEL Parameter
44 Copyright 2006 Integrator Limit The integrator limit is used to prevent the integrator from exceeding a certain value. For the velocity loop the parameter is SLVLI. Default value -50%. The integrator limit should be sufficiently high, zeroing the velocity error while the system is moving at maximum constant velocity. The default value of 50% is usually adequate for many systems. Nevertheless, in some cases it is desirable to modify the value. If the value is too high it may cause undesirable overshoots or saturation, especially in high-inertia or short stroke systems.
45 Copyright 2006 The position loop is tuned after the velocity loop. The position loop includes a proportional gain K P. Apply a point-to-point profile with the highest-acceleration command to be used in the application. Increase K P to minimize the position error. Position Loop Tuning
46 Copyright 2006 Position Loop Tuning (2)
47 Copyright 2006 If the velocity loop is properly tuned, the position loop bandwidth approximately equals K P (rad/sec) independent of the motor parameters. Position Loop Tuning (3)
48 Copyright 2006 Feedforward compensations greatly improve the command response without producing stability problems. The ideal feedforward produces the expected command. Thus, the control loop only needs to add corrections due to disturbances. Velocity Feedforward – is set automatically to compensate the velocity feedback. As a result, the average position error is zeroed during constant velocity. Acceleration Feedforward (SLAFF)– should be tuned to maximally decrease the position error during acceleration and deceleration. Velocity and Acceleration Feedforward
49 Copyright 2006 Summary (1) The SPiiPlus provides a cascaded control loops structure: An internal current loop, a velocity loop on top of it and a position loop on top of the velocity loop. This structure is ideal for most motion control applications and allows easy and fast tuning using a frequency zone-based approach. Internal loops are tuned first, with the external loops disabled. The tuning goal should be to get the maximum bandwidth for each loop while maintaining its stability. A methodical tuning flow-chart was provided for each loop. High-order filters, like a 2 nd order low pass and a Notch filter, can be used to attenuate resonances and further increase the system bandwidth. Advance commutation methods allow easy and reliable commutation of brushless motors.
50 Copyright 2006 Summary (2) Further improvement can be achieved by using frequency response tools, like the SPiiPlus FRF Analyzer. The SPiiPlus standard control algorithm will result exceptional results in most motion control applications. Nevertheless, in very demanding applications a customized algorithm that was specifically tailored for an application can further improve performance ACS-Tech80 has established a Control and Application Development group to help customers optimize the performance of their machines and to provide them with a competitive advantage over their industry peers.
51 Copyright 2006 Control & Application Development Services provided by the Control & Application Development group include: Tailored customization of the standard servo algorithms offered in ACS- Tech80 products for specific applications Development of unique algorithms to maximize machine performance and modeling Simulation and analysis of control systems. Particular expertise has been gained in the following areas: Mitigation of mechanical resonances Non-linear control algorithms Dual loop systems Gantry systems Observers Control of special motors Gain scheduling techniques Disturbance rejection improvement Special motion profiles