Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
SocCamera::tcPIDControl Class Reference

#include <PIDControl.h>

Collaboration diagram for SocCamera::tcPIDControl:

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 ()
 

Detailed Description

This class controls the PID loop of the TEC.

Constructor & Destructor Documentation

◆ tcPIDControl()

tcPIDControl::tcPIDControl ( int  anBus,
int  anAddr,
SocCamera::tcSensorBoard apSensorBoard,
int  cool_heat_gpio,
int  break_gpio = -1 
)

Create a PIDControl object.

Parameters
anBus- the I2C bus the DAC is on.
anAddr- the address of the DAC on the bus.

◆ ~tcPIDControl()

tcPIDControl::~tcPIDControl ( )
virtual

Member Function Documentation

◆ getDacVolts()

float SocCamera::tcPIDControl::getDacVolts ( )

returns the current DAC voltage

get the TEC Control DAC volts setting

Returns
float DAC volts or -1.0 on error

◆ getDutyCycle()

float tcPIDControl::getDutyCycle ( )

Returns the % drive of the TEC.

Returns
the % drive of the TEC [0-1]

◆ getEnabled()

bool tcPIDControl::getEnabled ( )

Returns whether TEC is enabled and active or not.

Returns
the enable state of the TEC cooler.

◆ getPID()

void tcPIDControl::getPID ( float &  arP,
float &  arI,
float &  arD 
)

Get the PID parameters

◆ getTarget()

float tcPIDControl::getTarget ( )

Get the temperature target in degrees C.

Returns
the current setpoint in Celsius

◆ initialize()

bool tcPIDControl::initialize ( int  anMaxTECCurrentMA = 1500)

Open the I2C device to control and set the PID parameters.

Parameters
anP- the coefficient for the proportional component
anI- the coefficient for the integral component
anD- the coefficient for the differential component

◆ setEnable()

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.

Parameters
abEnable- set to true to enable control. set to false to disable it.
abEnable
anIntervalMilliseconds

◆ setPID()

void tcPIDControl::setPID ( float  anP = DEFAULT_P,
float  anI = DEFAULT_I,
float  anD = DEFAULT_D 
)

Set the PID parameters.

◆ setTarget()

void tcPIDControl::setTarget ( float  anTempC)

Set the temperature target in degrees C.

Parameters
thedesired setpoint in Celsius

◆ step()

void tcPIDControl::step ( )

Cause a single read, calculate, set cycle to occur. Normally this is called by the timer.


The documentation for this class was generated from the following files: