hytech-racing / MCU

https://hytech-racing.github.io/MCU/index.html
GNU General Public License v3.0
0 stars 0 forks source link

Implement getter for DrivetrainDynamicReport_s #32

Closed Dopp-IO closed 5 months ago

Dopp-IO commented 7 months ago

Required for TC power limiting functionality. This data must be ticked into torque_controller_mux.

RCMast3r commented 7 months ago

I added in the getter here: https://github.com/hytech-racing/MCU/blob/master/lib/systems/include/DrivetrainSystem.tpp#L145

however, there is some slight config stuff we need to look at on the inverters to get the torques.

in the old version of code we just used the torque setpoint as our torque estimate: https://github.com/hytech-racing/MCU/blob/master/src/old_main.cpp#L991

however as I state here:

https://github.com/hytech-racing/MCU/blob/master/lib/interfaces/include/InverterInterface.tpp#L93

we should be able to get the real torque output of the motors from the inverter by enabling a signal on the CAN bus.

additionally while we are looking at the inverter configs we need to get the id110 value for the current scaling for iq and id if we still want those so that we can get it data into regular Amperes.