all for travis
This commit is contained in:
parent
af3309f01b
commit
c49bbdeacd
|
@ -44,9 +44,7 @@ jobs:
|
||||||
before_script: arm-none-eabi-gcc --version
|
before_script: arm-none-eabi-gcc --version
|
||||||
|
|
||||||
- name: platformio
|
- name: platformio
|
||||||
script: platformio run -e VARIANT_ADC -e VARIANT_USART3 -e VARIANT_HOVERCAR -e VARIANT_TRANSPOTTER -e VARIANT_NUNCHUCK -e VARIANT_PPM
|
script: platformio run
|
||||||
env:
|
|
||||||
- PLATFORMIO_DEFAULT_ENVS=VARIANT_ADC
|
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
|
|
|
@ -145,7 +145,7 @@
|
||||||
// ###### CONTROL VIA RC REMOTE ######
|
// ###### CONTROL VIA RC REMOTE ######
|
||||||
// left sensor board cable. Channel 1: steering, Channel 2: speed.
|
// left sensor board cable. Channel 1: steering, Channel 2: speed.
|
||||||
#define CONTROL_PPM // use PPM-Sum as input. disable CONTROL_SERIAL_USART2!
|
#define CONTROL_PPM // use PPM-Sum as input. disable CONTROL_SERIAL_USART2!
|
||||||
//#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.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ###### CONTROL VIA TWO POTENTIOMETERS ######
|
// ###### CONTROL VIA TWO POTENTIOMETERS ######
|
||||||
|
@ -318,7 +318,7 @@
|
||||||
// ############################### VALIDATE SETTINGS ###############################
|
// ############################### VALIDATE SETTINGS ###############################
|
||||||
|
|
||||||
#if !defined(VARIANT_ADC) && !defined(VARIANT_USART3) && !defined(VARIANT_HOVERCAR) && !defined(VARIANT_TRANSPOTTER) && !defined(VARIANT_NUNCHUCK) && !defined(VARIANT_PPM)
|
#if !defined(VARIANT_ADC) && !defined(VARIANT_USART3) && !defined(VARIANT_HOVERCAR) && !defined(VARIANT_TRANSPOTTER) && !defined(VARIANT_NUNCHUCK) && !defined(VARIANT_PPM)
|
||||||
#error Variant not defined! Please check platformio.ini or inc/config.h for available variants.
|
#error Variant not defined! Please check platformio.ini or Inc/config.h for available variants.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONTROL_SERIAL_USART2) && defined(CONTROL_SERIAL_USART3)
|
#if defined(CONTROL_SERIAL_USART2) && defined(CONTROL_SERIAL_USART3)
|
||||||
|
|
20
README.md
20
README.md
|
@ -25,17 +25,17 @@ The main firmware architecture includes:
|
||||||
- **FOC Algorithm**: implements the FOC strategy
|
- **FOC Algorithm**: implements the FOC strategy
|
||||||
- **Control Type Manager**: Manages the transition between Commutation, Sinusoidal, and FOC control type
|
- **Control Type Manager**: Manages the transition between Commutation, Sinusoidal, and FOC control type
|
||||||
|
|
||||||
![Firmware architecture](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/docs/pictures/FW_architecture.png)
|
![Firmware architecture](/docs/pictures/FW_architecture.png)
|
||||||
|
|
||||||
The FOC algorithm architecture is illustrated in the figure below:
|
The FOC algorithm architecture is illustrated in the figure below:
|
||||||
|
|
||||||
![FOC algorithm](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/docs/pictures/FOC_algorithm.png)
|
![FOC algorithm](/docs/pictures/FOC_algorithm.png)
|
||||||
|
|
||||||
In this firmware 3 control types are available:
|
In this firmware 3 control types are available:
|
||||||
- Commutation
|
- Commutation
|
||||||
- SIN (Sinusoidal)
|
- SIN (Sinusoidal)
|
||||||
- FOC (Field Oriented Control)
|
- FOC (Field Oriented Control)
|
||||||
![Schematic representation of the available control methods](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/01_Matlab/02_Figures/control_methods.png)
|
![Schematic representation of the available control methods](/01_Matlab/02_Figures/control_methods.png)
|
||||||
|
|
||||||
|
|
||||||
Demo videos:
|
Demo videos:
|
||||||
|
@ -48,13 +48,13 @@ Demo videos:
|
||||||
|
|
||||||
[►Video: HOVERCAR demo](https://drive.google.com/open?id=18IvRJVdQSsjTg1I0Wedlg19e0FuDjfdS)
|
[►Video: HOVERCAR demo](https://drive.google.com/open?id=18IvRJVdQSsjTg1I0Wedlg19e0FuDjfdS)
|
||||||
|
|
||||||
![Hoverboard wheel](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/docs/pictures/hoverboard_wheel.JPG)
|
![Hoverboard wheel](/docs/pictures/hoverboard_wheel.JPG)
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
## General Notes
|
## General Notes
|
||||||
- The C code for the controller was auto-code generated using [Matlab/Simulink](https://nl.mathworks.com/solutions/embedded-code-generation.html) from a model which I developed from scratch specifically for hoverboard control. For more details regarding the working principle of the controller please consult the [Matlab/Simulink model](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/tree/master/01_Matlab).
|
- The C code for the controller was auto-code generated using [Matlab/Simulink](https://nl.mathworks.com/solutions/embedded-code-generation.html) from a model which I developed from scratch specifically for hoverboard control. For more details regarding the working principle of the controller please consult the [Matlab/Simulink model](/01_Matlab).
|
||||||
- A [webview](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/tree/master/01_Matlab/BLDC_controller_ert_rtw/html/webview) was created, so Matlab/Simulink installation is not needed, unless you want to regenerate the code. The webview is an html page that can be opened with browsers like: Microsoft Internet Explorer or Microsoft Edge.
|
- A [webview](/01_Matlab/BLDC_controller_ert_rtw/html/webview) was created, so Matlab/Simulink installation is not needed, unless you want to regenerate the code. The webview is an html page that can be opened with browsers like: Microsoft Internet Explorer or Microsoft Edge.
|
||||||
|
|
||||||
### Field Weakening / Phase Advance
|
### Field Weakening / Phase Advance
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ Demo videos:
|
||||||
- The Field Weakening is a linear interpolation from 0 to FIELD_WEAK_MAX or PHASE_ADV_MAX (depeding if FOC or SIN is selected, respectively)
|
- The Field Weakening is a linear interpolation from 0 to FIELD_WEAK_MAX or PHASE_ADV_MAX (depeding if FOC or SIN is selected, respectively)
|
||||||
- The Field Weakening starts engaging at FIELD_WEAK_LO and reaches the maximum value at FIELD_WEAK_HI
|
- The Field Weakening starts engaging at FIELD_WEAK_LO and reaches the maximum value at FIELD_WEAK_HI
|
||||||
- The figure below shows different possible calibrations for Field Weakening / Phase Advance
|
- The figure below shows different possible calibrations for Field Weakening / Phase Advance
|
||||||
![Field Weakening](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/docs/pictures/FieldWeakening.png)
|
![Field Weakening](/docs/pictures/FieldWeakening.png)
|
||||||
- If you re-calibrate the Field Weakening please take all the safety measures! The motors can spin very fast!
|
- If you re-calibrate the Field Weakening please take all the safety measures! The motors can spin very fast!
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ Demo videos:
|
||||||
- For calibrating the fixed-point parameters use the [Fixed-Point Viewer](https://github.com/EmanuelFeru/FixedPointViewer) tool
|
- For calibrating the fixed-point parameters use the [Fixed-Point Viewer](https://github.com/EmanuelFeru/FixedPointViewer) tool
|
||||||
- The parameters data Fixed-point types are given in the following table:
|
- The parameters data Fixed-point types are given in the following table:
|
||||||
|
|
||||||
![Parameters table](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/docs/pictures/paramTable.png)
|
![Parameters table](/docs/pictures/paramTable.png)
|
||||||
|
|
||||||
|
|
||||||
### Diagnostics
|
### Diagnostics
|
||||||
|
@ -153,9 +153,9 @@ Most robust way for input is to use the ADC and potis. It works well even on 1m
|
||||||
---
|
---
|
||||||
## Example variants
|
## Example variants
|
||||||
|
|
||||||
This firmware offers currently these variants (selectable in [platformio.ini](platformio.ini) and / or [config.h](/Inc/config.h)):
|
This firmware offers currently these variants (selectable in [platformio.ini](/platformio.ini) and / or [/Inc/config.h](/Inc/config.h)):
|
||||||
- **VARIANT_ADC**: In this variant the motors are controlled by two potentiometers connected to the Left sensor cable (long wired)
|
- **VARIANT_ADC**: In this variant the motors are controlled by two potentiometers connected to the Left sensor cable (long wired)
|
||||||
- **VARIANT_USART3**: In this variant the motors are controlled via serial protocol on USART3 right sensor cable (short wired). The commands can be sent from an Arduino. Check out the [hoverserial.ino](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/tree/master/02_Arduino/hoverserial) as an example sketch.
|
- **VARIANT_USART3**: In this variant the motors are controlled via serial protocol on USART3 right sensor cable (short wired). The commands can be sent from an Arduino. Check out the [hoverserial.ino](/02_Arduino/hoverserial) as an example sketch.
|
||||||
- **VARIANT_HOVERCAR**: In this variant the motors are controlled by two pedals brake and throttle. Reverse is engaged by double tapping on the brake pedal at standstill.
|
- **VARIANT_HOVERCAR**: In this variant the motors are controlled by two pedals brake and throttle. Reverse is engaged by double tapping on the brake pedal at standstill.
|
||||||
- **VARIANT_TRANSPOTTER**: This build is for transpotter which is a hoverboard based transportation system. For more details on how to build it check [here](https://github.com/NiklasFauth/hoverboard-firmware-hack/wiki/Build-Instruction:-TranspOtter) and [here](https://hackaday.io/project/161891-transpotter-ng).
|
- **VARIANT_TRANSPOTTER**: This build is for transpotter which is a hoverboard based transportation system. For more details on how to build it check [here](https://github.com/NiklasFauth/hoverboard-firmware-hack/wiki/Build-Instruction:-TranspOtter) and [here](https://hackaday.io/project/161891-transpotter-ng).
|
||||||
- **VARIANT_NUNCHUCK**: Wii Nunchuck offers one hand control for throttle, braking and steering. This was one of the first input device used for electric armchairs or bottle crates.
|
- **VARIANT_NUNCHUCK**: Wii Nunchuck offers one hand control for throttle, braking and steering. This was one of the first input device used for electric armchairs or bottle crates.
|
||||||
|
|
|
@ -6,7 +6,9 @@ include_dir = Inc
|
||||||
src_dir = Src
|
src_dir = Src
|
||||||
|
|
||||||
;=================== VARIANT SELECTION ==========================
|
;=================== VARIANT SELECTION ==========================
|
||||||
default_envs = UNDEFINED ;
|
;
|
||||||
|
; Choose one or all variants get built
|
||||||
|
;
|
||||||
;default_envs = VARIANT_ADC ; Variant for control via ADC input
|
;default_envs = VARIANT_ADC ; Variant for control via ADC input
|
||||||
;default_envs = VARIANT_USART3 ; Variant for Serial control via USART3 input
|
;default_envs = VARIANT_USART3 ; Variant for Serial control via USART3 input
|
||||||
;default_envs = VARIANT_HOVERCAR ; Variant for HOVERCAR build
|
;default_envs = VARIANT_HOVERCAR ; Variant for HOVERCAR build
|
||||||
|
|
Loading…
Reference in New Issue