# RunTimePID

This block implements a tunable PID. During the simulation, the coefficients of the PID can be manually tuned.

The current value of the gain is equal to the Value multiplied by the Factor

## Library

Dynamical

## Description

The RunTimePID block implements a PID controller. The PID controller calculation (algorithm) involves three separate parameters: Proportional, Integral and Derivative. The Proportional value determines the reaction to the current error, the Integral value determines the reaction based on the sum of recent errors, and the Derivative value determines the reaction to the rate at which the error has been changing. The weighted sum of these three actions is used to adjust the process via a control element such as the position of a control valve or the power supply of a heating element. The value of the parameters can be tuned during the simulation.

The left end of slider represents the Min value.

The right end of slider represents the Max value.

The number of ticks is (Max-Min)/Step.

The slider corresponds to a nominal value based on its position with regard to ticks.

The real PID parameter is calculated by Value*Factor.

## Parameters

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| Value | Int value. The current value of the slider. | Scalar | |

| Min | Int value. The minimum value of the slider. | Scalar | |

| Max | Int value. The maximum value of the slider. | Scalar | |

| Step | Int value. The step taken by the slider. | Scalar | |

| Factor | Real Value. the factor used to convert the slider value to the gain value. | Scalar |

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| Value | Int value. The current value of the slider. | Scalar | |

| Min | Int value. The minimum value of the slider. | Scalar | |

| Max | Int value. The maximum value of the slider. | Scalar | |

| Step | Int value. The step taken by the slider. | Scalar | |

| Factor | Real Value. the factor used to convert the slider value to the gain value. | Scalar |

Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|

| Value | Int value. The current value of the slider. | Scalar | |

| Min | Int value. The minimum value of the slider. | Scalar | |

| Max | Int value. The maximum value of the slider. | Scalar | |

| Step | Int value. The step taken by the slider. | Scalar | |

| Factor | Real Value. the factor used to convert the slider value to the gain value. | Scalar | |

| Filter coefficient | Scalar |

## Ports

Name | Type | Description | IO Type | Number |
---|---|---|---|---|

| explicit | input | 1 | |

| explicit | output | 1 | |

| activation | input | 1 |

## Advanced Properties

Name | Value | Description |
---|---|---|

| yes | |

| yes | PID block is direct-feedthrough unless the proportional gain (Kp) is zero (0). |

| no | |

| no | |

| no | |

| no |