.

PID with Reset

Overview

Overview

This block computes a Proportional, Integral, and Derivative (PID) filter transformation. The integration sum is limited (Imax) and the derivative may be filtered (Ksm).

pid

The coefficients for this block are as follows:

Kp

Proportional gain.

Kp output = input * Kp

Ki

Integral gain.

Ki output = Σ(input) * Ki, not to exceed IMax

Kd Derivative gain. Kd output = (position error (current) - position error (sample - (DRate + 1))) * Kd IMax - Maximum integral output. The integral portion of the PID algorithm will not exceed IMax. Units are in control output counts (+/- 32767)
Ksm

Smoothing parameter.

0 = no smoothing
1 = infinite smoothing

Imax Limit value for the integration sum.
Ts Sample period of the PID algorithm. This is the cycle time of the PID algorithm in Simulink simulation. This value has no effect on the PID execution on the controller.
Subsample Code A code which determines the schedule for updating this block (every sample, even samples only, etc.). See Subsampling.

Matlab/Simulink

Simulink Interface

piv_reset_sim1

The Position Error input should connect to a position error block or equivalent (for example the output of a sum block). 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 will be set to the Reset Value.

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

PID_RBlock

Declaration

Public Method

PID_RBlock&   PID_R();
Required Header: mechaware.h

Description

This is a standard PID algorithm as used on the ZMP-SynqNet controller.

double PID_R().Kp

Proportional gain.

Kp output = input * Kp

double PID_R().Ki

Integral gain.

Ki output = Σ(input) * Ki, not to exceed IMax

double PID_R().Kd

Derivative gain.

Kd output = (position error (current) - position error (sample - 1)) * Kd smoothed (See Ksm below).

double PID_R().IMax Limit for the maximum value of the integration sum.
double PID_R().Ksm

Smoothing parameter.

0 = no smoothing
1 = infinite smoothing

Methods

Block Methods

Remarks

The Reset and Reset Value inputs should be left disconnected if the integrator does not need to be reset.

See Also

PID with Reset

 

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