@ -135,8 +135,8 @@
# define TRQ_MODE 3 // [-] TORQUE mode
# define TRQ_MODE 3 // [-] TORQUE mode
// Enable/Disable Motor
// Enable/Disable Motor
# define MOTOR_LEFT_ENA // [-] Enable LEFT motor. Comment-out if this motor is not needed to be operational
//#define MOTOR_LEFT_ENA // [-] Enable LEFT motor. Comment-out if this motor is not needed to be operational
# define MOTOR_RIGHT_ENA // [-] Enable RIGHT motor. Comment-out if this motor is not needed to be operational
//#define MOTOR_RIGHT_ENA // [-] Enable RIGHT motor. Comment-out if this motor is not needed to be operational
// Control selections
// Control selections
# define CTRL_TYP_SEL FOC_CTRL // [-] Control type selection: COM_CTRL, SIN_CTRL, FOC_CTRL (default)
# define CTRL_TYP_SEL FOC_CTRL // [-] Control type selection: COM_CTRL, SIN_CTRL, FOC_CTRL (default)
@ -251,16 +251,16 @@
* Make , flash and test it .
* Make , flash and test it .
*/
*/
# 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_TIMEOUT 100 // ADC Protection: number of wrong / missing input commands before safety state is taken
# define ADC_PROTECT_TIMEOUT 100 // ADC Protection: number of wrong / missing input commands before safety state is taken
# define ADC_PROTECT_THRESH 300 // ADC Protection threshold below/above the MIN/MAX ADC values
# define ADC_PROTECT_THRESH 300 // ADC Protection threshold below/above the MIN/MAX ADC values
# define INPUT1_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT1_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT1_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT1_MID_POT // ADC1 middle resting poti: comment-out if NOT a middle resting poti
# define INPUT1_MIN 0 // min ADC1-value while poti at minimum-position (0 - 4095)
# define INPUT1_MIN 0 // min ADC1-value while poti at minimum-position (0 - 4095)
# define INPUT1_MID 2048 // mid ADC1-value while poti at minimum-position (ADC1_MIN - ADC1_MAX)
# define INPUT1_MID 2048 // mid ADC1-value while poti at minimum-position (ADC1_MIN - ADC1_MAX)
# define INPUT1_MAX 4095 // max ADC1-value while poti at maximum-position (0 - 4095)
# define INPUT1_MAX 4095 // max ADC1-value while poti at maximum-position (0 - 4095)
# define INPUT2_MID_POT // ADC2 middle resting poti: comment-out if NOT a middle resting poti
# define INPUT2_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT2_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_MIN 0 // min ADC2-value while poti at minimum-position (0 - 4095)
# define INPUT2_MIN 0 // min ADC2-value while poti at minimum-position (0 - 4095)
# define INPUT2_MID 2048 // mid ADC2-value while poti at minimum-position (ADC2_MIN - ADC2_MAX)
# define INPUT2_MID 2048 // mid ADC2-value while poti at minimum-position (ADC2_MIN - ADC2_MAX)
# define INPUT2_MAX 4095 // max ADC2-value while poti at maximum-position (0 - 4095)
# define INPUT2_MAX 4095 // max ADC2-value while poti at maximum-position (0 - 4095)
@ -280,14 +280,15 @@
// #define SIDEBOARD_SERIAL_USART3
// #define SIDEBOARD_SERIAL_USART3
# define CONTROL_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuk or lcd) is used! For Arduino control check the hoverSerial.ino
# define CONTROL_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuk or lcd) is used! For Arduino control check the hoverSerial.ino
# define FEEDBACK_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuk or lcd) is used!
# define FEEDBACK_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuk or lcd) is used!
# define INPUT1_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
// Min / Max values of each channel (use DEBUG to determine these values)
// Min / Max values of each channel (use DEBUG to determine these values)
# define INPUT1_MID_POT
# define INPUT1_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT1_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT1_MIN -1000 // (-1000 - 0)
# define INPUT1_MIN -1000 // (-1000 - 0)
# define INPUT1_MID 0
# define INPUT1_MID 0
# define INPUT1_MAX 1000 // (0 - 1000)
# define INPUT1_MAX 1000 // (0 - 1000)
# define INPUT2_MID_POT
# define INPUT2_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT2_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_MIN -1000 // (-1000 - 0)
# define INPUT2_MIN -1000 // (-1000 - 0)
# define INPUT2_MID 0
# define INPUT2_MID 0
# define INPUT2_MAX 1000 // (0 - 1000)
# define INPUT2_MAX 1000 // (0 - 1000)
@ -307,14 +308,15 @@
* Recommendation : Nunchuk Breakout Board https : //github.com/Jan--Henrik/hoverboard-breakout
* Recommendation : Nunchuk Breakout Board https : //github.com/Jan--Henrik/hoverboard-breakout
*/
*/
# define CONTROL_NUNCHUK // use nunchuk as input. disable FEEDBACK_SERIAL_USART3, DEBUG_SERIAL_USART3!
# define CONTROL_NUNCHUK // use nunchuk as input. disable FEEDBACK_SERIAL_USART3, DEBUG_SERIAL_USART3!
# define INPUT1_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
// Min / Max values of each channel (use DEBUG to determine these values)
// Min / Max values of each channel (use DEBUG to determine these values)
# define INPUT1_MID_POT
# define INPUT1_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT1_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT1_MIN -1024 // (-1024 - 0)
# define INPUT1_MIN -1024 // (-1024 - 0)
# define INPUT1_MID 0
# define INPUT1_MID 0
# define INPUT1_MAX 1024 // (0 - 1024)
# define INPUT1_MAX 1024 // (0 - 1024)
# define INPUT2_MID_POT
# define INPUT2_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT2_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_MIN -1024 // (-1024 - 0)
# define INPUT2_MIN -1024 // (-1024 - 0)
# define INPUT2_MID 0
# define INPUT2_MID 0
# define INPUT2_MAX 1024 // (0 - 1024)
# define INPUT2_MAX 1024 // (0 - 1024)
@ -342,14 +344,15 @@
# define DEBUG_SERIAL_USART3 // right sensor cable debug
# define DEBUG_SERIAL_USART3 // right sensor cable debug
# endif
# endif
# define PPM_NUM_CHANNELS 6 // total number of PPM channels to receive, even if they are not used.
# define PPM_NUM_CHANNELS 6 // total number of PPM channels to receive, even if they are not used.
# define INPUT1_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
// Min / Max values of each channel (use DEBUG to determine these values)
// Min / Max values of each channel (use DEBUG to determine these values)
# define INPUT1_MID_POT
# define INPUT1_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT1_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT1_MIN -1000 // (-1000 - 0)
# define INPUT1_MIN -1000 // (-1000 - 0)
# define INPUT1_MID 0
# define INPUT1_MID 0
# define INPUT1_MAX 1000 // (0 - 1000)
# define INPUT1_MAX 1000 // (0 - 1000)
# define INPUT2_MID_POT
# define INPUT2_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT2_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_MIN -1000 // (-1000 - 0)
# define INPUT2_MIN -1000 // (-1000 - 0)
# define INPUT2_MID 0
# define INPUT2_MID 0
# define INPUT2_MAX 1000 // (0 - 1000)
# define INPUT2_MAX 1000 // (0 - 1000)
@ -368,17 +371,19 @@
*/
*/
# define CONTROL_PWM_LEFT // use RC PWM as input on the LEFT cable. disable DEBUG_SERIAL_USART2!
# define CONTROL_PWM_LEFT // use RC PWM as input on the LEFT cable. disable DEBUG_SERIAL_USART2!
// #define CONTROL_PWM_RIGHT // use RC PWM as input on the RIGHT cable. disable DEBUG_SERIAL_USART3!
// #define CONTROL_PWM_RIGHT // use RC PWM as input on the RIGHT cable. disable DEBUG_SERIAL_USART3!
# define INPUT1_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
// Min / Max values of each channel (use DEBUG to determine these values)
// Min / Max values of each channel (use DEBUG to determine these values)
# define INPUT1_MID_POT
# define INPUT1_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT1_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT1_MIN -1000 // (-1000 - 0)
# define INPUT1_MIN -1000 // (-1000 - 0)
# define INPUT1_MID 0
# define INPUT1_MID 0
# define INPUT1_MAX 1000 // (0 - 1000)
# define INPUT1_MAX 1000 // (0 - 1000)
# define INPUT2_MID_POT
# define INPUT2_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT2_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_MIN -1000 // (-1000 - 0)
# define INPUT2_MIN -1000 // (-1000 - 0)
# define INPUT2_MID 0
# define INPUT2_MID 0
# define INPUT2_MAX 1000 // (0 - 1000)
# define INPUT2_MAX 1000 // (0 - 1000)
# define FILTER 6553 // 0.1f [-] fixdt(0,16,16) lower value == softer filter [0, 65535] = [0.0 - 1.0].
# define FILTER 6553 // 0.1f [-] fixdt(0,16,16) lower value == softer filter [0, 65535] = [0.0 - 1.0].
# define SPEED_COEFFICIENT 16384 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14
# define SPEED_COEFFICIENT 16384 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14
# define STEER_COEFFICIENT 16384 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14. If you do not want any steering, set it to 0.
# define STEER_COEFFICIENT 16384 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14. If you do not want any steering, set it to 0.
@ -406,14 +411,15 @@
# define IBUS_LENGTH 0x20
# define IBUS_LENGTH 0x20
# define IBUS_COMMAND 0x40
# define IBUS_COMMAND 0x40
# define INPUT1_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
// Min / Max values of each channel (use DEBUG to determine these values)
// Min / Max values of each channel (use DEBUG to determine these values)
# define INPUT1_MID_POT
# define INPUT1_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT1_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT1_MIN -1000 // (-1000 - 0)
# define INPUT1_MIN -1000 // (-1000 - 0)
# define INPUT1_MID 0
# define INPUT1_MID 0
# define INPUT1_MAX 1000 // (0 - 1000)
# define INPUT1_MAX 1000 // (0 - 1000)
# define INPUT2_MID_POT
# define INPUT2_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT2_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_MIN -1000 // (-1000 - 0)
# define INPUT2_MIN -1000 // (-1000 - 0)
# define INPUT2_MID 0
# define INPUT2_MID 0
# define INPUT2_MAX 1000 // (0 - 1000)
# define INPUT2_MAX 1000 // (0 - 1000)
@ -432,13 +438,21 @@
# undef CTRL_MOD_REQ
# undef CTRL_MOD_REQ
# define CTRL_MOD_REQ TRQ_MODE // HOVERCAR works best in TORQUE Mode
# define CTRL_MOD_REQ TRQ_MODE // 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_TIMEOUT 100 // ADC Protection: number of wrong / missing input commands before safety state is taken
# define ADC_PROTECT_TIMEOUT 100 // ADC Protection: number of wrong / missing input commands before safety state is taken
# define ADC_PROTECT_THRESH 300 // ADC Protection threshold below/above the MIN/MAX ADC values
# define ADC_PROTECT_THRESH 300 // ADC Protection threshold below/above the MIN/MAX ADC values
# define INPUT1_TYPE 1 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT1_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT1_MIN 1000 // min ADC1-value while poti at minimum-position (0 - 4095)
# define INPUT1_MIN 1000 // min ADC1-value while poti at minimum-position (0 - 4095)
# define INPUT1_MID 0
# define INPUT1_MAX 2500 // max ADC1-value while poti at maximum-position (0 - 4095)
# define INPUT1_MAX 2500 // max ADC1-value while poti at maximum-position (0 - 4095)
# define INPUT2_TYPE 1 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT2_DEADBAND 0 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_MIN 500 // min ADC2-value while poti at minimum-position (0 - 4095)
# define INPUT2_MIN 500 // min ADC2-value while poti at minimum-position (0 - 4095)
# define INPUT2_MID 0
# define INPUT2_MAX 2200 // max ADC2-value while poti at maximum-position (0 - 4095)
# define INPUT2_MAX 2200 // max ADC2-value while poti at maximum-position (0 - 4095)
# define SPEED_COEFFICIENT 16384 // 1.0f
# define SPEED_COEFFICIENT 16384 // 1.0f
# define STEER_COEFFICIENT 0 // 0.0f
# define STEER_COEFFICIENT 0 // 0.0f
// #define INVERT_R_DIRECTION // Invert rotation of right motor
// #define INVERT_R_DIRECTION // Invert rotation of right motor
@ -505,18 +519,21 @@
# define CTRL_MOD_REQ TRQ_MODE // SKATEBOARD works best in TORQUE Mode
# define CTRL_MOD_REQ TRQ_MODE // SKATEBOARD works best in TORQUE Mode
//#define CONTROL_PWM_LEFT // use RC PWM as input on the LEFT cable. disable DEBUG_SERIAL_USART2!
//#define CONTROL_PWM_LEFT // use RC PWM as input on the LEFT cable. disable DEBUG_SERIAL_USART2!
# define CONTROL_PWM_RIGHT // use RC PWM as input on the RIGHT cable. disable DEBUG_SERIAL_USART3!
# define CONTROL_PWM_RIGHT // use RC PWM as input on the RIGHT cable. disable DEBUG_SERIAL_USART3!
# define INPUT1_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
// Min / Max values of each channel (use DEBUG to determine these values)
// Min / Max values of each channel (use DEBUG to determine these values)
# define INPUT1_MID_POT
# define INPUT1_TYPE 0 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT1_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT1_MIN -1000 // (-1000 - 0)
# define INPUT1_MIN -1000 // (-1000 - 0)
# define INPUT1_MID 0
# define INPUT1_MID 0
# define INPUT1_MAX 1000 // (0 - 1000)
# define INPUT1_MAX 1000 // (0 - 1000)
# define INPUT2_MID_POT
# define INPUT2_TYPE 2 // 0:Disabled 1:Normal POT 2:Middle Resting Pot
# define INPUT2_DEADBAND 100 // How much of the center position is considered 'center' (100 = values -100 to 100 are considered 0)
# define INPUT2_MIN -800 // (-1000 - 0)
# define INPUT2_MIN -800 // (-1000 - 0)
# define INPUT2_MID 0
# define INPUT2_MID 0
# define INPUT2_MAX 700 // (0 - 1000)
# define INPUT2_MAX 700 // (0 - 1000)
# define INPUT2_OUT_MIN -400 // (-1000 - 0) Change this value to adjust the braking amount
# define INPUT2_OUT_MIN -400 // (-1000 - 0) Change this value to adjust the braking amount
# define FILTER 6553 // 0.1f [-] fixdt(0,16,16) lower value == softer filter [0, 65535] = [0.0 - 1.0].
# define FILTER 6553 // 0.1f [-] fixdt(0,16,16) lower value == softer filter [0, 65535] = [0.0 - 1.0].
# define SPEED_COEFFICIENT 16384 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14
# define SPEED_COEFFICIENT 16384 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14
# define STEER_COEFFICIENT 0 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14. If you do not want any steering, set it to 0.
# define STEER_COEFFICIENT 0 // 1.0f [-] fixdt(1,16,14) higher value == stronger. [0, 65535] = [-2.0 - 2.0]. In this case 16384 = 1.0 * 2^14. If you do not want any steering, set it to 0.