Ymit24 / too-hot-to-prandtl-control-system

GNU General Public License v2.0
0 stars 0 forks source link

Use Physical Units #5

Closed Ymit24 closed 5 months ago

Ymit24 commented 6 months ago

What?

Update the packets and associated control/embedded code to properly use physically based values such as RPM and Voltage.

Why?

Using physical unit based types makes it easier to verify valid states and catch weird bugs like a sensor malfunctioning. It also provides more security, if you have access to an instance of a Temperature, then you know, for example, that it must not be negative.

How?

Update existing packet definitions in the common module. Updated associated embedded_firmware(_core) and control_system code.

Ymit24 commented 6 months ago

Picking this up.

Ymit24 commented 6 months ago

Realized Voltage isn't Eq due to f32. Going to change from Voltage to Percentage to better model PWM / activation concept.

Ymit24 commented 6 months ago

Added Percentage and started using it in Packets/embedded/controls. Starting to try and use RPM too.

Ymit24 commented 5 months ago

Picking this back up.

Ymit24 commented 5 months ago

Now using Percentage for control packets and Rpm for sensor report packets. Should be done with this. Could always improve of course. Design isn't perfect and definitely suffers from some early questionable decisions. Doesn't effect functionality for now however so it isn't important. Going to close this. (All tests passing, important to note since CI isn't currently setup.)

Ymit24 commented 5 months ago

Going to make PR

Ymit24 commented 5 months ago

Merged.