zebra joint controller firmware (originally from MIT HKC motor controller by benkatz)

Dependencies:   mbed FastPWM3

Revision:
55:1c704b515383
Parent:
53:e85efce8c1eb
--- a/main.cpp	Thu Aug 08 17:39:43 2019 +0000
+++ b/main.cpp	Fri Feb 05 10:49:02 2021 +0000
@@ -10,7 +10,7 @@
 #define SETUP_MODE 4
 #define ENCODER_MODE 5
 
-#define VERSION_NUM "1.9"
+#define VERSION_NUM "HKC1.9/ZEBRA1.0"
 
 
 float __float_reg[64];                                                          // Floats stored in flash
@@ -26,7 +26,7 @@
 #include "current_controller_config.h"
 #include "hw_config.h"
 #include "motor_config.h"
-#include "stm32f4xx_flash.h"
+//#include "stm32f4xx_flash.h"
 #include "FlashWriter.h"
 #include "user_config.h"
 #include "PreferenceWriter.h"
@@ -52,7 +52,7 @@
 //DigitalOut drv_en_gate(PA_11);
 DRV832x drv(&drv_spi, &drv_cs);
 
-PositionSensorAM5147 spi(16384, 0.0, NPP);  
+PositionSensorAM5147 spi(8192, 0.0, NPP);  
 
 volatile int count = 0;
 volatile int state = REST_MODE;
@@ -200,7 +200,7 @@
             case MOTOR_MODE:                                                   // Run torque control
                 if(state_change){
                     enter_torque_mode();
-                    count = 0;
+                    //count = 0;
                     }
                 else{
                 /*
@@ -226,7 +226,7 @@
                 commutate(&controller, &observer, &gpio, controller.theta_elec);           // Run current loop
 
                 controller.timeout++;
-                count++; 
+                //count++; 
             
                 }     
                 break;