heat control  r71
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
hc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DELTA_TEMP   200
 
#define IV_HCREC   3
 
#define ENG_CTRL_DUR   5
 
#define OUT_TMP_SHDN_TH   20500
 
#define SHTDN_DUR   3
 
#define NOM_IN_TMP   20100
 
#define NM_TIN   'I'
 
#define NM_TOUT   'O'
 
#define NM_TFOR   'F'
 
#define NM_TNOM   'S'
 
#define NM_TDINNOM   'D'
 
#define NM_OPMODE   'M'
 
#define NM_CNT   'C'
 
#define NM_TIME   'T'
 
#define NM_VOLT   'V'
 
#define NM_MXP   'P'
 
#define NM_MSRFULL   'E'
 
#define DEL_FOR_TEMP   500
 
#define MIN_FOR_TEMP   18000
 
#define MAX_FOR_TEMP   0xFFFE
 
#define OFF_IN_TEMP   0
 

Functions

int main (void)
 main controlling task More...
 
MEASSETDoControl (INT inTemp, INT outTemp, UINT forTemp, UCHAR learning, UINT min, UCHAR sec)
 realizes the main heater controlling algorithm
the value of inner temperature distinguishes between the controlling strategy:
leading the inner temperature if not equal to INVALID_VAL_I16, leading the forerun otherwise More...
 
void DoRecord (UCHAR *recCnt, MEASSET *set)
 
void ControlEngine (ENG_MODE em)
 takes care of the heating curve recording in eeprom
records only if outer temp value does not exist (specific hysteresis respected) More...
 
void PrintMeasValues (MEASSET *ms, OP_MODE opm, UCHAR msrFull)
 puts the measurement values on screen More...
 
void PrintValue (DATTYPE dt, UCHAR col, UCHAR row, UCHAR name, void *value)
 put a specific value on screen More...
 
void DoEngineTest (BTN_CODE bc)
 do engine testing dependent on button request, simply drives the mixer engine unconditionally More...
 
UINT FindForeRun (INT *outTemp, const UCHAR range, UINT const delLim)
 gets the forerun temperature of the closest outer temperature which was recorded in learning phase
a predefined hysteresis supports a proper hit More...
 
UCHAR CalcPrevIndex (UCHAR curIdx, UCHAR delIdx)
 

Macro Definition Documentation

#define DEL_FOR_TEMP   500

deviation of the forerun temperature

Definition at line 92 of file hc.h.

Referenced by DoControl().

#define DELTA_TEMP   200

significant temperature difference [1/1000 °C]

Definition at line 8 of file hc.h.

#define ENG_CTRL_DUR   5

ECD: engine controlling duration in a tenth of a second [1/10s], if in a controlling cycle a mixer engine rotation step is required, this is the period of time to drive the engine

Definition at line 19 of file hc.h.

#define IV_HCREC   3

HCI: heating curve recording interval [1], the number of multiple of IV_MEAS

Definition at line 13 of file hc.h.

#define MAX_FOR_TEMP   0xFFFE

maximum allowed forerun temperature

Definition at line 100 of file hc.h.

Referenced by DoControl().

#define MIN_FOR_TEMP   18000

minimum allowed forerun temperature

Definition at line 96 of file hc.h.

Referenced by DoControl().

#define NM_CNT   'C'

name of common counter value

Definition at line 72 of file hc.h.

Referenced by main().

#define NM_MSRFULL   'E'

name to use for all temperatures if MEASSET recording memory is full

Definition at line 88 of file hc.h.

Referenced by PrintMeasValues().

#define NM_MXP   'P'

name of mixer position

Definition at line 84 of file hc.h.

#define NM_OPMODE   'M'

name of operation mode value

Definition at line 68 of file hc.h.

Referenced by main().

#define NM_TDINNOM   'D'

name of delta temperature (inner to nominal)

Definition at line 64 of file hc.h.

#define NM_TFOR   'F'

name of forerun temperature measurement value

Definition at line 56 of file hc.h.

Referenced by main(), and PrintMeasValues().

#define NM_TIME   'T'

name of time stamp measurement value

Definition at line 76 of file hc.h.

Referenced by main().

#define NM_TIN   'I'

name of inner temperature measurement value

Definition at line 48 of file hc.h.

Referenced by main(), and PrintMeasValues().

#define NM_TNOM   'S'

name of nominal temperature

Definition at line 60 of file hc.h.

#define NM_TOUT   'O'

name of outer temperature measurement value

Definition at line 52 of file hc.h.

Referenced by main(), and PrintMeasValues().

#define NM_VOLT   'V'

name of voltage

Definition at line 80 of file hc.h.

Referenced by main().

#define NOM_IN_TMP   20100

NIT: nominal inner temperature

Definition at line 44 of file hc.h.

#define OFF_IN_TEMP   0

OIT: inner temperature offset

Definition at line 105 of file hc.h.

#define OUT_TMP_SHDN_TH   20500

TRD: duration of significant outer temp rising in minutes TDM: multiplicator of delta temp (defines significant outer temp change in a specific duration of time) SDT: outer temp shut down threshold [°C], heating system will close the mixer if temp is equal or greater

Definition at line 34 of file hc.h.

#define SHTDN_DUR   3

SDD: shut down duration in minutes, mixer engine will be driven this period of time to close the circuit

Definition at line 39 of file hc.h.

Function Documentation

UCHAR CalcPrevIndex ( UCHAR  curIdx,
UCHAR  delIdx 
)

Definition at line 517 of file hc.c.

References CHAR, NUM_MS, and UCHAR.

void ControlEngine ( ENG_MODE  em)

takes care of the heating curve recording in eeprom
records only if outer temp value does not exist (specific hysteresis respected)

Parameters
recCntrecord counter for list indexing
setcurrent valid measurement set takes care of the mixer engine controlling (output pin switching)
emcurrent engine mode
mxpmixer engine's step position

Definition at line 432 of file hc.c.

References EM_CCW, EM_CW, EM_STOP, ENG_RUN_CCW, ENG_RUN_CW, ENG_STOP_CCW, and ENG_STOP_CW.

Referenced by DoControl(), and DoEngineTest().

Here is the caller graph for this function:

MEASSET* DoControl ( INT  inTemp,
INT  outTemp,
UINT  forTemp,
UCHAR  learning,
UINT  min,
UCHAR  sec 
)

realizes the main heater controlling algorithm
the value of inner temperature distinguishes between the controlling strategy:
leading the inner temperature if not equal to INVALID_VAL_I16, leading the forerun otherwise

Parameters
inTempinner temperature
outTempouter temperature
forTemptemperature of forerun
learningspecifies whether in learning mode -> TRUE, or forerun controlling required -> FALSE
minminute value
secsecond value
Returns
meas set on next valid interval, NULL otherwise

Definition at line 279 of file hc.c.

References ENG_TIMER::allow, CM_DENY, CM_FOR, CM_MEAS, CM_REC, CM_SHDN, ENG_TIMER::cnt, ControlEngine(), DEL_FOR_TEMP, ENG_TIMER::em, EM_CCW, EM_CW, EM_STOP, FindForeRun(), MEASSET::forTemp, g_ctm, INT, MEASSET::inTemp, INVALID_VAL_U16, MAX_DEL_OUTER_TEMP, MAX_FOR_TEMP, MIN_FOR_TEMP, NUM_HR, old_min, MEASSET::outTemp, TRUE, UCHAR, and UINT.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void DoEngineTest ( BTN_CODE  bc)

do engine testing dependent on button request, simply drives the mixer engine unconditionally

Parameters
bcbutton code of request

Definition at line 495 of file hc.c.

References BC_DN, BC_DNUP, BC_NONE, BC_UP, ControlEngine(), EM_CCW, EM_CW, and EM_STOP.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void DoRecord ( UCHAR recCnt,
MEASSET set 
)
UINT FindForeRun ( INT outTemp,
const UCHAR  range,
UINT const  delLim 
)

gets the forerun temperature of the closest outer temperature which was recorded in learning phase
a predefined hysteresis supports a proper hit

Parameters
outTempouter temperature as a parameter to find a proper close forerun temperature, will be updated on a hit by the value from eep
rangedelimits the number of entries in eeprom being searched - depends on the number of recorded entries (the recording state)
delLimthe delta limit against which to check the calculated difference of the outer temperature
Returns
a valid forerun temperature if there was a hit, INVALID_VAL_U16 otherwise

Definition at line 387 of file hc.c.

References HCREC::forTemp, ge_hcRec, INT, INVALID_VAL_U16, HCREC::outTemp, and UCHAR.

Referenced by DoControl().

Here is the caller graph for this function:

int main ( void  )

main controlling task

Returns
will never return in normal operation

nominal temperature from setup

inner temp for controlling

outer temp for controlling

supply voltege of temperature sender

forerun temp for controlling

trace whether the context runs in the very first controlling cycle

offset value of button action for payload changes

counter for indexing the heating curve recording sets in e_hcRec of eeprom

indexer for measurement sets in ram, its value is an indicator of the time stamp when a set was captured - depending on the measurement interval

operation mode during controlling

button code for capturing

remember the previous seconds value

remember a time span of 5 seconds for meas value visualization

delta seconds

common time stamp for capturing

running tenth of a second

running seconds

running minutes

temporary measurement set in ram

previous control mode, indicator to write again

name of control mode in hrf

Definition at line 52 of file hc.c.

References ADC_TMP_INNER_ID, ADC_TMP_OUTER_ID, BC_DNUP, BC_NONE, CalcAdcTemp(), CalcSupplyVoltage(), CHAR, CM_DENY, DecodeButton(), DIR_UP, DoControl(), DoEngineTest(), DoSetup(), DT_INT, DT_TIME, DT_UCHAR, DT_UINT, FALSE, MEASSET::forTemp, g_ctm, g_min, g_sec, ge_hcrCnt, ge_msRec, GetCtrlMode(), GetSenderValues(), gMov(), Init(), INVALID_VAL_I16, INVALID_VAL_U16, NM_CNT, NM_OPMODE, NM_TFOR, NM_TIME, NM_TIN, NM_TOUT, NM_VOLT, NUM_HR, NUM_MS, NUM_MSR, old_min, OM_CONTI, OM_ENGTEST, OM_SENDER, OM_SETUP, OM_SHMEAS, OM_TMPCTRL, OP_MODES, OVM_MSR, PrintMeasValues(), PrintValue(), SetLimitValue(), sMov(), TRUE, UCHAR, UINT, and WriteCtrlMode().

Here is the call graph for this function:

void PrintMeasValues ( MEASSET ms,
OP_MODE  opm,
UCHAR  msrFull 
)

puts the measurement values on screen

Parameters
mscurrent measurement set
opmcurrent operation mode

Definition at line 455 of file hc.c.

References DT_INT, DT_UINT, MEASSET::forTemp, MEASSET::inTemp, NM_MSRFULL, NM_TFOR, NM_TIN, NM_TOUT, OM_SETUP, OM_SHMEAS, MEASSET::outTemp, and PrintValue().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void PrintValue ( DATTYPE  dt,
UCHAR  col,
UCHAR  row,
UCHAR  name,
void *  value 
)

put a specific value on screen

Parameters
dtvalue's data type
colstarting column of the output
rowstarting row of the output
nameof value
valueto put on screen

Definition at line 480 of file hc.c.

References LCD_POS::col, MEASVAL::dt, MEASVAL::name, MEASVAL::pos, LCD_POS::row, MEASVAL::value, and WriteMeasVal().

Referenced by main(), and PrintMeasValues().

Here is the call graph for this function:

Here is the caller graph for this function: