Modified Motor Driver Firmware to include Flash + Thermal

Dependencies:   FastPWM3 mbed-dev-STM-lean

Revision:
73:5676f1232a81
Parent:
71:b314182de37f
Child:
74:fcc5f8e7f0ef
--- a/Config/user_config.h	Sun Aug 28 18:01:26 2022 +0000
+++ b/Config/user_config.h	Mon Aug 29 16:03:54 2022 +0000
@@ -18,6 +18,22 @@
 #define KI_D                    __float_reg[11]                                 // Current Controller KI D-Axis
 #define KI_Q                    __float_reg[12]                                 // Current Controller KI Q-Axis
 
+//MOTOR PARAMETERS MOVED TO FLASH
+#define R_PHASE                 __float_reg[13]                                 //Phase resistance in OHMS
+#define L_D                     __float_reg[14]                                 //D-axis inductance in HENRIES
+#define L_Q                     __float_reg[15]                                 //L-axis inductance in HENRIES
+#define NPP                     __int_reg[4]                                    //Number of motor Pole Pairs
+//ACTUATOR PARAMETERS
+#define KT                      __float_reg[16]                                 //Torque Constance Nm/peak phase amp, = WB*NPP*3/2
+#define GR                      __float_reg[17]                                 //Output gear ratio
+#define KT_OUT                  __float_reg[18]                                 //KT*GR
+#define WB                      __float_reg[19]                                 //Flux linkage, Webers.  (from motor KT, see above formula)
+//THERMAL OBSERVER
+#define R_TH                    __float_reg[20]                                 //Kelvin watt per joule (motor thermal resistance)
+#define INV_M_TH                __float_reg[21]                                 //Kelvin per Joule (some observer thing)
+#define T_AMBIENT               __float_reg[22]                                 // ambient temperature during temp calibration
+
+
 #define PHASE_ORDER             __int_reg[0]                                    // Phase swapping during calibration
 #define CAN_ID                  __int_reg[1]                                    // CAN bus ID
 #define CAN_MASTER              __int_reg[2]                                    // CAN bus "master" ID