Modified Motor Driver Firmware to include Flash + Thermal

Dependencies:   FastPWM3 mbed-dev-STM-lean

Revision:
75:c7fbacd92b8f
Parent:
74:fcc5f8e7f0ef
Child:
76:4fd876d4cf2b
--- a/main.cpp	Mon Aug 29 18:09:36 2022 +0000
+++ b/main.cpp	Mon Aug 29 18:57:14 2022 +0000
@@ -156,8 +156,8 @@
     wait_us(10);
     printf(" %-4s %-31s %-5s %-6s %f\n\r", "e", "Q-axis inductance (H)", "0", "0.1", L_Q);
     wait_us(10);
-    printf(" %-4s %-31s %-5s %-6s %d\n\r", "n", "Number of Pole Pairs (NPP)", "0", "40", NPP);
-    wait_us(10);
+    //printf(" %-4s %-31s %-5s %-6s %d\n\r", "n", "Number of Pole Pairs (NPP)", "0", "40", NPP);
+    //wait_us(10);
     //ACTUATOR PARAMS
     printf("ACTUATOR PARAMS\n\r");
     wait_us(10);
@@ -457,9 +457,9 @@
                     case 'e':
                         L_Q = fmaxf(fminf(atof(cmd_val), 0.1f), 0.0f);
                         break;
-                    case 'n':
-                        NPP = atoi(cmd_val);
-                        break;
+                    //case 'n':
+                        //NPP = atoi(cmd_val);
+                        //break;
                     case 'p':
                         KT = fmaxf(fminf(atof(cmd_val), 1.0f), 0.0f);
                         break;
@@ -590,7 +590,7 @@
     if(isnan(R_PHASE) || R_PHASE==-1){R_PHASE = 0.158f;}
     if(isnan(L_D) || L_D==-1){L_D = 0.000084f;}
     if(isnan(L_Q) || L_Q==-1){L_Q = 0.000084f;}
-    if(isnan(NPP) || NPP==-1){NPP = 21;}
+    //if(isnan(NPP) || NPP==-1){NPP = 21;}
     //ACTUATOR PARAMS
     if(isnan(KT) || KT==-1){KT = 0.1916f;}
     if(isnan(GR) || GR==-1){GR = 6.0f;}
@@ -623,6 +623,7 @@
     printf(" Position Sensor Electrical Offset:   %.4f\n\r", E_OFFSET);
     printf(" Output Zero Position:  %.4f\n\r", M_OFFSET);
     printf(" CAN ID:  %d\n\r", CAN_ID);
+    printf(" POLE PAIRS:  %d\n\r", NPP);
     
 
     TIM1->CR1 ^= TIM_CR1_UDIS;