Hovercar minor update

- put by default TORQUE mode. Hovercar works best in Torque mode
- made the brake pedal more aggressive. Gives a better braking feel.
This commit is contained in:
EmanuelFeru 2020-03-17 15:38:35 +01:00
parent 3fd6c057ea
commit 9d6cec8889
2 changed files with 4 additions and 2 deletions

View File

@ -298,6 +298,8 @@
// ############################ VARIANT_HOVERCAR SETTINGS ############################ // ############################ VARIANT_HOVERCAR SETTINGS ############################
#ifdef VARIANT_HOVERCAR #ifdef VARIANT_HOVERCAR
#undef CTRL_MOD_REQ
#define CTRL_MOD_REQ 3 // HOVERCAR works best in TORQUE Mode
#define CONTROL_ADC // use ADC as input. disable CONTROL_SERIAL_USART2, FEEDBACK_SERIAL_USART2, DEBUG_SERIAL_USART2! #define CONTROL_ADC // use ADC as input. disable CONTROL_SERIAL_USART2, FEEDBACK_SERIAL_USART2, DEBUG_SERIAL_USART2!
#define ADC_PROTECT_ENA // ADC Protection Enable flag. Use this flag to make sure the ADC is protected when GND or Vcc wire is disconnected #define ADC_PROTECT_ENA // ADC Protection Enable flag. Use this flag to make sure the ADC is protected when GND or Vcc wire is disconnected
#define ADC_PROTECT_TIMEOUT 30 // ADC Protection: number of wrong / missing input commands before safety state is taken #define ADC_PROTECT_TIMEOUT 30 // ADC Protection: number of wrong / missing input commands before safety state is taken

View File

@ -205,10 +205,10 @@ int main(void) {
#ifdef VARIANT_HOVERCAR #ifdef VARIANT_HOVERCAR
// Calculate speed Blend, a number between [0, 1] in fixdt(0,16,15) // Calculate speed Blend, a number between [0, 1] in fixdt(0,16,15)
uint16_t speedBlend; uint16_t speedBlend;
speedBlend = (uint16_t)(((CLAMP(speedAvgAbs,30,90) - 30) << 15) / 60); // speedBlend [0,1] is within [30 rpm, 90rpm] speedBlend = (uint16_t)(((CLAMP(speedAvgAbs,10,60) - 10) << 15) / 50); // speedBlend [0,1] is within [10 rpm, 60rpm]
// Check if Hovercar is physically close to standstill to enable Double tap detection on Brake pedal for Reverse functionality // Check if Hovercar is physically close to standstill to enable Double tap detection on Brake pedal for Reverse functionality
if (speedAvgAbs < 20) { if (speedAvgAbs < 60) {
multipleTapDet(cmd1, HAL_GetTick(), &MultipleTapBreak); // Break pedal in this case is "cmd1" variable multipleTapDet(cmd1, HAL_GetTick(), &MultipleTapBreak); // Break pedal in this case is "cmd1" variable
} }