From 0a1f941de05d431ce5fb81dc05af88a352384dfb Mon Sep 17 00:00:00 2001 From: jonny_jr9 Date: Mon, 4 Sep 2023 08:43:20 +0200 Subject: [PATCH 1/5] Update configs according to new pin assignment current config of each board now matches pin assignment --- board_motorctl/main/config.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/board_motorctl/main/config.cpp b/board_motorctl/main/config.cpp index 7f7b874..1e0a6ad 100644 --- a/board_motorctl/main/config.cpp +++ b/board_motorctl/main/config.cpp @@ -6,8 +6,8 @@ //--- configure left motor (hardware) --- single100a_config_t configDriverLeft = { .gpio_pwm = GPIO_NUM_26, - .gpio_a = GPIO_NUM_16, - .gpio_b = GPIO_NUM_4, + .gpio_a = GPIO_NUM_4, + .gpio_b = GPIO_NUM_16, .ledc_timer = LEDC_TIMER_0, .ledc_channel = LEDC_CHANNEL_0, .aEnabledPinState = false, //-> pins inverted (mosfets) @@ -20,7 +20,7 @@ single100a_config_t configDriverLeft = { single100a_config_t configDriverRight = { .gpio_pwm = GPIO_NUM_27, .gpio_a = GPIO_NUM_2, - .gpio_b = GPIO_NUM_14, + .gpio_b = GPIO_NUM_15, .ledc_timer = LEDC_TIMER_1, .ledc_channel = LEDC_CHANNEL_1, .aEnabledPinState = false, //-> pin inverted (mosfet) @@ -35,8 +35,13 @@ single100a_config_t configDriverRight = { motorctl_config_t configMotorControlLeft = { .msFadeAccel = 1900, //acceleration of the motor (ms it takes from 0% to 100%) .msFadeDecel = 1000, //deceleration of the motor (ms it takes from 100% to 0%) +<<<<<<< Updated upstream .currentLimitEnabled = true, + .currentSensor_adc = ADC1_CHANNEL_0, //GPIO36 +======= + .currentLimitEnabled = false, .currentSensor_adc = ADC1_CHANNEL_6, //GPIO34 +>>>>>>> Stashed changes .currentSensor_ratedCurrent = 50, .currentMax = 30, .deadTimeMs = 900 //minimum time motor is off between direction change @@ -46,8 +51,13 @@ motorctl_config_t configMotorControlLeft = { motorctl_config_t configMotorControlRight = { .msFadeAccel = 1900, //acceleration of the motor (ms it takes from 0% to 100%) .msFadeDecel = 1000, //deceleration of the motor (ms it takes from 100% to 0%) +<<<<<<< Updated upstream .currentLimitEnabled = true, + .currentSensor_adc = ADC1_CHANNEL_3, //GPIO39 +======= + .currentLimitEnabled = false, .currentSensor_adc = ADC1_CHANNEL_4, //GPIO32 +>>>>>>> Stashed changes .currentSensor_ratedCurrent = 50, .currentMax = 30, .deadTimeMs = 900 //minimum time motor is off between direction change From fcecd930d33faa8a3e3e65bd4370fb19b57b1fbd Mon Sep 17 00:00:00 2001 From: jonny_jr9 Date: Mon, 4 Sep 2023 10:23:25 +0200 Subject: [PATCH 2/5] Add brake-relay support to motordriver [untested] Turn on brake relays in BRAKE state Also wait certain time for relays to switch before shorting the driver Add config option for brake relay pin Initialize pin in constructor --- board_motorctl/main/config.cpp | 2 + board_motorctl/main/motordrivers.cpp | 60 +++++++++++++++++++++++----- board_motorctl/main/motordrivers.hpp | 3 ++ 3 files changed, 55 insertions(+), 10 deletions(-) diff --git a/board_motorctl/main/config.cpp b/board_motorctl/main/config.cpp index 1e0a6ad..2c1389e 100644 --- a/board_motorctl/main/config.cpp +++ b/board_motorctl/main/config.cpp @@ -8,6 +8,7 @@ single100a_config_t configDriverLeft = { .gpio_pwm = GPIO_NUM_26, .gpio_a = GPIO_NUM_4, .gpio_b = GPIO_NUM_16, + .gpio_brakeRelay = GPIO_NUM_5, //power mosfet 2 .ledc_timer = LEDC_TIMER_0, .ledc_channel = LEDC_CHANNEL_0, .aEnabledPinState = false, //-> pins inverted (mosfets) @@ -21,6 +22,7 @@ single100a_config_t configDriverRight = { .gpio_pwm = GPIO_NUM_27, .gpio_a = GPIO_NUM_2, .gpio_b = GPIO_NUM_15, + .gpio_brakeRelay = GPIO_NUM_18, //power mosfet 1 .ledc_timer = LEDC_TIMER_1, .ledc_channel = LEDC_CHANNEL_1, .aEnabledPinState = false, //-> pin inverted (mosfet) diff --git a/board_motorctl/main/motordrivers.cpp b/board_motorctl/main/motordrivers.cpp index 387bda3..41a17bb 100644 --- a/board_motorctl/main/motordrivers.cpp +++ b/board_motorctl/main/motordrivers.cpp @@ -1,4 +1,6 @@ #include "motordrivers.hpp" +#include "esp_log.h" +#include "types.hpp" //TODO: move from ledc to mcpwm? //https://docs.espressif.com/projects/esp-idf/en/v4.3/esp32/api-reference/peripherals/mcpwm.html# @@ -10,6 +12,8 @@ //tag for logging static const char * TAG = "motordriver"; +//ms to wait in IDLE before BRAKE until relay actually switched +#define BRAKE_RELAY_DELAY_MS 300 //==================================== @@ -61,11 +65,13 @@ void single100a::init(){ gpio_set_direction(config.gpio_a, GPIO_MODE_OUTPUT); gpio_pad_select_gpio(config.gpio_b); gpio_set_direction(config.gpio_b, GPIO_MODE_OUTPUT); + gpio_pad_select_gpio(config.gpio_brakeRelay); + gpio_set_direction(config.gpio_brakeRelay, GPIO_MODE_OUTPUT); //--- calculate max duty according to selected resolution --- dutyMax = pow(2, ledc_timer.duty_resolution) -1; - ESP_LOGI(TAG, "initialized single100a driver"); - ESP_LOGI(TAG, "resolution=%dbit, dutyMax value=%d, resolution=%.4f %%", ledc_timer.duty_resolution, dutyMax, 100/(float)dutyMax); + ESP_LOGW(TAG, "initialized single100a driver"); + ESP_LOGW(TAG, "resolution=%dbit, dutyMax value=%d, resolution=%.4f %%", ledc_timer.duty_resolution, dutyMax, 100/(float)dutyMax); } @@ -88,7 +94,16 @@ void single100a::set(motorstate_t state_f, float duty_f){ dutyScaled = duty_f / 100 * dutyMax; } + //TODO: only when previous mode was BRAKE? + if (state_f != motorstate_t::BRAKE){ + //reset brake wait state + brakeWaitingForRelay = false; + //turn of brake relay + gpio_set_level(config.gpio_brakeRelay, 0); + } + //put the single100a h-bridge module in the desired state update duty-cycle + //TODO maybe outsource mode code from once switch case? e.g. idle() brake()... switch (state_f){ case motorstate_t::IDLE: ledc_set_duty(LEDC_HIGH_SPEED_MODE, config.ledc_channel, dutyScaled); @@ -100,13 +115,37 @@ void single100a::set(motorstate_t state_f, float duty_f){ gpio_set_level(config.gpio_a, config.aEnabledPinState); gpio_set_level(config.gpio_b, config.bEnabledPinState); break; - case motorstate_t::BRAKE: - ledc_set_duty(LEDC_HIGH_SPEED_MODE, config.ledc_channel, 0); - ledc_update_duty(LEDC_HIGH_SPEED_MODE, config.ledc_channel); - //brake: - gpio_set_level(config.gpio_a, !config.aEnabledPinState); - gpio_set_level(config.gpio_b, !config.bEnabledPinState); - break; + + case motorstate_t::BRAKE: + //prevent full short (no brake resistors) due to slow relay, also reduces switching load + if (!brakeWaitingForRelay){ + ESP_LOGW(TAG, "BRAKE: turned on relay, waiting in IDLE for %d ms", BRAKE_RELAY_DELAY_MS); + //switch driver to IDLE for now + gpio_set_level(config.gpio_a, config.aEnabledPinState); + gpio_set_level(config.gpio_b, config.bEnabledPinState); + //start brake relay + gpio_set_level(config.gpio_brakeRelay, 1); + timestamp_brakeRelayPowered = esp_log_timestamp(); + brakeWaitingForRelay = true; + } + //check if delay for relay to switch has passed + else if ((esp_log_timestamp() - timestamp_brakeRelayPowered) > BRAKE_RELAY_DELAY_MS) { + ESP_LOGD(TAG, "applying brake with brake-resistors at duty=%.2f%%", duty_f); + //switch driver to BRAKE + gpio_set_level(config.gpio_a, !config.aEnabledPinState); + gpio_set_level(config.gpio_b, !config.bEnabledPinState); + //apply duty + //FIXME switch between BREAK and IDLE with PWM and ignore pwm-pin? (needs test) + ledc_set_duty(LEDC_HIGH_SPEED_MODE, config.ledc_channel, dutyScaled); + ledc_update_duty(LEDC_HIGH_SPEED_MODE, config.ledc_channel); + } else { + //waiting... stay in IDLE + ESP_LOGD(TAG, "waiting for brake relay to close (IDLE)..."); + gpio_set_level(config.gpio_a, config.aEnabledPinState); + gpio_set_level(config.gpio_b, config.bEnabledPinState); + } + break; + case motorstate_t::FWD: ledc_set_duty(LEDC_HIGH_SPEED_MODE, config.ledc_channel, dutyScaled); ledc_update_duty(LEDC_HIGH_SPEED_MODE, config.ledc_channel); @@ -114,6 +153,7 @@ void single100a::set(motorstate_t state_f, float duty_f){ gpio_set_level(config.gpio_a, config.aEnabledPinState); gpio_set_level(config.gpio_b, !config.bEnabledPinState); break; + case motorstate_t::REV: ledc_set_duty(LEDC_HIGH_SPEED_MODE, config.ledc_channel, dutyScaled); ledc_update_duty(LEDC_HIGH_SPEED_MODE, config.ledc_channel); @@ -122,5 +162,5 @@ void single100a::set(motorstate_t state_f, float duty_f){ gpio_set_level(config.gpio_b, config.bEnabledPinState); break; } - ESP_LOGD(TAG, "set module to state=%s, duty=%d/%d, duty_input=%.3f%%", motorstateStr[(int)state_f], dutyScaled, dutyMax, duty_f); + ESP_LOGV(TAG, "set module to state=%s, duty=%d/%d, duty_input=%.3f%%", motorstateStr[(int)state_f], dutyScaled, dutyMax, duty_f); } diff --git a/board_motorctl/main/motordrivers.hpp b/board_motorctl/main/motordrivers.hpp index 0efd698..745cbf3 100644 --- a/board_motorctl/main/motordrivers.hpp +++ b/board_motorctl/main/motordrivers.hpp @@ -29,6 +29,7 @@ typedef struct single100a_config_t { gpio_num_t gpio_pwm; gpio_num_t gpio_a; gpio_num_t gpio_b; + gpio_num_t gpio_brakeRelay; ledc_timer_t ledc_timer; ledc_channel_t ledc_channel; bool aEnabledPinState; @@ -59,4 +60,6 @@ class single100a { single100a_config_t config; uint32_t dutyMax; motorstate_t state = motorstate_t::IDLE; + bool brakeWaitingForRelay = false; + uint32_t timestamp_brakeRelayPowered; }; From 3014808d5a9e0843c477c867c8cee66f9ebb8c76 Mon Sep 17 00:00:00 2001 From: jonny_jr9 Date: Mon, 4 Sep 2023 10:29:36 +0200 Subject: [PATCH 3/5] Add test for new brake feature Repeatedly apply sequence of pre-defined motor commands in main function --- board_motorctl/main/config.cpp | 19 ++++----------- board_motorctl/main/main.cpp | 42 +++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 15 deletions(-) diff --git a/board_motorctl/main/config.cpp b/board_motorctl/main/config.cpp index 2c1389e..3d57660 100644 --- a/board_motorctl/main/config.cpp +++ b/board_motorctl/main/config.cpp @@ -1,3 +1,4 @@ + #include "config.hpp" //=================================== @@ -25,8 +26,8 @@ single100a_config_t configDriverRight = { .gpio_brakeRelay = GPIO_NUM_18, //power mosfet 1 .ledc_timer = LEDC_TIMER_1, .ledc_channel = LEDC_CHANNEL_1, - .aEnabledPinState = false, //-> pin inverted (mosfet) - .bEnabledPinState = true, //-> not inverted (direct) + .aEnabledPinState = false, //-> pins inverted (mosfets) + .bEnabledPinState = false, .resolution = LEDC_TIMER_11_BIT, .pwmFreq = 10000 }; @@ -37,13 +38,8 @@ single100a_config_t configDriverRight = { motorctl_config_t configMotorControlLeft = { .msFadeAccel = 1900, //acceleration of the motor (ms it takes from 0% to 100%) .msFadeDecel = 1000, //deceleration of the motor (ms it takes from 100% to 0%) -<<<<<<< Updated upstream - .currentLimitEnabled = true, - .currentSensor_adc = ADC1_CHANNEL_0, //GPIO36 -======= .currentLimitEnabled = false, - .currentSensor_adc = ADC1_CHANNEL_6, //GPIO34 ->>>>>>> Stashed changes + .currentSensor_adc = ADC1_CHANNEL_0, //GPIO36 .currentSensor_ratedCurrent = 50, .currentMax = 30, .deadTimeMs = 900 //minimum time motor is off between direction change @@ -53,13 +49,8 @@ motorctl_config_t configMotorControlLeft = { motorctl_config_t configMotorControlRight = { .msFadeAccel = 1900, //acceleration of the motor (ms it takes from 0% to 100%) .msFadeDecel = 1000, //deceleration of the motor (ms it takes from 100% to 0%) -<<<<<<< Updated upstream - .currentLimitEnabled = true, - .currentSensor_adc = ADC1_CHANNEL_3, //GPIO39 -======= .currentLimitEnabled = false, - .currentSensor_adc = ADC1_CHANNEL_4, //GPIO32 ->>>>>>> Stashed changes + .currentSensor_adc = ADC1_CHANNEL_3, //GPIO39 .currentSensor_ratedCurrent = 50, .currentMax = 30, .deadTimeMs = 900 //minimum time motor is off between direction change diff --git a/board_motorctl/main/main.cpp b/board_motorctl/main/main.cpp index 71873b2..8a9e7ee 100644 --- a/board_motorctl/main/main.cpp +++ b/board_motorctl/main/main.cpp @@ -28,6 +28,9 @@ extern "C" //disables other functionality //#define UART_TEST_ONLY +//only run brake-test (ignore uart input) +#define BRAKE_TEST_ONLY + //tag for logging static const char * TAG = "main"; @@ -92,7 +95,7 @@ void setLoglevels(void){ //--- set loglevel for individual tags --- esp_log_level_set("main", ESP_LOG_INFO); esp_log_level_set("buzzer", ESP_LOG_ERROR); - //esp_log_level_set("motordriver", ESP_LOG_INFO); + esp_log_level_set("motordriver", ESP_LOG_DEBUG); //esp_log_level_set("motor-control", ESP_LOG_DEBUG); //esp_log_level_set("evaluatedJoystick", ESP_LOG_DEBUG); //esp_log_level_set("joystickCommands", ESP_LOG_DEBUG); @@ -150,15 +153,52 @@ extern "C" void app_main(void) { //------------------------------------------- //--- create tasks for uart communication --- //------------------------------------------- +#ifndef BRAKE_TEST_ONLY uart_init(); xTaskCreate(task_uartReceive, "task_uartReceive", 4096, NULL, 10, NULL); xTaskCreate(task_uartSend, "task_uartSend", 4096, NULL, 10, NULL); +#endif //--- main loop --- //does nothing except for testing things while(1){ + vTaskDelay(500 / portTICK_PERIOD_MS); +#ifdef BRAKE_TEST_ONLY + //test relays at standstill + ESP_LOGW("brake-test", "test relays via motorctl"); + //turn on + motorRight.setTarget(motorstate_t::BRAKE, 0); + vTaskDelay(500 / portTICK_PERIOD_MS); + motorRight.setTarget(motorstate_t::BRAKE, 0); + vTaskDelay(1000 / portTICK_PERIOD_MS); + //turn off + motorRight.setTarget(motorstate_t::IDLE, 0); + vTaskDelay(500 / portTICK_PERIOD_MS); + motorRight.setTarget(motorstate_t::IDLE, 0); + + vTaskDelay(1000 / portTICK_PERIOD_MS); + + //go forward and brake + ESP_LOGW("brake-test", "go forward 30%% then brake"); + motorRight.setTarget(motorstate_t::FWD, 30); + vTaskDelay(1000 / portTICK_PERIOD_MS); + motorRight.setTarget(motorstate_t::BRAKE, 0); + + vTaskDelay(3000 / portTICK_PERIOD_MS); + + //brake partial + ESP_LOGW("brake-test", "go forward 30%% then brake partial 10%%, hold for 5sec"); + motorRight.setTarget(motorstate_t::FWD, 30); + vTaskDelay(1000 / portTICK_PERIOD_MS); + motorRight.setTarget(motorstate_t::BRAKE, 10); + vTaskDelay(5000 / portTICK_PERIOD_MS); + //reset to idle + motorRight.setTarget(motorstate_t::IDLE, 0); + +#endif + //--- test controlledMotor --- (ramp) // //brake for 1 s From 8c7f05134cbdd6b643cc305184a79fac98c67e87 Mon Sep 17 00:00:00 2001 From: jonny_jr9 Date: Tue, 5 Sep 2023 09:46:53 +0200 Subject: [PATCH 4/5] Fix Bug brake not working at all BRAKE state was not possible with previous state now IDLE is not forced when duty 0 Also adjust some logging --- board_motorctl/main/main.cpp | 4 ++-- board_motorctl/main/motorctl.cpp | 28 ++++++++++++++++------------ board_motorctl/main/motordrivers.cpp | 7 ++++--- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/board_motorctl/main/main.cpp b/board_motorctl/main/main.cpp index 8a9e7ee..8bd1dc9 100644 --- a/board_motorctl/main/main.cpp +++ b/board_motorctl/main/main.cpp @@ -95,8 +95,8 @@ void setLoglevels(void){ //--- set loglevel for individual tags --- esp_log_level_set("main", ESP_LOG_INFO); esp_log_level_set("buzzer", ESP_LOG_ERROR); - esp_log_level_set("motordriver", ESP_LOG_DEBUG); - //esp_log_level_set("motor-control", ESP_LOG_DEBUG); + esp_log_level_set("motordriver", ESP_LOG_VERBOSE); + esp_log_level_set("motor-control", ESP_LOG_INFO); //esp_log_level_set("evaluatedJoystick", ESP_LOG_DEBUG); //esp_log_level_set("joystickCommands", ESP_LOG_DEBUG); esp_log_level_set("button", ESP_LOG_INFO); diff --git a/board_motorctl/main/motorctl.cpp b/board_motorctl/main/motorctl.cpp index f2baac5..b560ad4 100644 --- a/board_motorctl/main/motorctl.cpp +++ b/board_motorctl/main/motorctl.cpp @@ -5,6 +5,7 @@ //tag for logging static const char * TAG = "motor-control"; +#define TIMEOUT_IDLE_WHEN_NO_COMMAND 8000 //============================= //======== constructor ======== @@ -79,7 +80,7 @@ void controlledMotor::handle(){ //--- receive commands from queue --- if( xQueueReceive( commandQueue, &commandReceive, ( TickType_t ) 0 ) ) { - ESP_LOGD(TAG, "Read command from queue: state=%s, duty=%.2f", motorstateStr[(int)commandReceive.state], commandReceive.duty); + ESP_LOGI(TAG, "Read command from queue: state=%s, duty=%.2f", motorstateStr[(int)commandReceive.state], commandReceive.duty); state = commandReceive.state; dutyTarget = commandReceive.duty; receiveTimeout = false; @@ -92,7 +93,8 @@ void controlledMotor::handle(){ case motorstate_t::BRAKE: //update state state = motorstate_t::BRAKE; - dutyTarget = 0; + //dutyTarget = 0; + dutyTarget = fabs(commandReceive.duty); break; case motorstate_t::IDLE: dutyTarget = 0; @@ -108,11 +110,12 @@ void controlledMotor::handle(){ //--- timeout, no data --- //turn motors off if no data received for long time (e.g. no uart data / control offline) - if ((esp_log_timestamp() - timestamp_commandReceived) > 3000 && !receiveTimeout){ + //TODO no timeout when braking? + if ((esp_log_timestamp() - timestamp_commandReceived) > TIMEOUT_IDLE_WHEN_NO_COMMAND && !receiveTimeout){ receiveTimeout = true; state = motorstate_t::IDLE; dutyTarget = 0; - ESP_LOGE(TAG, "TIMEOUT, no target data received for more than 3s -> switch to IDLE"); + ESP_LOGE(TAG, "TIMEOUT, no target data received for more than %ds -> switch to IDLE", TIMEOUT_IDLE_WHEN_NO_COMMAND/1000); } //--- calculate increment --- @@ -131,14 +134,15 @@ void controlledMotor::handle(){ dutyIncrementDecel = 100; } - - //--- BRAKE --- - //brake immediately, update state, duty and exit this cycle of handle function - if (state == motorstate_t::BRAKE){ - motor.set(motorstate_t::BRAKE, 0); - dutyNow = 0; - return; //no need to run the fade algorithm - } + + //--- BRAKE --- + //brake immediately, update state, duty and exit this cycle of handle function + if (state == motorstate_t::BRAKE){ + ESP_LOGD(TAG, "braking - skip fading"); + motor.set(motorstate_t::BRAKE, dutyTarget); + //dutyNow = 0; + return; //no need to run the fade algorithm + } //--- calculate difference --- diff --git a/board_motorctl/main/motordrivers.cpp b/board_motorctl/main/motordrivers.cpp index 41a17bb..580db57 100644 --- a/board_motorctl/main/motordrivers.cpp +++ b/board_motorctl/main/motordrivers.cpp @@ -86,7 +86,7 @@ void single100a::set(motorstate_t state_f, float duty_f){ uint32_t dutyScaled; if (duty_f > 100) { //target duty above 100% dutyScaled = dutyMax; - } else if (duty_f <= 0) { //target at or below 0% + } else if (duty_f < 0) { //target at or below 0% state_f = motorstate_t::IDLE; dutyScaled = 0; } else { //target duty 0-100% @@ -94,6 +94,8 @@ void single100a::set(motorstate_t state_f, float duty_f){ dutyScaled = duty_f / 100 * dutyMax; } + ESP_LOGV(TAG, "target-state=%s, duty=%d/%d, duty_input=%.3f%%", motorstateStr[(int)state_f], dutyScaled, dutyMax, duty_f); + //TODO: only when previous mode was BRAKE? if (state_f != motorstate_t::BRAKE){ //reset brake wait state @@ -119,7 +121,7 @@ void single100a::set(motorstate_t state_f, float duty_f){ case motorstate_t::BRAKE: //prevent full short (no brake resistors) due to slow relay, also reduces switching load if (!brakeWaitingForRelay){ - ESP_LOGW(TAG, "BRAKE: turned on relay, waiting in IDLE for %d ms", BRAKE_RELAY_DELAY_MS); + ESP_LOGW(TAG, "BRAKE: turned on relay, waiting in IDLE for %d ms, then apply brake", BRAKE_RELAY_DELAY_MS); //switch driver to IDLE for now gpio_set_level(config.gpio_a, config.aEnabledPinState); gpio_set_level(config.gpio_b, config.bEnabledPinState); @@ -162,5 +164,4 @@ void single100a::set(motorstate_t state_f, float duty_f){ gpio_set_level(config.gpio_b, config.bEnabledPinState); break; } - ESP_LOGV(TAG, "set module to state=%s, duty=%d/%d, duty_input=%.3f%%", motorstateStr[(int)state_f], dutyScaled, dutyMax, duty_f); } From 57acaa00809829cc6055ef132808bde6233d3b75 Mon Sep 17 00:00:00 2001 From: jonny_jr9 Date: Tue, 5 Sep 2023 21:51:43 +0200 Subject: [PATCH 5/5] Disable brake-test --- board_motorctl/main/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/board_motorctl/main/main.cpp b/board_motorctl/main/main.cpp index 8bd1dc9..4b527c3 100644 --- a/board_motorctl/main/main.cpp +++ b/board_motorctl/main/main.cpp @@ -28,6 +28,9 @@ extern "C" //disables other functionality //#define UART_TEST_ONLY +//========================== +//======= BRAKE TEST ======= +//========================== //only run brake-test (ignore uart input) #define BRAKE_TEST_ONLY @@ -36,7 +39,6 @@ extern "C" static const char * TAG = "main"; - #ifndef UART_TEST_ONLY //==================================== //========== motorctl task ===========