diff --git a/firmware/Makefile b/firmware/Makefile index 439cf8e..393340d 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -122,6 +122,7 @@ CPPSRC = $(ALLCPPSRC) \ analog_input.cpp \ can.cpp \ can_helper.cpp \ + lambda_lookup.cpp \ pwm.cpp \ main.cpp diff --git a/firmware/lambda_lookup.cpp b/firmware/lambda_lookup.cpp new file mode 100644 index 0000000..e8d6fd4 --- /dev/null +++ b/firmware/lambda_lookup.cpp @@ -0,0 +1,3 @@ + +static const float pumpCurrentMa[24] = { -2.0f, -1.602f, -1.243f, -0.927f, -0.8f, -0.652f, -0.405f, -0.183f, -0.106f, -0.04f, 0.0f, 0.015f, 0.097f, 0.193f, 0.25f, 0.329f, 0.671f, 0.938f, 1.15f, 1.385f, 1.7f, 2.0f, 2.15f, 2.25 }; +static const float phi[24] = { 1.538461538f, 1.428571429f, 1.333333333f, 1.25f, 1.216545012f, 1.176470588f, 1.111111111f, 1.052631579f, 1.030927835f, 1.01010101f, 0.997008973f, 0.99009901f, 0.952380952f, 0.909090909f, 0.883392226f, 0.848176421f, 0.699790063f, 0.587889477f, 0.502512563f, 0.410846343f, 0.292997363f, 0.185494342f, 0.133226752f, 0.098823994 }; \ No newline at end of file