.

PIV with Gain Table

Overview

Overview

The PIV with Gain Table block implements PIV control. There is an inner Velocity Loop and an outer Position Loop. Additionally, there is a PI compensator for both Velocity and Position Loop. All parameters are entered into gain tables. Velocity, Acceleration, and Friction Feed Forward are also supported.

There is a table for each parameter and each table has five elements. The gain index input determines which table element is used for each specific parameter.

The coefficients for this block are as follows:

Kpp

Position Proportion Gain.

Kip Position Integral Gain.
Kpv Velocity Proportional Gain.
Kpff Position Feed Forward to Torque Command.
Kvff Velocity Feed Forward to Velocity Command.
Kafff Acceleration Feed Forward to Torque Command.
Kfff Friction Feed Forward to Torque Command.
MovingImax Position Integral Limit when Trajectory
Generator Command Velocity ~=0.
RestImax Position Integral Limit wen Trajectory
Generator Command Velocity == 0.
Output Limit Absolute value of maximum allowed Torque Command.
Output Limit High Positive Limit of allowed Torque Command.
Output Limit Low Negative Limit of allowed Torque Command.
Offset Offset applied to Torque Command.
Kdv Not used.
Kiv Velocity Integral Gain.
Vintmax Velocity Integral Limit.
Ka0

Velocity Estimate Smoothing parameter.

0 = No smoothing.
1 = Infinite smoothing.
Ka1

FFT gain block Ka1 ~=0 Noise injected at Torque Command.

Ka1 = 0. No Noise Injection.
Ka2

FFT gain block Ka2~=0 Noise injected at Velocity Command

Ka2 = 0 No Noise Injection.
Pos Meas User
Buffer
User buffer number used for Position Loop measurement.
Vel Meas User
Buffer
User buffer number used Velocity Loop Measurement.
Ts Sample Period used for Simulink Simulation
SubSample A code which determines the schedule for updating this block (every sample, even samples only, etc.). See Subsampling.
User Date 0 User Data, Not Applicable for Simulink.


Matlab/Simulink

Simulink Interface

PIV_Gain_Table

The Position Error input should connect to a position error block or equivalent (for example, the output of a sum block). The Velocity Position input should be from an Actual Position block or equivalent

The Output is the torque command ready to connect to a motor output or equivalent. The Reset and Reset Value inputs control resetting of the Integrator sum internal to the block. When a non-zero value is detected at the Reset input the integrator sum is set to the Reset Value.

The Gain Index input determines which of the five gain tables elements are used by the servo algorithm. Valid values are 0 through 4.

IMPORTANT! The new Servo Gains are applied immediately when the Gain Index value is changed. The Position Integrator Reset input controls the resetting of the Integrator sum internal to the block. When a non-zero value is detected at the Reset input the integrator sum is set to zero.

The following block diagram shows the block internal structure

The block has two user data fields (User Data 0, User Data 1) to store application-specific data for convenient storage and retrieval. See User Data Storage for details.

The block's update schedule is determined by the Subsample Code (See Subsampling). The following Parameter Dialog Box can be opened by double-clicking on the block in a Simulink Model:

piv_reset_sim2

C++ API

PIV_GTBlock

Declaration

Public Method

PIV_GTBlock&   PIV_GT();
Required Header: mechaware.h

Description

This block represents the standard PIV algorithm as used on the ZMP-SynqNet controller including the Gain Tables and Feed Forward parameters. The only difference is the addition of the Ksm value for smoothing.

Each parameter must have a corresponding .txt file containing structure with five (5) coefficient values. Individual parameters can be modified using the API functions below.

int32_t PIV_GT().AxisNumber Axis number
double PIV_GT().PosErrorSum Summation of position integral error.
double PIV_GT().VelErrorSum Summation of velocity integral error.
double PIV_GT().Kpp[index] Sets gain value at specified index.

Position Proportion Gain.
double PIV_GT().Kip[index] Set integral gain value at index.

Position Integral Gain.

Ki output = Σ(input) * Ki, not to exceed IMax.
double PIV_GT().Kpv[index] Sets gain value at index value.

Velocity Proportional Gain.
double PIV_GT().Kpff[index] Sets gain value at index value.

Position Feed Forward to Torque Command.
double PIV_GT().Kvff[index] Sets gain value at specified index.

Velocity Feed Forward to Velocity Command.
double PIV_GT().Kafff[index] Sets gain value at specified index.

Acceleration Feed Forward to Torque Command.
double PIV_GT().Kfff[index] Sets gain value at specified index.

Friction Feed Forward to Torque Command.
double PIV_GT().MovingIMax Sets gain value at specified index.

Position Integral Limit when Trajectory Generator Command Velocity ~= 0.
double PIV_GT().RestIMax Sets gain value at specified index.

Position Integral Limit when Trajectory Generator Command Velocity == 0.
double PIV_GT().Kdv[index] Not used.
double PIV_GT().Ksm[index] Smoothing parameter.

0 = no smoothing
1 = infinite smoothing
double PIV_GT().OutputLimit[index] Control loop output limit.

The absolute value of the control output will never exceed this value. (DAC counts)
double PIV_GT().OutputLimitHigh[index] Control loop output positive limit

The control output will never exceed this value in the positive sense. The smaller (more negative) value contained between Output Limit and Output Limit High will take precedence. (DAC counts)
double PIV_GT().OutputLimitLow[index] Control loop output negative limit.

The control output will never exceed this value in the positive sense. The smaller (more negative) value contained between Output Limit and Output Limit High will take precedence. (DAC counts)
double PIV_GT().OutputOffset[index] Control loop offset.

Creates an offset to the control output. The Output Offset is not removed from the DAC in an abort condition. (DAC counts)
double PIV_GT().Kiv[index] Sets gain value at specified index.

Velocity Integral Gain.
double PIV_GT().VintMax[index] Sets gain value at specified index.

Velocity Integral Limit.
double PIV_GT().Ka0[index] Sets gain value at specified index.

FFT gain block Ka0 ~= 0. Noise injected at Velocity Command.
Ka0 = 0. No Noise Injection.
double PIV_GT().Ka1[index] Sets gain value at specified index

Velocity Estimate Smoothing parameter.
0 = No smoothing
1 = Infinite smoothing
double PIV_GT().Ka2[index] Sets gain value at specified index.

FFT gain block Ka2 ~= 0. Noise injected at Torque Command.
Ka2 = 0. No Noise Injection

Methods

Block Methods

Remarks

The PIV with Reset block is an alternate PIV loop without gain tables or feed forward terms.

.

See Also

PID with Gain Table

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2012 Motion Engineering