.

PID with Reset

Overview

Overview

Description

The PID with Reset block is a Proportional, Integral, and Derivative (PID) filter transformation. The integration sum is limited (Imax) and the derivative may be filtered (Ksm). The output is calculated as determined by the Evaluate Block.

The Reset inputs are used to reset the Integrator sum.

Example

Here the PID with Reset block is being used with a Post Filter. This block provides a simple interface to add PID parameters to your control loop.


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.
Evaluate Block

This block allows you to specify whether the block executes Every Sample, Every Other Sample (Odd or Even), or Every Fourth Sample (and specify the First, Second, Third, or Fourth) or background. This provides greater flexibility in controlling the execution of a model and to preserve performance for other areas of motion control.

User Defined Block Priority When selected, allows you to enter a Priority Code to modify Execution Ordering of this block. For more information, see Block Execution Order and User Defined Block Priority.
Priority For an explanation of how the Priority field is used by the MechaWare Model Downloader, see Block Execution Order and User Defined Block Priority.
User Data 0 Application-specific data. See User Data Storage.
User Data 1 Application-specific data. See User Data Storage.

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 Evaluate Block. 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

class PID_RBlock: public virtual Block
{
public:
	virtual void WriteIntegrator() const = 0;

	// User accessible coefficients
	double	Kp;                    
	double	Ki;                    
	double	Kd;                     
	double	IMax;
	double	Ksm;                 
	double	Sum;
	double  Delta;
};
Required Header: mechaware.h

Description

The PID with Reset block implements a standard PID algorithm as used on the ZMP-SynqNet controller.

double Kp

Proportional gain.

Kp output = input * Kp

double Ki

Integral gain.

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

double Kd

Derivative gain.

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

double IMax Limit for the maximum value of the integration sum.
double 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