Skip to content

Commit

Permalink
First official commit after the VESC Project release
Browse files Browse the repository at this point in the history
  • Loading branch information
vedderb committed Sep 4, 2017
1 parent 0b59fb1 commit f141157
Show file tree
Hide file tree
Showing 81 changed files with 3,500 additions and 477 deletions.
99 changes: 97 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,11 +1,106 @@
=== FW 3.27 ===
* Watt hour reset bug fix
* Changed the way custom applications are implemented.
* FOC: high current sampling mode.

=== FW 3.26 ===
* Current limit bug fix. It is now possible to apply break past the RPM limits.
* Openloop RPM calculation bug fix.

=== FW 3.25 ===
* APP multi-VESC PID control: send current instead of duty cycle for better load sharing.
* Added relative current commands to mc_interface and comm_can.
* APP ADC: added mode ADC_CTRL_TYPE_CURRENT_REV_BUTTON_BRAKE_ADC.
* APP ADC: changed behavior when throttle and brake ADC channels are used simultaneously for smoother combination.
* APP ADC: ramping support.
* Flux linkage measurement: Added extra try with high integrator value.

=== FW 3.24 ===
* Changed back inductance calculation since that seems to work much better in practise. (TODO: Have a closer look at why)

=== FW 3.23 ===
* Improved inductance measurement (bug fix).
* Multiple tries with different settings on flux linkage measurement.
* Observer improvements for high speed operation and better performance across the whole speed range.
* Compile time option to disable override limits.

=== FW 3.22 ===
* Added hardware-specific limits to configuration parameters.
* Permanent NRF bug fix.

=== FW 3.21 ===
* Fixed regression in PID speed controller.

=== FW 3.20 ===
* PID speed control: Set prev_error to error when the PID is off to make the start smoother.
* Improved spinup algorithm for flux linkage and bldc parameter measurement.
* APP ADC: Configurable center voltage for channel 1.
* APP_UARTCOMM: Keep the processing thread running when stopping the app in case the configuration is made from the UART port itself.
* Commands: Return results of long running commands to the port they came from even if commands come in between and change the last port.

=== FW 3.19 ===
* Added terminal plugin hook implementation. Inspired by https://github.com/vedderb/bldc/pull/28
* Moved sampling buffers to CCM to free some RAM.
* Added hardware info terminal command.
* NRF init SPI check fix.
* Sampled data is now transmitted in floating point with scaling done at the VESC. This avoids hard-coded scaling in VESC Tool.

=== FW 3.18 ===
* NRF init SPI check.
* Permanent NRF: reconfigure NRF pins to SPI pins on init failure in case the permanent NRF is not mounted and behave as if there is no permanent NRF.

=== FW 3.17 ===
* Temperature filtering.
* FOC: temperature resistance compensation.

=== FW 3.16 ===
* FOC: stator saturation compensation parameter.
* FOC: Another update for the fix for throttle limits to prevent loosing range at high speed when the battery current limit is lower than the motor current limit.
* DRV8301: over current protection settings added to configuration.
* DRV8301: Reset command andded to terminal.
* DRV8301: Log fault code read over SPI.
* DRV: Check for faults in ADC interrupt to catch the state as fast as possible.
* Send phase samples as well with the sampling function.
* New sampling modes for debugging.
* BLDC and DC: Configurable switching frequency
* FOC detect: increase minimum switching frequency for motor spinup to make it possible to detect high kv motors at high voltage.
* FOC: observer gain scaling parameter for low modulation.

=== FW 3.15 ===
* FOC: added the option for FOC sampling in both V0 and V7 to mcconf, so that it can be changed without recompiling the firmware.
* FOC: tweaked repetition counter and preload to get cleaner waveforms with low latency.
* FOC: Input voltage filterting and vd/vq filtering while undriven for more stable performance.

=== FW 3.14 ===
* Different throttle curve modes
* Improved FOC sensorless startup.

=== FW 3.13 ===
* Throttle curve for PPM, ADC and Nunchuk.
* Updated fix for throttle limits to prevent loosing range at high speed when the battery current limit is lower than the motor current limit.
* APP PPM ramping.
* APP ADC and PPM current range bug fix for some control modes.

=== FW 3.12 ===
* APP PPM throttle center setting.

=== FW 3.11 ===
* BLDC detect: disable direction inversion before detecting parameters.
* FOC speed control: remove supply voltage scaling since that does not make any sense in current control mode.
* BLDC speed control: added current-based speed controller option.
* BLDC: heavier RPM filtering.
* Speed control: option to disable braking in speed control mode.
* Added wattage limits. Useful for following laws for electric vehicles in some regions.
* Use override current limits to scale throttle inputs in apps. Will prevent the throttle from loosing rage at speed if e.g. the battery current limits are lower than the motor current limits.

=== FW 3.10 ===
* BLDC: removed cycles_running parameter
* BLDC: removed cycles_running variable.
* BLDC: update ADC sampling in correct order to avoid corrupt samples when the switching frequency changes a lot at once.
* Terminal: print fault duty cycle state with one extra decimal.

=== FW 3.9 ===
* Configuration option for inverting the motor direction.
* STM32 96-bit unique ID in firmware version command.
* STM32 96-bit unique ID readout.

=== FW 3.8 ===
* Communication protocol update for floating point variables. This breaks almost all compatibility with old firmwares.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ But Benjamin is a busy man, and to reduce the workload of reviewing patches, it'

=== Process ===

Please discuss your ideas in the forum (http://vedder.se/forums/index.php) so that you don't just dump a large amount of code on Benjamin out of nowhere. Try to reach some kind of consensus with others on the forum about scope and functionality of your contribution.
Please discuss your ideas in the forum (http://vesc-project.com/forum) so that you don't just dump a large amount of code on Benjamin out of nowhere. Try to reach some kind of consensus with others on the forum about scope and functionality of your contribution.

When Benjamin is prepared for your patch, and you have checked that it follows these guidelines, contribute it through a github pull request.

Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ endif
# Stack size to be allocated to the Cortex-M process stack. This stack is
# the stack used by the main() thread.
ifeq ($(USE_PROCESS_STACKSIZE),)
USE_PROCESS_STACKSIZE = 0x400
USE_PROCESS_STACKSIZE = 0x800
endif

# Stack size to the allocated to the Cortex-M main/exceptions stack. This
# stack is used for processing interrupts and exceptions.
ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
USE_EXCEPTIONS_STACKSIZE = 0x400
USE_EXCEPTIONS_STACKSIZE = 0x800
endif

# Enables the use of FPU on Cortex-M4 (no, softfp, hard).
Expand Down Expand Up @@ -277,6 +277,12 @@ upload: build/$(PROJECT).bin
upload-olimex: build/$(PROJECT).bin
openocd -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f interface/ftdi/olimex-arm-jtag-swd.cfg -c "set WORKAREASIZE 0x2000" -f target/stm32f4x.cfg -c "program build/$(PROJECT).elf verify reset"

upload-pi: build/$(PROJECT).bin
openocd -f pi_stm32.cfg -c "reset_config trst_only combined" -c "program build/$(PROJECT).elf verify reset exit"

upload-pi-remote: build/$(PROJECT).elf
./upload_remote_pi build/$(PROJECT).elf ted 10.42.0.199 22

debug-start:
openocd -f stm32-bv_openocd.cfg

Expand Down
38 changes: 37 additions & 1 deletion appconf/appconf_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define APPCONF_APP_TO_USE APP_UART
#endif

// PPM app
// PPM app configureation
#ifndef APPCONF_PPM_CTRL_TYPE
#define APPCONF_PPM_CTRL_TYPE PPM_CTRL_TYPE_NONE
#endif
Expand All @@ -59,12 +59,27 @@
#ifndef APPCONF_PPM_PULSE_END
#define APPCONF_PPM_PULSE_END 2.0
#endif
#ifndef APPCONF_PPM_PULSE_CENTER
#define APPCONF_PPM_PULSE_CENTER 1.5
#endif
#ifndef APPCONF_PPM_MEDIAN_FILTER
#define APPCONF_PPM_MEDIAN_FILTER true
#endif
#ifndef APPCONF_PPM_SAFE_START
#define APPCONF_PPM_SAFE_START true
#endif
#ifndef APPCONF_PPM_THROTTLE_EXP
#define APPCONF_PPM_THROTTLE_EXP 0.0
#endif
#ifndef APPCONF_PPM_THROTTLE_EXP_MODE
#define APPCONF_PPM_THROTTLE_EXP_MODE THR_EXP_POLY
#endif
#ifndef APPCONF_PPM_RAMP_TIME_POS
#define APPCONF_PPM_RAMP_TIME_POS 0.9
#endif
#ifndef APPCONF_PPM_RAMP_TIME_NEG
#define APPCONF_PPM_RAMP_TIME_NEG 0.3
#endif
#ifndef APPCONF_PPM_MULTI_ESC
#define APPCONF_PPM_MULTI_ESC false
#endif
Expand All @@ -88,6 +103,9 @@
#ifndef APPCONF_ADC_VOLTAGE_END
#define APPCONF_ADC_VOLTAGE_END 3.0
#endif
#ifndef APPCONF_ADC_VOLTAGE_CENTER
#define APPCONF_ADC_VOLTAGE_CENTER 2.0
#endif
#ifndef APPCONF_ADC_VOLTAGE2_START
#define APPCONF_ADC_VOLTAGE2_START 0.9
#endif
Expand All @@ -112,6 +130,18 @@
#ifndef APPCONF_ADC_VOLTAGE2_INVERTED
#define APPCONF_ADC_VOLTAGE2_INVERTED false
#endif
#ifndef APPCONF_ADC_THROTTLE_EXP
#define APPCONF_ADC_THROTTLE_EXP 0.0
#endif
#ifndef APPCONF_ADC_THROTTLE_EXP_MODE
#define APPCONF_ADC_THROTTLE_EXP_MODE THR_EXP_POLY
#endif
#ifndef APPCONF_ADC_RAMP_TIME_POS
#define APPCONF_ADC_RAMP_TIME_POS 0.9
#endif
#ifndef APPCONF_ADC_RAMP_TIME_NEG
#define APPCONF_ADC_RAMP_TIME_NEG 0.3
#endif
#ifndef APPCONF_ADC_MULTI_ESC
#define APPCONF_ADC_MULTI_ESC false
#endif
Expand Down Expand Up @@ -146,6 +176,12 @@
#ifndef APPCONF_STICK_ERPM_PER_S_IN_CC
#define APPCONF_STICK_ERPM_PER_S_IN_CC 3000.0
#endif
#ifndef APPCONF_CHUK_THROTTLE_EXP
#define APPCONF_CHUK_THROTTLE_EXP 0.0
#endif
#ifndef APPCONF_CHUK_THROTTLE_EXP_MODE
#define APPCONF_CHUK_THROTTLE_EXP_MODE THR_EXP_POLY
#endif
#ifndef APPCONF_CHUK_MULTI_ESC
#define APPCONF_CHUK_MULTI_ESC false
#endif
Expand Down
29 changes: 18 additions & 11 deletions applications/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ void app_set_configuration(app_configuration *conf) {
app_adc_stop();
app_uartcomm_stop();
app_nunchuk_stop();
#ifndef HW_HAS_PERMANENT_NRF
nrf_driver_stop();
#endif
#ifdef USE_APP_STEN
app_sten_stop();

if (!conf_general_permanent_nrf_found) {
nrf_driver_stop();
}

#ifdef APP_CUSTOM_TO_USE
app_custom_stop();
#endif

switch (appconf.app_to_use) {
Expand Down Expand Up @@ -81,17 +83,17 @@ void app_set_configuration(app_configuration *conf) {
app_nunchuk_start();
break;

#ifndef HW_HAS_PERMANENT_NRF
case APP_NRF:
nrf_driver_init();
rfhelp_restart();
if (!conf_general_permanent_nrf_found) {
nrf_driver_init();
rfhelp_restart();
}
break;
#endif

case APP_CUSTOM:
#ifdef USE_APP_STEN
#ifdef APP_CUSTOM_TO_USE
hw_stop_i2c();
app_sten_start();
app_custom_start();
#endif
break;

Expand All @@ -103,5 +105,10 @@ void app_set_configuration(app_configuration *conf) {
app_adc_configure(&appconf.app_adc_conf);
app_uartcomm_configure(appconf.app_uart_baudrate);
app_nunchuk_configure(&appconf.app_chuk_conf);

#ifdef APP_CUSTOM_TO_USE
app_custom_configure(&appconf);
#endif

rfhelp_update_conf(&appconf.app_nrf_conf);
}
6 changes: 4 additions & 2 deletions applications/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void app_set_configuration(app_configuration *conf);
// Standard apps
void app_ppm_start(void);
void app_ppm_stop(void);
float app_ppm_get_decoded_level(void);
void app_ppm_configure(ppm_config *conf);

void app_adc_start(bool use_rx_tx);
Expand All @@ -50,7 +51,8 @@ float app_nunchuk_get_decoded_chuk(void);
void app_nunchuk_update_output(chuck_data *data);

// Custom apps
void app_sten_start(void);
void app_sten_stop(void);
void app_custom_start(void);
void app_custom_stop(void);
void app_custom_configure(app_configuration *conf);

#endif /* APP_H_ */
Loading

0 comments on commit f141157

Please sign in to comment.