add hoverbrett define for calibration and control defines

This commit is contained in:
interfisch 2019-12-28 14:03:02 +01:00
parent a2997d757b
commit 209f89e727
1 changed files with 33 additions and 3 deletions

View File

@ -2,8 +2,9 @@
#include "stm32f1xx_hal.h" #include "stm32f1xx_hal.h"
//Select the calibration values for the different pcbs //Select the calibration values for the different pcbs
#define BOBBYCAR_PCB_FRONT //Green PCB //#define BOBBYCAR_PCB_FRONT //Green PCB
//#define BOBBYCAR_PCB_REAR //Blue PCB //#define BOBBYCAR_PCB_REAR //Blue PCB
#define HOVERBRETT //Green PCB in Hoverbrett
// ############################### DO-NOT-TOUCH SETTINGS ############################### // ############################### DO-NOT-TOUCH SETTINGS ###############################
@ -55,6 +56,10 @@
#define BAT_CALIB_REAL_VOLTAGE 4000 // input voltage measured by multimeter (multiplied by 100). In this case 40.00 V * 100 = 4300 #define BAT_CALIB_REAL_VOLTAGE 4000 // input voltage measured by multimeter (multiplied by 100). In this case 40.00 V * 100 = 4300
#define BAT_CALIB_ADC 1580 // adc-value measured by mainboard (value nr 5 on UART debug output) #define BAT_CALIB_ADC 1580 // adc-value measured by mainboard (value nr 5 on UART debug output)
#endif #endif
#ifdef HOVERBRETT
#define BAT_CALIB_REAL_VOLTAGE 4300 // input voltage measured by multimeter (multiplied by 100). In this case 40.00 V * 100 = 4300
#define BAT_CALIB_ADC 1704 // adc-value measured by mainboard (value nr 5 on UART debug output)
#endif
#define BAT_CELLS 10 // battery number of cells. Normal Hoverboard battery: 10s #define BAT_CELLS 10 // battery number of cells. Normal Hoverboard battery: 10s
#define BAT_LOW_LVL1_ENABLE 0 // to beep or not to beep, 1 or 0 #define BAT_LOW_LVL1_ENABLE 0 // to beep or not to beep, 1 or 0
@ -86,6 +91,13 @@
#define TEMP_CAL_HIGH_ADC 1580 // temperature 2: ADC value #define TEMP_CAL_HIGH_ADC 1580 // temperature 2: ADC value
#define TEMP_CAL_HIGH_DEG_C 500 // temperature 2: measured temperature [°C * 10]. Here °C #define TEMP_CAL_HIGH_DEG_C 500 // temperature 2: measured temperature [°C * 10]. Here °C
#endif #endif
#ifdef HOVERBRETT
//Hoverbrett
#define TEMP_CAL_LOW_ADC 1716 // temperature 1: ADC value
#define TEMP_CAL_LOW_DEG_C 210 // temperature 1: measured temperature [°C * 10]. Here 22.0 °C
#define TEMP_CAL_HIGH_ADC 1600 // temperature 2: ADC value
#define TEMP_CAL_HIGH_DEG_C 420 // temperature 2: measured temperature [°C * 10]. Here °C
#endif
#define TEMP_WARNING_ENABLE 1 // to beep or not to beep, 1 or 0, DO NOT ACTIVITE WITHOUT CALIBRATION! #define TEMP_WARNING_ENABLE 1 // to beep or not to beep, 1 or 0, DO NOT ACTIVITE WITHOUT CALIBRATION!
#define TEMP_WARNING 600 // annoying fast beeps [°C * 10]. Here 60.0 °C #define TEMP_WARNING 600 // annoying fast beeps [°C * 10]. Here 60.0 °C
@ -119,10 +131,24 @@
#define USART3_BAUD 38400 // UART3 baud rate (short wired cable) #define USART3_BAUD 38400 // UART3 baud rate (short wired cable)
#define USART3_WORDLENGTH UART_WORDLENGTH_8B // UART_WORDLENGTH_8B or UART_WORDLENGTH_9B #define USART3_WORDLENGTH UART_WORDLENGTH_8B // UART_WORDLENGTH_8B or UART_WORDLENGTH_9B
#define CONTROL_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuck or lcd) is used! For Arduino control check the hoverSerial.ino //#define CONTROL_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuck or lcd) is used! For Arduino control check the hoverSerial.ino
#define FEEDBACK_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuck or lcd) is used! //#define FEEDBACK_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuck or lcd) is used!
//#define DEBUG_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuck or lcd) is used! //#define DEBUG_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuck or lcd) is used!
// ## Select control type ##
#ifdef BOBBYCAR_PCB_FRONT
#define CONTROL_SERIAL_USART3
#define FEEDBACK_SERIAL_USART3
#endif
#ifdef BOBBYCAR_PCB_REAR
#define CONTROL_SERIAL_USART3
#define FEEDBACK_SERIAL_USART3
#endif
#ifdef HOVERBRETT
#define CONTROL_SERIAL_USART2
#define FEEDBACK_SERIAL_USART2
#endif
#if defined(FEEDBACK_SERIAL_USART2) || defined(DEBUG_SERIAL_USART2) #if defined(FEEDBACK_SERIAL_USART2) || defined(DEBUG_SERIAL_USART2)
#define UART_DMA_CHANNEL DMA1_Channel7 #define UART_DMA_CHANNEL DMA1_Channel7
#endif #endif
@ -234,6 +260,10 @@
//#define INVERT_R_DIRECTION //#define INVERT_R_DIRECTION
//#define INVERT_L_DIRECTION //#define INVERT_L_DIRECTION
#endif #endif
#ifdef HOVERBRETT
#define INVERT_R_DIRECTION
#define INVERT_L_DIRECTION
#endif
#define BEEPS_BACKWARD 0 // 0 or 1 #define BEEPS_BACKWARD 0 // 0 or 1