|
| OnlineCompensatorDesign () |
| Default constructor.
|
|
virtual bool | configure (yarp::dev::PolyDriver &driver, const yarp::os::Property &options) |
| Configure the design.
|
|
virtual bool | isConfigured () const |
| Check the configuration status.
|
|
virtual bool | tuneController (const yarp::os::Property &options, yarp::os::Property &results) |
| Tune the controller once given the plant characteristics.
|
|
virtual bool | startPlantEstimation (const yarp::os::Property &options) |
| Start off the plant estimation procedure.
|
|
virtual bool | startPlantValidation (const yarp::os::Property &options) |
| Start off the plant validation procedure.
|
|
virtual bool | startStictionEstimation (const yarp::os::Property &options) |
| Start off the stiction estimation procedure.
|
|
virtual bool | startControllerValidation (const yarp::os::Property &options) |
| Start off the controller validation procedure.
|
|
virtual bool | isDone () |
| Check the status of the current ongoing operation.
|
|
virtual bool | waitUntilDone () |
| Wait until the current ongoing operation is accomplished.
|
|
virtual void | stopOperation () |
| Stop any ongoing operation.
|
|
virtual bool | getResults (yarp::os::Property &results) |
| Retrieve the results of the current ongoing operation.
|
|
virtual | ~OnlineCompensatorDesign () |
| Destructor.
|
|
Online Compensator Design.
Tune in an online fashion a controller for a DC motor plant identified by means of OnlineDCMotorEstimator .
The design of the controller is such that the properties of the compensated closed-loop system comply with specifications given in terms of bandwidth and disturbance rejection.
This class has four operative modes: one for the plant estimation, one for the plant validation, one for the stiction estimation and one for validating the controller's design.
Definition at line 347 of file tuning.h.
bool OnlineCompensatorDesign::configure |
( |
yarp::dev::PolyDriver & |
driver, |
|
|
const yarp::os::Property & |
options |
|
) |
| |
|
virtual |
Configure the design.
- Parameters
-
driver | the device driver to control the robot part. |
options | the configuration options. |
Available options are to be given within the following groups:
[general]
joint <int>: specify the joint to be controlled.
port <string>: if given, specify the name of a yarp port to open in order to stream out relevant information.
[plant_estimation]
Ts <double>: specify the estimator sample time given in seconds.
Q <double>: specify the process noise covariance.
R <double>: specify the measurement noise covariance.
P0 <double>: specify the initial error covariance.
tau <double>: specify the initial mechanical time constant given in seconds.
K <double>: specify the initial plant gain.
max_pwm <double>: specify the amplitude of the square voltage waveform applied to the joint for identification purpose.
[stiction_estimation]
see OnlineStictionEstimator for a detailed description of available options.
- Note
- the joint option is here overidden by the one specified within the [general] group.
- Returns
- true/false on success/failure.
Definition at line 459 of file tuning.cpp.
bool OnlineCompensatorDesign::startControllerValidation |
( |
const yarp::os::Property & |
options | ) |
|
|
virtual |
Start off the controller validation procedure.
The specified controller is put to test against the controller currently set within the firmware. The validation experiment foresees cycles of rising and falling transitions in the reference trajectory. The control is therefore continuously switched between the current and the new controller.
Once the validation has been carried out, then the low-level controller's paremeters are restored to their previous values.
- Parameters
-
options | property containing the validation options. Available otions are: (max_time <double>) specifies the maximum amount of time for the experiment; (Kp <double>) (Ki <double>) (Kd <double>) (tau_d <double>) (scale <int>) specify the controller's gains; (stiction (<double><double>)) specifies the stiction values; (stiction_compensation <string>) specifies whether the compensation is managed by the "firmware" (default) or the "middleware"; (ref_type <string>) specifies the waveform of the position reference ("square"|"min-jerk"); (ref_period <double>) specifies the period of the reference; (ref_sustain_time <double>) specifies how log (in seconds) the reference should be kept at the set-point before switching to next value (meaningful for min-jerk reference type); (cycles_to_switch <int>) specifies the number of cycles during which one controller is tested before the switch. |
- Note
- if active, the yarp port streams out, respectively, the mode id 3, the commanded voltage, the actual encoder value, the position reference and a flag accounting for the old pid behavior (0) or the new pid behavior (1). Zero-padding allows being compliant with the data size used for plant estimation mode.
- Returns
- true iff started successfully.
Definition at line 971 of file tuning.cpp.
bool OnlineCompensatorDesign::tuneController |
( |
const yarp::os::Property & |
options, |
|
|
yarp::os::Property & |
results |
|
) |
| |
|
virtual |
Tune the controller once given the plant characteristics.
The design requirements for the closed loop system are given in terms of bandwidth and properties for disturbance rejection.
The plant is assumed to be in the form:
\( K/\left(s \cdot \left(1+s\tau\right)\right). \)
The controller is in the form:
\( K_p + K_i/s. \)
The tuning is symbolic and by no means affects the gains of the low-level controller.
- Parameters
-
options | property object containing the plant characteristics as well as the design requirements: (tau <double>) (K <double>) (f_c <double>) (T_dr <double>); (type <string>) specifies the controller's architecture which can be "P" or "PI". |
results | property containing the design outcome in terms of \( K_p, K_i \) controller's parameters. The property's tags are respectively: Kp, Ki. |
- Returns
- true/false on success/failure.
- Note
- When designing a P controller the user is required to specify the gain crossover frequency f_c in Hz that represents the frequency at which the open loop response has a unity-gain, corresponding roughly to the closed-loop cut-off frequency regulating the control bandwidth.
When designing a PI controller the integral part is employed separately for disturbance rejection in that it tries to cancel out a step-wise disturbance in a time window specified by T_dr parameter, given in seconds.
- Returns
- true/false on success/failure.
Definition at line 838 of file tuning.cpp.