![]() |
Critical Link MityCam SoC Firmware
1.0
Critical Link MityCam SoC Firmware
|
#include <PIDControl.h>
Public Member Functions | |
| tcPIDControl (int anBus, int anAddr, SocCamera::tcSensorBoard *apSensorBoard, int cool_heat_gpio, int break_gpio=-1) | |
| virtual | ~tcPIDControl () |
| bool | initialize (int anMaxTECCurrentMA=1500) |
| void | setPID (float anP=DEFAULT_P, float anI=DEFAULT_I, float anD=DEFAULT_D) |
| void | getPID (float &arP, float &arI, float &arD) |
| void | setEnable (bool abEnable, int anIntervalMilliseconds=1000) |
| void | setTarget (float anTempC) |
| float | getTarget () |
| bool | getEnabled () |
| float | getDutyCycle () |
| float | getDacVolts () |
| returns the current DAC voltage More... | |
| void | step () |
This class controls the PID loop of the TEC.
| tcPIDControl::tcPIDControl | ( | int | anBus, |
| int | anAddr, | ||
| SocCamera::tcSensorBoard * | apSensorBoard, | ||
| int | cool_heat_gpio, | ||
| int | break_gpio = -1 |
||
| ) |
Create a PIDControl object.
| anBus | - the I2C bus the DAC is on. |
| anAddr | - the address of the DAC on the bus. |
|
virtual |
| float SocCamera::tcPIDControl::getDacVolts | ( | ) |
returns the current DAC voltage
get the TEC Control DAC volts setting
| float tcPIDControl::getDutyCycle | ( | ) |
Returns the % drive of the TEC.
| bool tcPIDControl::getEnabled | ( | ) |
Returns whether TEC is enabled and active or not.
| void tcPIDControl::getPID | ( | float & | arP, |
| float & | arI, | ||
| float & | arD | ||
| ) |
Get the PID parameters
| float tcPIDControl::getTarget | ( | ) |
Get the temperature target in degrees C.
| bool tcPIDControl::initialize | ( | int | anMaxTECCurrentMA = 1500 | ) |
Open the I2C device to control and set the PID parameters.
| anP | - the coefficient for the proportional component |
| anI | - the coefficient for the integral component |
| anD | - the coefficient for the differential component |
| void tcPIDControl::setEnable | ( | bool | abEnable, |
| int | anIntervalMilliseconds = 1000 |
||
| ) |
Enable/disable the PID control loop. Starts a timer to tick at the specified interval; each tick calculates the updated value for the PID loop.
| abEnable | - set to true to enable control. set to false to disable it. |
| abEnable | |
| anIntervalMilliseconds |
Set the PID parameters.
| void tcPIDControl::setTarget | ( | float | anTempC | ) |
Set the temperature target in degrees C.
| the | desired setpoint in Celsius |
| void tcPIDControl::step | ( | ) |
Cause a single read, calculate, set cycle to occur. Normally this is called by the timer.