Commit bf6de540 by RBO lab

mass flow ctrl config msg with flow model scaling factors from lin reg

parent 931dd15a
......@@ -421,13 +421,27 @@ const eMessageType MSGTYPE_BROADCAST8 = 0x304; //reply message that
typedef struct {
HeaderConfigurationMsgs header_config;
AirServerSignal in_desired;
AirServerSignal out_inflate;
AirServerSignal out_deflate;
AirServerSignal pressure_supply;
AirServerSignal pressure_out;
AirServerSignalValue dead_time_on;
AirServerSignalValue dead_time_off;
AirServerSignal in_desired;
AirServerSignal out_inflate;
AirServerSignal out_deflate;
AirServerSignal pressure_supply;
AirServerSignal pressure_out;
AirServerSignalValue c_inf;
AirServerSignalValue c_inf_linear;
AirServerSignalValue c_inf_leeco;
AirServerSignalValue c_inf_Psupp;
AirServerSignalValue c_inf_Pact;
AirServerSignalValue c_def;
AirServerSignalValue c_def_linear;
AirServerSignalValue c_def_leeco;
AirServerSignalValue c_def_Psupp;
AirServerSignalValue c_def_Pact;
AirServerSignalValue inf_threshold;
AirServerSignalValue def_threshold;
} MsgConfigurationControllerMassflow;
......@@ -578,9 +592,9 @@ typedef struct {
return 0; //unknown message type will return 0
}
//#define MAX_LENGTH (sizeof(MsgControllerConfiguration))
#define MAX_LENGTH (sizeof(MsgControllerConfiguration))
const unsigned int MAX_MESSAGE_LENGTH = ((4+10)*sizeof(uint32_t)); //maximum: message with 10 fields
const unsigned int MAX_MESSAGE_LENGTH = ((4+20)*sizeof(uint32_t)); //maximum: message with 10 fields
......
......@@ -119,8 +119,27 @@ namespace AirserverController{
AirServerSignal out_deflate;
AirServerSignal pressure_supply;
AirServerSignal pressure_out;
AirServerSignalValue dead_time_on;
AirServerSignalValue dead_time_off;
// linear regression coefficients
// inflation:
AirServerSignalValue c_inf; // constant for each inflation, leap when valve opens
AirServerSignalValue c_inf_linear; // scaling factor for linear air mass flow model
AirServerSignalValue c_inf_leeco; // scaling factor for air mass flow model as per Lee Company
AirServerSignalValue c_inf_Psupp; // scaling factor for supply pressure at inflation start,
// results in a constant for each inflation,
// valve opening time might be influenced by supply pressure
AirServerSignalValue c_inf_Pact; // scaling factor for actuator pressure at inflation start,
// results in a constant for each inflation
// deflation:
AirServerSignalValue c_def; // ^
AirServerSignalValue c_def_linear;
AirServerSignalValue c_def_leeco;
AirServerSignalValue c_def_Psupp;
AirServerSignalValue c_def_Pact;
// air mass difference from desired value to start an inflation / deflation
AirServerSignalValue inf_threshold;
AirServerSignalValue def_threshold;
// environment pressure:
float P_ENV= 103; //kPa
......@@ -129,24 +148,16 @@ namespace AirserverController{
// and current in-/deflated mass
float error;
// current mass change in actuator
// since controller start
// for linear and nonlinear model
float delta_mass_desired_complete;
float delta_mass_complete_linear;
float delta_mass_complete_leeco;
float delta_mass_complete_psi;
float delta_mass_complete; // combines models
// the desired air mass in the actuator,
// equals zero at controller start
float mass_desired;
// values for massflow model
// the pressure values before an inf-/deflation
float P_supply_before_action;
float P_out_before_action;
//for testing
float inf;
float def;
// the estimated air mass in the actuator as per multiple models
// equals zero at controller start
float mass_linear;
float mass_leeco;
float mass_psi;
float mass; // combines models and parameters
/** calculates massflow using a linear model
* @param Pi: inlet pressure as measured, relative to environment, not absolute
......@@ -187,7 +198,6 @@ namespace AirserverController{
float MFPSIModel(float Pi, float Po, float scale= 1.0);
public:
CntrlMassflow() : Cntrl(){}
CntrlMassflow(MsgConfigurationControllerMassflow *conf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment