MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

Module overview
PID

### Proportional-Integral-Derivative (PID) Module

# Description

The original code for this module documented in ControlSUITE implements a 32-bit digital PID controller with anti-windup correction. The following implementation of the PID documented here are modified versions of the original ControlSUITE implementation. The changes concern removal of the D-action since it was not required for motor control, and a more predictable clipping behaviour. Instead of a integral correction gain, hard clipping is implemented on the integrator output as well as the final output.
The first function implemented in the PID module is the PID_run(). Two outputs are generated, and proportional and integral gains combined as shown in the following equations:

The second function implemented in the PID module is the PID_run_spd(). Two outputs are added together, and proportional and integral gains are independent of each other as shown in the following equations:

# Simulation Information

The following figure shows a top level simulation model in Simulink.

The following figures show implementation of each of these two PID models.

The following figure shows the error in the calculation by the microcontroller, and compares it agains simulation output from Simulink.
Error is the microcontroller output minus Simulink output for function PID_run().
Error Mech is the error for function PID_run_spd().
Outputs shows both microcontroller and Simulink outputs for PID_run().
Outputs Mech shows outputs for PID_run_spd().

# Configuration Information

The modules in this package require several parameters that must be initialized before the main PID module will function properly. Please see the PID_init(), PID_setup(), PID_run() and PID_run_spd() functions defined in pid.h for more details.

# Integration Information

There is only one module in this package, the APIs can be referenced at PID. The module headers are located at pid.h. The test procedures are described at test_pid.h.

# References

1. ControlSUITE Documentation for PID Module.