Robo G4 Torque, Speed, and Position

Conveyor Tuning Example

 

 

 

 

 

 

 

 

 

 

Author

Checked

Approved

Petros Grivakos

Thanasis Sarigiannidis

Niko Tsakalakis

2023-Aug-15

2023-Aug-15

2023-Aug-15


 

 

 

Revision History

Iss. Rev.

Date

Author

Comments/Change log

1.0

2023-Aug-15

P. Grivakos

Initial release

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1.Introduction

 

1.1 How to Read this Guide

 

This guide will offer instructions for tuning the Torque, Speed, and Position modes on RoboG4 products. In addition to the fundamental closed-loop PID tuning, it will provide information about enabling additional features that can optimize motor control, such as Feedforward and Adaptive control. The main focus of this guide is load tuning for the system, assuming that the Open Loop mode has already been configured and evaluated by the user without a load. If you have not yet completed these initial configurations, please refer to the Roboteq Controller’s User Manual or follow the step-by-step instructions provided in the respective Quick start-up guides to configure and test the Open Loop and Closed Loop Speed modes.

 

Warning

Prior to proceeding with the Closed Loop load tuning, ensure that the controller has been properly configured and tested in Open Loop mode without any load. Ensure that all used sensors report a positive speed when a positive motor command is given. Failure to configure the Open Loop correctly may result in uncontrolled motor movement. Exercise caution and follow the necessary setup procedures to prevent any potential hazards. 

 

 

Figure 1-1. Tuning Guide Reading Sequence

 

Open Loop and preferably Closed Loop Speed should have been tested without a load. During the Open Loop configuration, the FOC PI gains should have already been set and evaluated. However, this will also be a part of this guide during Torque Tuning. The user must start following all the chapters of this guide until they reach the operating mode they intend to use.


1.2 Motor Control Modes

 

Roboteq controller utilizes a variety of advanced control algorithms to effectively drive the motors even in the most demanding applications. Apart from the traditional PID loop, there are additional Feedforward loops and an Adaptive controller that work in parallel with the Closed Loop control to produce the optimal behaviour. The three supported Closed Loop modes, Position, Speed and Torque work cascaded to drive the motor to the desired set point. 

Figure 1-2. Control modes diagram

According to the cascaded control operation, Position mode utilizes the Speed mode, that sequentially utilizes the Torque mode to supply the PWM voltage to the motor. Tuning the internal control modes becomes necessary when an external control mode is employed. Torque tuning is mandatory in all cases, and the Speed loop must be configured when either Speed or Position mode is utilized. Position mode should only be set if the intended control mode is the Position mode.

Figure 1-3. Control modes simplified diagram

Table 1-1. Cascaded control modes tuning requirements

Mode to Use

Tune Requirements 

Torque 

Speed

Position

Torque


 

 

Speed



 

Position





1.3 Watchdog Timer 

 

A useful tool for PID tuning is the watchdog timer. By leveraging this feature, motor movement can be limited, as the motor command becomes idle after the watchdog timer time has expired. In the example below, the motors will automatically stop when no motor command is received for 1 second.

 

The watchdog timer will reset every time a new motor command is given, so it is essential to send the motor command only once.

 

Warning

The motor command must be sent only once by using a command box. If the Roborun+ slidebar is used instead, the watchdog timer will never expire, since the slidebar sends the motor command periodically.

 

Important Note:

When the watchdog timer expires, the motors will decelerate with the configured “Fault deceleration” parameter. Make sure that the parameter has the desired value. 

 

Figure 1-4. Indicative value for Fault Deceleration parameter

 

1.4 Sending Serial Commands

 

A serial command can be sent by using any of the command boxes of Roborun+ Utility and pressing the sent button:

 

A motor command in Speed Mode can be sent as follows:

!S cc nn

where cc is the channel and nn is the desired speed in RPM.

For example, the following command will give a set point of 300 RPM in channel 1:

!S 1 300

There is also the option to send a simultaneous motor command in both channels by combining the two commands with an underscore.

For example, the following command will give a desired speed of 500 RPM in both channels:

!S 1 500_!S 2 500

As mentioned, if a newer command is not received for the configured watchdog timer time, then both motors will stop after the defined time.

In Count Position mode, the desired position can be given with the P command. The syntax is as follows: 

!P cc nn

where cc is the channel and nn is the desired position, expressed in sensor counts. Again, here both channels can be commanded by using an underscore.

For example, the following command will move both motors in the 4096 position:

!P 1 4096_!P 2 4096

During the Count Position tuning, it might be required to reset the feedback counter or load it with a specific value. This can be done any time when the motor is not moving by using the following commands:

  • Quadrature encoders: !C cc nn  
  • SSI or SPI sensors: !CSS cc nn
  • Hall, Sin/Cos or Resolver sensors: !CB cc nn

Where cc is the channel and nn is the counter value. 

For example, the following command will load the SSI counter of both channel with the value of 0:

!CSS 1 0_!Css 2 0

Additionally, the Speed, Acceleration and Deceleration parameters can be sent on runtime with the !S and !AC and !DC commands. In the following example, the motor of channel 1 will be commanded to go to 1000 position, with 101 RPM speed, 101RPM/s acceleration and 102 RPM/s deceleration: 

!P 1 100_!S 1 100_!AC 1 101_DC 1 102

Warning

Do not modify the counter value while the motor rotates, as this can create an abrupt motor movement.

 

1.5 Tuning Setup

 

In this tuning example, we will use a conveyor equipped with two BLDC motors to transport a crate. Both motors will be driven concurrently, receiving the same motor command from a dual-channel BLDC controller. The payload in this instance weighs approximately 30 kg.

Figure 1-5. Example tuning setup 

 

1.6 Tuning Steps

 

Due to the operation of cascaded control modes, all the steps in between must be followed before reaching the final target of tuning the Position mode. Closed Loop PI gains must be set and evaluated for Torque, Position, and Speed modes in sequence. Torque mode is independent of the load, but no load should be applied if the Motor Characterization tool is used to estimate the motor parameters. Speed and Position modes must be tested with a load.

 

Tuning Steps:

  1. Tune and evaluate Torque mode: No load should be added if the Motor Characterization tool is used to estimate the motor parameters.
  2. Tune and evaluate Closed Loop Speed with load.
  3. Tune and evaluate Closed Loop Position with load.

 

 

2. Tuning Example

 

2.1 Torque PI Tuning

 

As mentioned, the Torque loop (also known as the Current or FOC loop) is the initial step in configuring the system and must be tuned in all cases. To tune the Torque Loop, it is essential to have the motor resistance and inductance parameters. These parameters can be obtained from the motor datasheet. In case the motor datasheet omits them, they can be estimated using the Roboteq controller’s Motor Characterization tool.

Below, the steps for Torque tuning are visualized:

 

 

2.1.1 Setting the motor parameters by referring to the motor datasheet

 

The motor datasheet typically includes both motor resistance and inductance parameters. These parameters are measured between two motor phases and are referred to as phase-to-phase (p-p) values. The datasheet might present the phase measurements, which are the phase-to-phase values divided by two. The Roboteq controller requires the phase values to be set, so it must be clear from the datasheet to which measurements they are referring. In case there are any doubts, please contact the motor manufacturer.

 

 

Important note

Make sure that you use the motor phase values when configuring the motor parameters in the controller.

 

In the setup used, the motor Phase to phase values are the following:

 

 

As they are phase-to-phase (p-p) values, we will divide them by two and use them as the motor parameters. Please ensure to pay attention to the units. The units for resistance are Ohms, and for inductance, they are milli-Henry (mH). In the case of SPM motors, where only one inductance value is given, this value should be used for both Q-axis and D-axis parameters.

 

Actions List

  • Get the motor Resistance and Inductance from the datasheet.
  • If they values are ph-ph, divide them by two.
  • Configure the Motor Parameters in the Roborun+ utility.
  • In case of SPM motors, use the inductance value for both D and Q axis parameter.
  • Pay attention to transform the units in Ohms and Milli-Henry

 

2.1.2 Setting the motor parameters by using the Motor Characterization tool

 

The motor characterization tool can be found in the Motor/setup wizard: 

 

In the wizard, Select the Current Loop Auto Tuning option: 

 

 

 

Then the motor characterization process will commence. During this process, the controller will supply alternating voltage to the motor and estimate its parameters. Please ensure that the motor is free to rotate, as various rotor positions will be measured.

 

 

Important note

Make sure that the rotor is free to rotate during the Motor Characterization process.

 

After the wizard finishes, it will save the calculated parameters in the controller’s flash memory. Make sure that the parameters have been modified by loading from the controller: 

 

 

Actions List

  • Ensure the rotor is free to rotate.
  • Run the Motor Characterization wizard.
  • Close the wizard after the Motor Characterization finishes and ensure that the Motor parameters have been modified by loading from the controller.
  • Or continue to the next step where the FOC bandwidth is set and tested.

 

 

2.1.3 Setting the FOC Bandwidth and Evaluating the Current Response

 

The motor current response can be plotted using the motor/sensor tuning wizard. If the motor parameters are obtained from the motor datasheet (and thus motor characterization is not needed), you can use the manual entry option.

 

 

The slider can be utilized to choose the Current Loop Bandwidth. A higher bandwidth leads to a quicker current response. However, while a higher current response makes the motor more responsive to current demands, increased bandwidths also have the tendency to induce motor vibrations. While 50 Hz was a common value for F3 products (previous generation), G4 products (e.g. FBLG2360T) can comfortably operate at 500 Hz.

 

 

After selecting a bandwidth, you can plot the current response in the chart by clicking “run waveform”. At this step, the motor is tested in torque mode without any load.

Figure 2-1. 300 Hz Bandwidth Current Response

Important note

Using higher FOC bandwidth can induce motor vibrations.

 

 

Actions List

  • Try different bandwidth values and observe the current response. You can use a small time period for the step function to avoid motor movement.
  • Quadrature amps must follow the step command in a fast and stable way.
  • Flux amps must stay close to zero.
  • Be aware that increasing the FOC bandwidth can create motor vibrations.

 

2.1.4 Decoupling Control

 

Decoupling current control is a feedforward loop that improves the current response of the motor.

 

 

Figure 2-2. Decoupling control Block Diagram

 

Decoupling control will be automatically enabled if the voltage constant (ke) parameter is set along with the motor resistance and inductance specs. The voltage constant must be measured between two motor phases and expressed in RMS. The units should be V/kRPM.

 

 

The effects of decoupling control will become more evident in the motor's speed response, particularly during deceleration or during high load transients.

 

 

Figure 2-3. Current Response with and without Decoupling Control

 

 

Figure 2-4. Speed Response with and without Decoupling Control

 

Actions List

  • Configure the voltage constant of the motor together with the motor Resistance and Inductance parameters.

 

2.1.5 Evaluating the FOC Response in Open Loop

 

Another practical way to determine if the current response is adequate is to run the motor in Open Loop, without load, and ensure the following:

 

  • Provide full power in both directions (1000 and -1000 motor command) and ensure that the motor speed is symmetrical in both directions. If the FOC gains are not set properly, then the motor might not be able to reach the same speed in forward and reverse directions.
  • Ensure that the FOC flux amps stay close to zero. Flux current might increase when the motor speed changes but it should stabilize back to 0 after a short time.
  • Ensure that motor amps are below or equal to the motor’s no-load current.

 

Figure 2-5. Run Tab Chart


Actions List

  • Change Operating Mode in Open Loop.
  • Ensure that the motor has symmetrical Speed and current.
  • Ensure that the FOC Torque Amps is close to the Motor Amps and below or equal to the motor’s no-load current.
  • Ensure that the FOC Flux amps are stable and close to zero.

 

2.1.6 Testing Torque Mode

 

To test Torque Mode, change the Operating Mode accordingly:

 

 

Then add load to the motor and give a command from the slider. For the Torque mode Operation, consider the following: 

  • If there is not enough load in the motor and the current request cannot be reached, the speed of the motor will be increase to the maximum.
  • In Torque more, the motor speed will be limited to the Maximum configured Speed value. This regulation will happen by using the Speed PID gains. To have Speed limiting, the Speed PID gains must be set and thus the next chapter for the Speed PID tuning must be read.

 

 

  • The given command from the slider is a !G command. The !G command will request a percentage of motor current between 0 and Amps limit value. For example a !G command of 500 with an amps limit value of 50 A, will request the 50% of 50 amps, that is 25 A.

  • To request an absolute current value, the !GIQ command must be sent. The !GIQ command is a Torque Amps request. Please note, that Torque amps are expressed in Peak value and not rms. Thus, the measured motor Amps will be equal to Torque amps*0.707.

 

Actions List

  • Change Operating Mode in Torque Mode.
  • Add load to the motor and give a motor command.
  • Take all the considerations about the motor commands and Speed limiting.

 

 

2.1.7 Conveyor Application FOC Bandwidth

 

In this conveyor example, we will use a relatively slow Bandwidth of 50 Hz. This was chosen to avoid high frequency oscillations which were introduced by the elasticity of the conveyor belts.

Figure 2-6. 50 Hz Bandwidth Current Response

 

 

 

This requirement first arose during the Speed PID tuning of the conveyor. As mentioned, a high FOC bandwidth can introduce current vibrations that may impact operating modes dependent on current control. Opting for a lower bandwidth can result in a slower system response, but greater stability. However, the appropriate utilization of the decoupling control could compensate the lower FOC bandwidth. It's important to note that adjusting the PI FOC gains will affect the response of a system previously tuned with different FOC gains.

 

Important note

Altering the FOC Bandwidth during the tuning of Speed or Position modes will alter the overall system behavior. It's possible that Speed or Position gains may need to be readjusted following changes to the FOC PI gains.

 


2.2 Speed PID Tuning

 

2.2.1 Speed PID Operation

 

The Speed Loop operates by utilizing the Torque Loop, so the FOC Torque and Flux gains must be already set and accessed as mentioned in the previous chapter. Please note that in integrated drive solutions, the FOC gains can be set though the Torque Loop parameter, in contrast to non-integrated solutions where the FOC gains can be set through the dedicated FOC parameters field.

 

 

Figure 2-1. Indicative values for FOC gains


Important Note

The FOC Torque and Flux gains must be set and validated before proceeding with the Closed Loop Speed tuning.

 

The PID block diagram is the following:

 

Figure 2-7. Speed PID function Block Diagram

 

 

The PID formula in the cascaded control modes operation is the below: 

Current Command = error*P + Sum(error)*Ts*I + (error- previous_error)*1/Ts*D

where Ts is the sampling rate of the control Loop and is equal to 0.001 sec.

The PID formula has 3 terms that work in parallel and are responsible for the amount of power supplied to the motor. The P term is directly proportional to the speed Loop Error. The higher the Loop Error is, the more power will be provided to the motor, to minimize that error. As the motor starts rotating, the Loop error will gradually decrease, and the motor power will reduce accordingly.

The I term is proportional to the sum of the Loop Error. The integral of the loop error will gradually develop over time causing the motor power to increase. The increase of the motor power will finally minimize the loop error allowing the motor to reach the desired speed.

The D term is proportional to the rate of change of the error. The more rapidly the loop error is changing, the higher the power provided to the motor to correct the speed deviation.

 

Important Note

Closed Loop is very sensitive in the D gain, so very small values should be used.

 

2.2.2 Speed PID Tuning Steps

 

In this example we will use the following speed profile settings: 

 

We will test the motors by sending a Speed command of 500 RPM for 1 sec:

 

 

 

 

The steps we will follow for the tuning are below: 


  1. Give some small initial values on P and I gain:

 

2. Adjust the P and I gains to have a smooth feedback curve resembling the one in the image below. This curve exhibits the characteristics of a first-order system and will result in stable behavior. At this stage, a fast response is not necessary; focus on creating a smooth feedback curve.



Figure 2-8. First Order System Step Response

 

To achieve that, we increase the P gain to make the response faster and we increase the I gain to remove the steady state error:

 

 

 

  • P = 0.06 and I = 0.05 seem to give the desired results.

 

3. Multiply P and I gains by the same factor to increase the Closed Loop Speed Bandwidth

 

 

 

 

 

4. Decrease the Low Pass Filter Bandwidth

We observe that increasing the PI beyond a certain value introduces high-frequency oscillations:

 

Decreasing the Filter bandwidth can help reducing these oscillations. Please note that decreasing the filter bandwidth a lot, will create lag and eventually make the system unstable:

 

 

At this point the PID response looks satisfying. There is still a lag during the transient state, which we will try to reduce in the next steps by utilizing the Acceleration Feedforward control

 

Actions List

  • Configure the watchdog timer and motor Fault Deceleration.
  • Add load to the motor and give a motor command through console.
  • Try to make a response that resembles the first order system step response by adjusting the P and I gains.
  • In general, you can increase the P gain to make the system fast and increase the I gain to remove the steady state error
  • Once there no steady state error and the response is stable, multiply both P and I gains by the same factor to increase the Speed PID Bandwidth
  • Utilize the Closed Loop Speed PID filter if the motor has vibrations. Be aware that as the cut-off frequency decreases, a phase delay will be introduced in the system’s response.

 

2.2.3 Wrong Gains Examples

 

The below PID settings make the system overshoot since the integral gain is dominant:



Increasing the PI Bandwidth will not create the desired results, as the overshoot will be maintained as the system response gets faster. 

 

In the below example the system is undershooting because of lack of Integral gain:

 

 

Increasing both PI gains does not help, as a steady state error is being maintained:

 

While overshoot might be a desired behavior in some applications because it helps reach the set point faster, in this conveyor application, our primary objective is to closely follow the motion profile with as this will eventually determine the final position of the crate on the conveyor.

 

2.3 Acceleration Feedforward control

 

2.3.1 Acceleration Feedforward Operation

 

Acceleration Feedforward is a feedforward algorithm that operates when the motor accelerates and decelerates. It takes the speed command as input, calculates the rate of change (acceleration), and then multiplies it by the system's inertia coefficient. This allows the algorithm to provide an additional amount of power during acceleration/deceleration to compensate for the load inertia. Additionally, there is a gain that continuously works to compensate for friction losses and is equal to the Speed command multiplied by the friction coefficient. 

Figure 2-9. Feedforward Block Diagram

 

The Acceleration Feedforward control is set when configuring both the inertia and Rotating friction coefficients in the Mechanical system characteristics session.

 

 

Inertia and friction coefficients are typically calculated by the Auto Tuning Wizard. In complex mechanical systems though, where there is not only Inertia and Rotating Friction terms, the estimation might not be 100% accurate, and the gains might need to be fine-tuned. In this example, the gains will be set manually, by observing the system’s speed response.

 

2.3.2 Setting the Acceleration Feedforward parameters (Experimental method)

 

Follow the next steps to enable the feedforward control:

  1. Set both coefficients to 1

Here we will focus mostly on the inertia compensation, but both coefficients must have values different than 0 for the feedforward to be enabled.

    2. Increase inertia coefficient up to the point that the transient response is improved.

 

In the setting below, the inertia coefficient has been increased to 100. It is evident how the motor speed and power drop when the acceleration stops taking place and the acceleration feedforward is deactivated:

 

3. Adjust the Rotating friction coefficient.

Increasing the Rotating Friction coefficient minimizes the speed drop at the steady state but results in a constant positive error:

 

4. Adjust both parameters.

By experimenting with both coefficients, the best possible results can be achieved:

 

 

5. Adjust again the Speed PI gains.

By reducing the Speed filter Bandwidth and doubling the Speed PI gains, the response can be further improved:

 

 

 

 

Actions List

  • Start by configuring both J and B parameters with the value of 1.
  • Increase J parameter up to the point that the transient response is adequate.
  • Modify both parameters to have an even response during the motion profile 
  • Modify the Speed PI gains and Low Pass Filter Cut-off frequency if necessary 

 

2.3.3 Estimating the System Inertia and Rotation Friction Coefficients (From Speed Response)

 

The system's inertia and rotating friction coefficients can be estimated by measuring the motor current during the closed-loop speed response. To calculate the system specifications accurately, the motors must be tuned and capable of adequately following the ramp command. This allows us to estimate the system specifications based on the motor current during the transient and steady-state regions. It is essential for the motor to accurately follow the ramped command, as this enables us to consider the motor's acceleration and speed as known parameters.


Calculating the Rotating Friction Coefficient

The rotating friction coefficient can be calculated by measuring the motor current during the steady-state region of the motor's movement. 

In the figure below, we can observe that at 500 RPM, the motor current is approximately 4 A.

At that point, we can consider that the effect of inertia on the system is minimal, and the only force at play is friction. In this scenario, the motor's torque becomes equivalent to its rotating friction multiplied by the angular frequency. Mathematically, this relationship is represented as:

T = B*w

By utilizing the motor's torque constant (Kt), we can substitute Torque with Kt * I (current):

Kt*I = B*w

Next, we convert the angular speed to RPM:

Kt*I = B*2*pi*RPM/60

Solving for B, we arrive at the following formula:

B= Kt*I*60/(2*pi*RPM)

For the integrated drive used, the torque constant is 0.11 Nm/A, and the tested speed is 500 RPM:

B = 0.11*4*60/(2*3.141*500) = 0.0084 Nm(Rad/s) = 8.4 mNm/(Rad/s)

 

Calculating the Inertia Coefficient

The inertia coefficient, on the other hand, affects the system during the mechanical transients of the motor. When the motor accelerates, the applied torque becomes a sum of the motor acceleration multiplied by the inertia coefficient, and the motor speed multiplied by the rotating friction coefficient. This relationship can be expressed as

T = B*w + J* dw/dt

We can see that during the transients, the motor current is around 22.5 A

 

For the Rotating friction term, we can calculate the average speed of the motor and multiply it by the Rotating Friction coefficient:

B*w = (B*2*pi/60)*(RPMmax – RPMmin)/2 = (0.0084*2*3.141/60)*(500 – 0)/2 

= 0.22

The acceleration can be determined from the controller’s configuration. After transforming rad/s^2 to RPM/s the formula becomes as follows: 

T = 0.22 + J * 2000*2*pi/60 = 0.22+J*209.4

Substituting T with Kt* I gives: 

0.11*22.5 = 0.22 + J*209.4

Then solving for J we find:

J = (2.475 – 0.22)/209.4 = 0.0108 kg*m^2 = 108 kg*cm^2

The mechanical system parameters, according to the estimation method, can be set as follows: 


Actions List

  • When the motor is tuned and can follow the given command in an adequate way, log and plot the motor current and speed during the motor’s movement.
  • Follow the previous steps to calculate the J and B coefficients.
  • Pay attention to the units and perform the correct transformation (to mNm/(Rad/s) and kg*cm^2) before saving to the controller.

 

2.4 Adaptive Control


The waveforms that we have examined so far were from the first channel, which controls half of the conveyor. This section of the conveyor moves the load during acceleration. Conversely, when the load decelerates, the second half of the conveyor carries the load without the help of the first motor.

Figure 2-5. Load Position During Acceleration and Deceleration

 

Although the speed response of both motors during acceleration was satisfying, motor 2 exhibited an unwanted behavior during deceleration, likely caused by the elasticity of the conveyor belts. We will attempt to minimize this overshoot by implementing adaptive control.

 

 

 

2.4.1 Torque Feedforward

 

Torque feedforward is considered a part of the adaptive control, as it utilizes the adaptive control structure but does not rely on the observer algorithms that typically modify the tuning parameters during motor operation. The torque loop takes as input the current command derived from the Closed Loop Speed and the theoretical current calculated from the mechanical system parameters (J and B). The torque feedforward part is calculated by subtracting the current command from the theoretical current and multiplying it by the Torque Feedforward gain. This additional current is then added to the current demand of the Torque Loop, effectively compensating for theoretical model uncertainty.

Figure 2-6. Torque Feedforward Block Diagram

 

2.4.2 Torque Feedforward Tuning

 

The Torque feedforward feature requires configuring the mechanical system parameters (J and B) and the Torque Feedforward gain. The J and B parameters have already been configured experimentally, so only the Torque Feedforward gain needs to be adjusted at this step. Below are different gain values and the corresponding Speed response of motor 2. Please note that Adaptive and Speed controller Bandwidths are not used in the Torque FF configuration.

 



The Torque Feedforward tuning does not seem to help in this application, as it does not dampen the oscillations; instead, increasing it creates vibrations.

 

Actions List

  • Set the Adaptive Mode to “Torque FF Factor”.
  • Adjust the Additional FF gain, until having the desired results.

 

2.4.3 Inertia observer

 

The inertia observer algorithm works by estimating the inertia of the system and comparing it with the system's response. If the estimated inertia differs from the actual value, the adaptive controller will adjust the Speed Proportional gain and inertia parameter (J) to compensate for the difference. These modifications of the P and J parameters will impact the Speed PI and Feedforward Loops that utilize them. It's important to note that the adjustment of the parameters will only occur during the acceleration/deceleration of the motor, where inertia plays an active role.

2.4.4 Inertia observer tuning

 

The inertia Observer uses the Torque constant for its calculations, so the parameter must have already been set.  The parameter value can be obtained from the motor datasheet.

Please note that this value is hardcoded in the integrated drives. 

The following 2 parameters must be set for the inertia observer: 

  • Adaptive controller bandwidth. This is the Bandwidth of the adaptive controller and must be set at least two times higher than the Bandwidth of the Speed Loop Bandwidth
  • Speed controller Bandwidth. This will be used for the calculation of the Speed P gain. If the Autotuning tool has been used, then the Speed PI gains will be calculated based on this bandwidth, so the value will be pre-set. If the Speed PI gains have been set experimentally, then the bandwidth must be approximated. Different values between 0.5 to 20 Hz can be tested. 

To tune the Inertia Observer, follow the next steps: 

  1. Give a Speed bandwidth value and an adaptive controller higher value:

 

 

    2. Increase the speed and adaptive Bandwidth until the response is fast and stable.

 

 

By looking at the chart, we see that the Inertia observer is not useful in that case, as it only acts during the acceleration/deceleration of the motor, where the system, is already well-tuned. 


Actions List

  • Ensure that the Torque Constant is set, as it is used by the Inertia Observer.
  • Adjust the Adaptive and Speed controller Bandwidths.
  • Ensure that the Adaptive controller Bandwidth is at least two times higher that that of the Speed controller. 

 

2.4.5 Disturbance Input Decoupling (DID)

 

The DID control utilizes the Load Torque Observer to detect differences between the theoretical and actual model. The Torque difference is then feedforwarded to the current Loop through the TL parameter, as shown in Figure 2-7. This continuous adjustment of the TL parameter helps to compensate for unpredicted variations in the system’s load torque. This feature is ideal for reacting to disturbances that may occur during the steady-state region.

 

 

Figure 2-7. Did control.

 

2.4.6 Disturbance Input Decoupling Tuning

 

Since the only parameter that is being modified in this mode is the Load inertia, the Speed Loop bandwidth does not need to be set. Experiment with the Adaptive Controller Bandwidth to achieve the optimal response. Increasing the Bandwidth will result in faster correction, but it may lead to vibrations. Select a Bandwidth that reduces disturbances without compromising the system's stability significantly.

 

 

 

 

A bandwidth of 35 Hz seems to yield the desired results as it dampens the oscillations when the motor stops, providing adequate torque to fulfill the elasticity effect of the belt. The trade-off is the presence of some high-frequency oscillations when the motor is in the steady-state region. 


Actions List

  • Select the DID mode in the Adaptive controller.
  • Try various values of Adaptive controller BW.


2.5 Position Tuning

 

Position mode is the outer loop of the cascaded control operation. The Closed Loop position error drives the speed loop, which in turn drives the torque loop to provide the desired current to the motor. The PID tuning of the Position Loop can be an easy task if the Speed and Torque modes are properly tuned.

Important Note

Position mode requires the Speed Loop and Torque Loop to be tuned. The FOC and Speed PI gains must be properly set for the position mode to be able to work.

 

1.5.1 Position PID tuning

 

We will keep the same acceleration profile for the position mode. The Position Velocity will be 300 RPM.

The steps for the Position mode tuning are following: 

  1. Begin by adding a small value to the Position proportional gain. Monitor the motor's response by plotting the Track command and Feedback variables. As these variables can reach high values, it may not be convenient to monitor the system's response directly from the Roborun+ Run tab. Saving the logs and using a data visualization tool may be necessary for the Position mode tuning. In this example, we will plot the Loop Error variable on the run tab, as it gives a good idea about the system response.

 

 

The Position P gain can be calculated theoretically by utilizing the following formula: 

P = 2*pi*BW*60/Sensor Resolution

Various values of bandwidth can be tested, starting with 1. The sensor resolution depending on the sensor used derives as follows: 

 

  • Encoder: 4*PPR
  • SSI: Corresponds to the number of bits. E.g., 12 bits have 4096, 14 bits 65536 etc.
  • Hall sensor: Number of Pole pairs * 6
  • Sin/Cos – Resolvers: 16384

 

Example: P gain for 1 Hz, with a sensor with 16,384 resolution, will be 2*3.141*1*60/16384 = 0.023

 

2. Increase the Proportional gain up to the point the system’s response is fast enough and there are no         vibrations.

 

 

Important Note

Resetting the Max Loop Error value can help to determine system responsiveness during testing.

 

 

 

We will keep the value of 0.3, as it produces fewer oscillations, and we will attempt to enhance the system's response by implementing Velocity Feedforward Control.

 

 

Actions List

  • Calculate the theoretical values of the Proportional gain, depending on the sensor used .
  • Modify the Position Bandwidth and evaluate the response.
  • Monitor the motor’s loop error or record and plot the Track and Feedback commands
  • Increase the P gain up to the point the it will start introducing vibrations.

 

 

2.5.2 Velocity Feedforward Control

 

Velocity Feedforward control is an additional feedforward loop taking part in Position mode. In contrast to the Acceleration Feedforward control that acts in Speed Loop only during the acceleration of the motor, the Velocity Feedforward control acts every time there is a change in the trajectory and thus a motor movement. 

2.5.3 Velocity Feedforward tuning

 

The Velocity Feedforward control can be enabled by adding a non-zero value to the Velocity Feedforward gain:

 

 

 

 

 


The negative Loop Error denotes an overshoot, so the Velocity Feedforward gain value that we will keep is 1.



If we plot the Track and Feedback values, we will see that the Position Response Look as follows: 

 

Note

During the Position PID tuning the Adaptive features were disabled, but one can enable them and test their impact in Position tuning as they will work in the cascaded control operation as a part of the Speed Control.

 

Actions List

  • Enable the Velocity FF by adding a non-zero value to the Velocity FF gain. 
  • Increase the gain until the Loop Error is minimal.
  • Increasing FF gain a lot will create a lead of the feedback during the transient response.

 

 

2.6 Tuning Limitations and Considerations

 

It is not always granted that the motor can reach the desired speed or torque and there are limitations introduced either from the components of the system (DC bus voltage, motor or controller max values) or from the controller’s configuration (current limits, trajectory). Below there are some concepts that play a significant role in the tuning of the system.

 

2.6.1 Voltage limitations

 

The controller will adjust the PWM voltage to drive the motor to the desired set point. If the PWM voltage has reached 100%, and yet the motor cannot attain the desired torque, speed, or acceleration, then the system has reached its limits. The application requirements should be adjusted to match the actual performance that the motor can achieve.

The motor PWM voltage can be monitored through the Motor Power parameter, that takes values between 0 and 1000 (100% PWM voltage).

 

2.6.2 Current limitations

 

The maximum allowed motor current can be set through the Amps Limits parameter. The controller will not allow the motor current to exceed this value:

 

 

Similar to the voltage limitation scenario, the motor won't be able to accelerate faster if there isn't enough current available to support it.

 

2.6.3 Ramped and Track Command 

 

The input to the Speed and Position PID loops is the error that arises when subtracting the feedback from the motor trajectory. When employing traditional PID control, the motor will not exceed the trajectory. When monitoring motor performance, it's advisable to examine the Ramped or Track command instead of the motor command, as this disregards the configured acceleration profile.

 

It is always considered good practice to have a ramped command that the system can actually follow, in order to achieve more precise motor control.

2.6.4 Motor Current Slew Rate 

 

The Current Loop is the final loop used in the cascaded control operation. The output of the Speed Loop becomes a current demand for the Current Loop (including also the acceleration feedforward and adaptive controller output current command parameters). This requested current will also follow a trajectory, which is determined by the Slew Rate Parameters.

The Slew Rate can be set with the ^ISLR command as follows:

^ISLR cc nn

Where cc is the channel and nn is the current slew rate at x10 A/sec. The default value 100 , that is 1000 A/sec = 1A/msec.

Min=0 (disabled slew rate) Max=65000 (650 A/msec)