mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-24 17:53:39 +08:00
working 2 motors
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -14,6 +14,7 @@ TARGET = ODriveFirmware
|
||||
DEBUG = 1
|
||||
# optimization
|
||||
# OPT = -O3 -ffast-math -flto
|
||||
# OPT = -O3 -ffast-math
|
||||
OPT = -O0 -ffast-math
|
||||
|
||||
#######################################
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user