aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Firmware/Tango.FirmwareUpdateLib/Stdafx.h
blob: 3cc4c24ef9fa8b939c60763a015898bc45a84009 (plain)
1
2
3
4
5
6
7
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently

#pragma once
*/ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef MODULES_HEATERS_HEATERS_H_
#define MODULES_HEATERS_HEATERS_H_
#include "PMR/Hardware/HardwarePidControl.pb-c.h"
#include "PMR/Hardware/HardwarePidControlType.pb-c.h"
#include "heaters_ex.h"
#include "Drivers/Heater/Heater.h"
/******************** DEFINITIONS  ********************************************/
#define MAX_AC_HEATERS (HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary+1)
#define MAX_TIMESLICES 200

extern uint32_t OutputProportionalSingleStep;  //A/C Heaters step size from one decision point to another - in cpu clocks. 120000 = 1 millisecod
extern uint32_t OutputProportionalCycleTime; //A/C Heaters Cycle time in milliseconds - one for all heaters
//extern uint32_t Heater_timerBase;        //Timer handle
extern char     TimeSliceAllocation[MAX_TIMESLICES];
extern int     DCTimeSliceAllocation[HEATER_TYPE_MAX_HEATERS];
extern int      NumberOFSlicesInUse;
extern uint32_t MillisecondsPerChange;

void initializeArrays(void);

typedef struct  HeaterPIDControlConfigstruc
{
  bool configured;
  int id;  //HardwarePidControlType
  float outputproportionalpowerlimit;
  float outputproportionalband;
  //int32_t sensorcorrectionadjustment;
  //int32_t sensortypeandsetpointlimits;
  float IntegralErrorMultiplier; //setpointramprateorsoftstartramp
  //int32_t setpointcontroloutputrate;
  float ProportionalErrorMultiplier;//outputonoffhysteresisvalue;
  //int32_t processvariablesamplingrate;
  //int32_t pvinputfilterfactormode;
  int32_t sensormaxvalue;
  int32_t sensorminvalue;
  double kp;
  double ki;
  double kd;
  double epsilon;
  double dt;
  bool   pidactive;
}HeaterPIDControlConfig;

typedef struct  HeaterCommandstruc
{
  int heaterid; //HardwarePidControlType
  bool     command;
  uint32_t targettemperatue;
}HeaterCommand;


extern HeaterPIDControlConfig HeaterControl[HEATER_TYPE_MAX_HEATERS];
extern HeaterCommand          HeaterCmd[HEATER_TYPE_MAX_HEATERS];
extern uint32_t  Heater_timerBase;

uint32_t HeaterRecalculateSharedHeatersParams(uint32_t deviceId, uint32_t new_outputproportionalpowerlimit);
uint32_t HeaterRecalculateHeaterParams(uint32_t deviceId, uint32_t new_outputproportionalpowerlimit);

uint32_t HeatersSingleHeaterEnd(int HeaterId);

#endif