PD controller
A proportional/derivative controller where both the proportional and derivative actions are taken from input signals.
JCS Network Configuration
structure.yaml Configuration
type | proc_pd |
Signals - From Process
Signal name | Type | Required | Description |
---|---|---|---|
u | float32 | required | Controller output Signal name can be renamed by the user |
Signals - To Process
Signal name | Type | Required | Description |
---|---|---|---|
p_setpoint | float32 | required | Proportional term command input |
p_feedback | float32 | required | Proportional term feedback input |
d_setpoint | float32 | optional | Derivative term command input |
d_feedback | float32 | optional | Derivative term feedback input |
feedforward | float32 | optional | Feed forward input |
kp | float32 | optional | Proportional term gain If not connected, then must be set by parameter proc_pd_kp |
kd | float32 | optional | Derivative term gain If not connected, then must be set by parameter proc_pd_kd |
output_limit | float32 | optional | Output and integrator limit Defines both output limit high and low |
Note: The PD controller breaks out the gains as optional signals. If they are not connected as signals the gains can be set via parameter.
Configuration Parameters
Parameter name | Type | Required | Description |
---|---|---|---|
proc_pd_kp |
float32 | optional | Proportional gain term Ignored if signal kp is connected |
proc_pd_kd |
float32 | optional | Derivative gain term Ignored if signal kd is connected |
proc_pd_kff |
float32 | optional | Feedforward gain term |
proc_pd_limit_out_h |
float32 | optional | Controller output limit - high (output_units) |
proc_pd_limit_out_l |
float32 | optional | Controller output limit - low (output_units) |
proc_pd_rate_limit_rising |
float32 | optional | Controller output rising rate limiter (output_units/s) |
proc_pd_rate_limit_falling |
float32 | optional | Controller output falling rate limiter (output_units/s) |
proc_pd_startup_rate_limit |
float32 | optional | Startup output limits rate limiter (output_units/s/s) |
proc_pd_p_is_rotational_error |
boolean | optional | True: wraps the computed proportional error term \(e[k]\) to the interval \([-\pi, \pi]\) Default value: false |
proc_pd_d_is_rotational_error |
boolean | optional | True: wraps the computed derivative error term \(e[k]\) to the interval \([-\pi, \pi]\) Default value: false |
Operation
The PD controller is implemented in parallel form as the following difference equations:
If the parameter option proc_pd_p_is_rotational_error
is set to false, then the proportional term is computed as:
If the parameter option proc_pd_p_is_rotational_error
is set to true, then the proportional term is computed as:
Here, \(r_{p}\) is the p_setpoint
signal and \(y_{p}\) is the p_feedback
signal.
If the parameter option proc_pd_d_is_rotational_error
is set to false, then the derivative term is computed as:
If the parameter option proc_pd_d_is_rotational_error
is set to true, then the derivative term is computed as:
Here, \(r_{d}\) is the d_setpoint
signal and \(y_{d}\) is the d_feedback
signal.
The final PD is computed with the added feedforward term \(k_{ff} * ff[k]\):
Limits configured in proc_pd_limit_out_h
and proc_pd_limit_out_l
are applied to the output:
Following the limits, a rate limit may be applied to the output by parameters proc_pd_rate_limit_rising
and proc_pd_rate_limit_falling
. If these parameters are set as \(0\) or left unconfigured the rate limiter is disabled.
Startup
During controller startup an aggressive rate limit may be applied via parameter proc_pd_startup_rate_limit
.
This parameter rate limits the controller limits, starting from \(0\) until the limits reach the value defined by parameters proc_pd_limit_out_h
and proc_pd_limit_out_l
or the value defined by signal output_limit
(whichever is configured).
Once the rate limited limits equal the pre-defined limits, the startup rate limiter is disabled.
The effect of this limiter is to provide a 'soft' startup, in case of any large controller error present as the system starts.
Set parameter proc_pd_startup_rate_limit
to \(0\), or leave unconfigured to disable the startup rate limiter.