diff --git a/Inc/main.h b/Inc/main.h index 55ec8112..d53122f3 100644 --- a/Inc/main.h +++ b/Inc/main.h @@ -52,6 +52,7 @@ /* Private define ------------------------------------------------------------*/ #define TIM_CLOCK_HZ 168000000 #define TIM_PERIOD_CLOCKS 8192 +// #define TIM_PERIOD_CLOCKS 4096 #define TIM_DEADTIME_CLOCKS 20 #define M0_nCS_Pin GPIO_PIN_13 diff --git a/Makefile b/Makefile index d7e8518c..29501960 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ TARGET = ODriveFirmware DEBUG = 1 # optimization # OPT = -O3 -ffast-math -flto +# OPT = -O3 -ffast-math OPT = -O0 -ffast-math ####################################### diff --git a/MotorControl/low_level.c b/MotorControl/low_level.c index 9228e526..97a1dc94 100644 --- a/MotorControl/low_level.c +++ b/MotorControl/low_level.c @@ -528,8 +528,11 @@ void motor_thread(void const * argument) { float test_current = 4.0f; float R = measure_phase_resistance(motor, test_current, 1.0f); - // scan_motor(motor, 10.0f, test_current * R); - scan_motor(motor, 10.0f, 0.2f); + if (motor == &motors[0]) { + scan_motor(motor, 50.0f, test_current * R); + } else { + scan_motor(motor, 10.0f, test_current * R); + } // float L = measure_phase_inductance(motor, -1.0f, 1.0f); //De-energize motor diff --git a/Src/freertos.c b/Src/freertos.c index 8aafd1d2..9e9f7a2d 100644 --- a/Src/freertos.c +++ b/Src/freertos.c @@ -114,7 +114,7 @@ void StartDefaultTask(void const * argument) init_motor_control(); // Start motor threads - // osThreadCreate(osThread(task_motor_0), &motors[0]); + osThreadCreate(osThread(task_motor_0), &motors[0]); osThreadCreate(osThread(task_motor_1), &motors[1]); //If we get to here, then the default task is done.