Commit a8eeaafc authored by pkda001's avatar pkda001

Updated pump for algorithm 2

parent 76721259
......@@ -66,7 +66,7 @@ std::shared_ptr<Config>& cf) {
// Grab pump settings from config file
pump_rate_Hz = cf->lookup("pump.rate");
pump_period_sec = cf->lookup("pump.period");
pump_delay = cf->lookup("pump.delay");
......@@ -77,14 +77,15 @@ std::shared_ptr<Config>& cf) {
// integer input rate for controller
input_period = (1/pump_rate_Hz) / time_step;
input_period = pump_period_sec / time_step;
delay_period = (pump_delay/ time_step);
period = input_period + delay_period;
is_input_multiple = fmod(MAX_RATE_Hz, pump_rate_Hz) == 0.0;
is_input_multiple = ((int)(1000*pump_period_sec))
% ((int)(1000*MIN_PERIOD_SECS)) == 0.0;
if(pump_rate_Hz > MAX_RATE_Hz) {
if(pump_period_sec < MIN_PERIOD_SECS) {
cout <<"\nPump rate is greater than MAX: 50.0\n\n";
Stop();
......
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