Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 5 03 #1

Open
wants to merge 393 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
393 commits
Select commit Hold shift + click to select a range
ad06b4c
Added CAN current commands with off delay
vedderb May 16, 2021
caa24ab
Merge remote-tracking branch 'vedderb/dev_fw_5_03' into balance_4.3
Mitchlol May 16, 2021
b237cf4
Add High Pass FIlter, implement current off delay, refactor constanttilt
Mitchlol May 16, 2021
bfe1fa0
Merge pull request #299 from Mitchlol/balance_4.3
vedderb May 18, 2021
fdad367
limit mc_interface_set_current_off_delay time to 5s
vedderb May 19, 2021
6dd4758
Disable current controller decoupling by default
vedderb May 19, 2021
3d2aad0
Take current limit into account when going to full brake
vedderb May 20, 2021
7bdb0a3
Increased default phase filter erpm
vedderb May 20, 2021
1c83713
Updated er app
vedderb May 20, 2021
759ae52
Increased FW version number
vedderb May 20, 2021
6d945cb
Added er qml config
vedderb May 22, 2021
19d2a40
Added qmlui to conf
vedderb May 22, 2021
eca6a23
er updates
vedderb May 23, 2021
3e7bd17
er updates
vedderb May 23, 2021
e74eb17
Simplified QML
vedderb May 23, 2021
1711ff9
Balance app cleanup
Mitchlol May 23, 2021
812f530
Merge pull request #298 from cleichner/doc-fixes
vedderb May 24, 2021
951b07a
Merge pull request #301 from Mitchlol/balance_app_cleanup
vedderb May 24, 2021
93b405a
Merge branch 'master' into dev_fw_5_03
vedderb May 24, 2021
6dd35cb
Updated er-app
vedderb May 26, 2021
422e348
Added things for 100D_V2 hardware variant
Jfriesen222 May 29, 2021
25be00d
Updated er and finn apps
vedderb May 29, 2021
be439a2
Merge pull request #303 from Jfriesen222/master
vedderb May 29, 2021
1f935c6
Merge branch 'master' into dev_fw_5_03
vedderb May 29, 2021
007eb9b
Updated er qml
vedderb May 29, 2021
d68fc0f
Balance: Updates
Mitchlol Jun 1, 2021
de9400e
Add brake timeout
Mitchlol Jun 5, 2021
3e08ca0
Add support for debugging to the experiments tab
Mitchlol Jun 6, 2021
e2fd6f4
Simplify balance app startup sleeps
Mitchlol Jun 6, 2021
5cdebf6
Added app_custom_mkfile to makefile, removed outdated hardware
vedderb Jun 6, 2021
7c14322
Added mc_interface_dccal_done to mc_interface.h
vedderb Jun 6, 2021
d561c26
Add balance loop time correction
Mitchlol Jun 6, 2021
6e0601f
Merge pull request #306 from Mitchlol/balance_4.4
vedderb Jun 7, 2021
93fa359
Added mkdir command to all firmwares in rebuild_all
vedderb Jun 7, 2021
5742d1b
Handle subnormal numbers in float serialization
vedderb Jun 9, 2021
75b84f1
Added kill switch support
vedderb Jun 13, 2021
f810939
Added event logging
vedderb Jun 15, 2021
186e1ce
Disable vesc remote control by default and enable it after pairing
vedderb Jun 15, 2021
bfbf26b
Ignore can messages with commands larger than CAN_PACKET_ID
vedderb Jun 19, 2021
32af87b
Added aux out modes
vedderb Jun 19, 2021
029bd88
Make CAN-enum 32 bits
vedderb Jun 19, 2021
0a5fe73
Ignore commands when kill switch is active
vedderb Jun 20, 2021
813d5b1
Balance App: introduce new speed based variable tiltback
surfdado Jun 26, 2021
ff94d24
BMI160 SPI fixes
vedderb Jun 26, 2021
b7a5ff5
Check external NRF crc
vedderb Jun 27, 2021
9f086cf
fixup! Balance App: introduce new speed based variable tiltback
davorinmista Jun 30, 2021
ec4eb57
fixup! Balance App: introduce new speed based variable tiltback
davorinmista Jun 30, 2021
b3c069a
Merge pull request #313 from surfdado/variable_tiltback
vedderb Jul 2, 2021
02caad3
Biquad filters: add config/reset functions
surfdado Jul 6, 2021
fec05f7
Merge pull request #315 from surfdado/bqfix
vedderb Jul 7, 2021
daa51c6
Fix switching to the MT6816 encoder before reboot
bsilver8192 Jul 10, 2021
1ab25a4
Added position PID offset support and KD_PROC term
vedderb Jul 11, 2021
804f49b
Moved position control loop to 1 khz timer
vedderb Jul 11, 2021
3c88ecb
Added configurable PID loop rate and more AUX port modes
vedderb Jul 12, 2021
741dd2b
Speed PID fixes
vedderb Jul 14, 2021
334be27
use absolute magnitudes of current unbalance
Teslafly Jul 18, 2021
f8b89ac
Merge pull request #320 from Teslafly/dev_fw_5_03-use_absolute_curren…
vedderb Jul 18, 2021
5ad0c88
Merge pull request #317 from seems-reasonable/mt6816-init
vedderb Jul 18, 2021
e951e3a
Added AS504x Diagnostics
Jul 28, 2021
c44b252
Move Dummy transaction into MOSI only
Jul 28, 2021
2511458
USE_HW_PINS added in appropriate places
Jul 29, 2021
f46880d
Balance: configurable speed/angle for each tiltback type
surfdado Jul 30, 2021
3ed1a8f
new faults
Jul 30, 2021
4709798
brackets style changed
Jul 30, 2021
5f7b49c
reduction of characters in terminal.c methods
Jul 30, 2021
db906c4
Merge pull request #326 from Jaycobe96/AS50x_Diagnostics
vedderb Jul 30, 2021
11e2062
Pull request cleanup
vedderb Jul 30, 2021
a00d1be
Simplified pr
vedderb Jul 31, 2021
7418102
Renamed encoder functions, moved fault generation
vedderb Jul 31, 2021
99058d6
Added AS504x faults
vedderb Jul 31, 2021
d02d74c
Corrent interrupt flag in encoder fault generation
vedderb Jul 31, 2021
cd0d31f
Merge branch 'dev_fw_5_03' into tiltback_config
Mitchlol Aug 9, 2021
817936f
Updates to stormcore configs
Jfriesen222 Aug 11, 2021
49c94ef
Fixed bug where unity/stormcore could be powered off too soon and freeze
Jfriesen222 Aug 13, 2021
848cb31
Balance: configurable speed/angle for each tiltback type
surfdado Jul 30, 2021
3f1c787
confgenerator for Balance: configurable speed/angle for each tiltback…
surfdado Aug 15, 2021
733c551
Merge pull request #332 from Jfriesen222/dev_fw_5_03
vedderb Aug 16, 2021
df56397
Merge pull request #327 from surfdado/tiltback_config
vedderb Aug 16, 2021
debd1ed
Configuration updates
vedderb Aug 16, 2021
fc6825a
Added safe start modes
vedderb Aug 16, 2021
4603ff5
Change filtered duty cycle to absolute value
vedderb Aug 16, 2021
fafe047
Tiltback updates
Mitchlol Aug 18, 2021
bec22c9
Merge remote-tracking branch 'surfdado/tiltback_config' into tiltback…
Mitchlol Aug 18, 2021
7c6f1dd
Added fusion IMU filter
vedderb Aug 19, 2021
c34856b
DRV8323S oc latch shutdown by default
vedderb Aug 19, 2021
f91872b
Merge branch 'dev_fw_5_03' into tiltback_config
Mitchlol Aug 19, 2021
80de95c
Update confgenerator
Mitchlol Aug 19, 2021
cd1e37d
ZESC Warrior6 Support
surfdado Aug 19, 2021
5a56e8b
ZESC Raiden7 Support
surfdado Aug 19, 2021
64ed53f
Fix balance tiltback default speeds
Mitchlol Aug 20, 2021
36c9db6
Dual motor shutdown fix
vedderb Aug 20, 2021
b7b44cf
Fixed can init check when can is disabled
vedderb Aug 20, 2021
91e299a
Merge pull request #334 from surfdado/zescboards
vedderb Aug 20, 2021
44053fb
Merge pull request #333 from Mitchlol/tiltback_config
vedderb Aug 20, 2021
86cbc92
Fixed regression in sensorless braking
vedderb Aug 20, 2021
91a19fa
IMU improvements
vedderb Aug 22, 2021
31d524f
Made local functions static
vedderb Aug 22, 2021
f887c30
Add a poll CAN message.
manoukianv Aug 30, 2021
dbeb8f0
Merge pull request #336 from manoukianv/PollEncoderOverCan
vedderb Aug 30, 2021
0bc935b
Added break to new can command
vedderb Aug 30, 2021
a970269
Moved CAN_PACKET_POLL_ROTOR_POS to addressed packets
vedderb Aug 30, 2021
c3f397a
Added comments about the CAN packet types
vedderb Aug 30, 2021
0109693
Changed CAN_PACKET_POLL_ROTOR_POS to respond with the controller id
vedderb Aug 30, 2021
2f26f3a
fixes in traction control for scooters
mark99i Sep 8, 2021
d898d3b
Lowered default switching frequency
vedderb Sep 15, 2021
bec2534
Fixed stormcore CAN shutdown
vedderb Sep 15, 2021
40ccb48
Added another nrf revision to bm
vedderb Sep 15, 2021
e7d2291
More stormcore power switch fixes
vedderb Sep 15, 2021
11ad3f8
Support for Spintend ubox single
Sep 23, 2021
6f1b674
Merge pull request #340 from mark99i/dev_fw_5_03
vedderb Oct 1, 2021
78e10cc
Merge pull request #342 from tharon-rivera/dev_fw_5_03
vedderb Oct 1, 2021
add855f
blackmagic: Add cmd to write to target memory.
JohanRadinn Oct 1, 2021
c0fa922
Merge pull request #344 from RadinnAB/bm_mem_write
vedderb Oct 2, 2021
b1ec844
PAS: add constant torque control type
afzalmam Oct 4, 2021
27782f2
Fix wrong status in mpu_status terminal command
dimpolo Oct 7, 2021
583f712
Merge pull request #350 from dimpolo/mpu_status_fix
vedderb Oct 10, 2021
b6eb585
Merge pull request #346 from afzalmam/dev_fw_5_03
vedderb Oct 11, 2021
378b1b7
blackmagic: Support more nrf5 target revisions
avlasic Oct 13, 2021
badaa2f
Merge pull request #360 from avlasic/dev_fw_5_03_nrf
vedderb Oct 13, 2021
aeb5d74
[Utils] Use convenience macros for deg/rad conversions
kubark42 Oct 13, 2021
bec06ac
[Utils] Change convenience multiplication factors into convenience MA…
kubark42 Oct 13, 2021
d8a99fd
Inductance and resistance measurement and scaling fixes, various othe…
vedderb Oct 15, 2021
e8ae30c
Merge branch 'dev_fw_5_03' of github.com:vedderb/bldc into dev_fw_5_03
vedderb Oct 15, 2021
b1f564c
Merge pull request #352 from kubark42/convenience_math
vedderb Oct 15, 2021
1763fd5
Fixed loss calculation
vedderb Oct 16, 2021
8cf082e
Better bus current estimation, HFI max voltage and duty scaling fix
vedderb Oct 16, 2021
7265f79
Updated changelog
vedderb Oct 16, 2021
d041761
Updated mcconf signature
vedderb Oct 16, 2021
8f8d913
Added raw sample mode
vedderb Oct 18, 2021
49cfd79
Add A50S 6S and 12S hardware
TechAUmNu Oct 20, 2021
98587c9
Updated inductance calculation, include motor saliency in observer, s…
vedderb Oct 24, 2021
f1c4e71
Added MTPA modes
vedderb Oct 24, 2021
9046e46
Merge pull request #363 from TechAUmNu/dev_fw_5_03
vedderb Oct 24, 2021
78887f3
Added link to forum post as comment to explain factor 4
vedderb Oct 25, 2021
8de8589
[Convenience math] Capture a last couple laggards which were missed e…
kubark42 Oct 27, 2021
0e58e29
[MCPWM_FOC] Fix mislabeled variable
kubark42 Oct 27, 2021
d97793b
Update mcpwm_foc.c
kubark42 Oct 27, 2021
2018e92
Merge pull request #369 from kubark42/convenience_laggards
vedderb Oct 30, 2021
09bd140
Added COMM_BALANCE_SELFTEST
vedderb Oct 30, 2021
5304872
Added missing bracket from PR
vedderb Oct 31, 2021
e9cf6eb
Added fast moving average filter approximation, updated ADC app to us…
vedderb Oct 31, 2021
78e750a
Scale down measured inductance. Read the comment for details.
vedderb Oct 31, 2021
cd7a2d8
Fixed build script
vedderb Oct 31, 2021
d79d12a
Fixed braking mode
vedderb Oct 31, 2021
e31cb50
Moved LED control to its own thread
vedderb Nov 1, 2021
bbb8a3d
Added comments to the current loop
ElwinBoots Nov 5, 2021
258ad28
Merge pull request #373 from ElwinBoots/Commenting
vedderb Nov 6, 2021
6dbea7e
[MCPWM_FOC] Eliminate repeated divisions
kubark42 Nov 7, 2021
80adea0
[MCPWM_FOC] Condense math in order to save on FPU operations
kubark42 Nov 7, 2021
3b3c423
Merge pull request #372 from kubark42/simplify_foc_fpu_math
vedderb Nov 7, 2021
bc63a31
Added q-axis modulation filter and use it for input current limits
vedderb Nov 7, 2021
6773832
[SVM] Comment the function API
kubark42 Nov 7, 2021
d62f0b3
Merge pull request #375 from kubark42/svm_function_comments
vedderb Nov 8, 2021
cb84c94
Disable HFI start in braking mode
vedderb Nov 8, 2021
c7a6a00
Update with new BMS commands
vedderb Nov 9, 2021
c3f3c95
Parameter update
vedderb Nov 10, 2021
e89e00b
Added 100/500 to build script
vedderb Nov 10, 2021
f0b291d
Improved overvoltage protection
vedderb Nov 10, 2021
f9170e9
Added uptime to setupvalues
vedderb Nov 10, 2021
3778dbe
Added support for statistics
vedderb Nov 11, 2021
5b73873
make: Default to non-verbose compilation output.
Jun 4, 2021
1839855
make: Added size-rule.
Jun 4, 2021
80d504e
hw_rd2: Adjustments of guard- & get-temperature function-naming.
Nov 12, 2021
8457331
Fix vesc remote cruise control under erpm limit
vedderb Nov 12, 2021
78065cf
SVM sign fix
ElwinBoots Nov 13, 2021
19dc884
Merge pull request #378 from ElwinBoots/svm_correct
vedderb Nov 13, 2021
76adfc1
Merge pull request #377 from RadinnAB/hw_rd2_adj
vedderb Nov 13, 2021
fff18eb
Reset PID controller filters when not running to avoid start glitch
vedderb Nov 15, 2021
fd48dc2
Make PID position control direction consistent with other control mod…
vedderb Nov 15, 2021
f6e78a0
Fixed measured MTPA mode, send ld_lq_diff detection result
vedderb Nov 21, 2021
36c333c
Apply ld_lq_diff in detection
vedderb Nov 21, 2021
78b3cd0
fixed GPIO mapping for phase filters on SC
Jfriesen222 Nov 22, 2021
5d385c0
Added UAVCAN raw RPM command
vedderb Nov 24, 2021
e1b150b
Merge pull request #381 from Jfriesen222/dev_fw_5_03
vedderb Nov 24, 2021
132c603
Use the same minimal temp value for Temperature compensation
avlasic Nov 24, 2021
61356d6
Added APPCONF_UAVCAN_RAW_RPM_MAX default value
vedderb Nov 24, 2021
824e74b
Merge pull request #382 from avlasic/temp_comp_fix_5_03
vedderb Nov 25, 2021
76b4f58
Another attempt at braking smoothly to 0
vedderb Nov 25, 2021
a420113
Minor cleanup
vedderb Nov 26, 2021
b524773
Another attempt at braking
vedderb Nov 27, 2021
afe85a2
Handle different max and min currents in braking mode
vedderb Nov 27, 2021
e6c44bb
build using 12 cores
vedderb Nov 27, 2021
c5c309e
More braking improvements
vedderb Nov 27, 2021
40c2842
Sign macro fix
vedderb Nov 27, 2021
2a281e3
Initialize integrator in dutycycle downramp controller
vedderb Nov 27, 2021
6b076f0
updated signature
vedderb Nov 28, 2021
5e61101
Tweak settings for A50S hardware
TechAUmNu Nov 28, 2021
d30fb57
Fixed stat reset, removed stat terminal command
vedderb Dec 1, 2021
4fa7a92
Fixed dual motor detect offset problem
vedderb Dec 1, 2021
4da6b60
er updates
vedderb Dec 6, 2021
b302c1a
er update
vedderb Dec 8, 2021
a8f989e
er updates
vedderb Dec 8, 2021
4eec52d
Fix NaN-problem after lost tracking on some motors
vedderb Dec 19, 2021
f8ba78c
fixed power switch on 60dxs
Jfriesen222 Dec 20, 2021
796c122
Merge branch 'dev_fw_5_03' of https://github.com/vedderb/bldc into de…
Jfriesen222 Dec 20, 2021
480ffbb
Fix fault parameter in mcpwm_foc_measure_inductance function.
secupol Dec 21, 2021
5a2382a
Merge pull request #388 from secupol/dev_fw_5_03
vedderb Dec 21, 2021
817c4e8
Merge branch 'dev_fw_5_03' of https://github.com/vedderb/bldc into de…
Jfriesen222 Dec 23, 2021
fefa32e
Fix the clunk at the end of the open loop flux linkage measurement.
ElwinBoots Dec 24, 2021
2978e9b
[conf_general] Brief code cleanup
kubark42 Dec 27, 2021
3ed8c90
Merge pull request #390 from kubark42/fluxlinkage_clunkfix
vedderb Dec 28, 2021
627c12b
bbshd: Ruggedize PAS against vibrations
nitrousnrg Nov 19, 2021
d6fc739
bbshd: Support display, assist levels, PTC temp sensor, wheel speed s…
nitrousnrg Nov 19, 2021
2246be4
bbshd: update default motor config
nitrousnrg Nov 22, 2021
b7caa46
bbshd: update qmlui
nitrousnrg Dec 28, 2021
e4f4bb1
[MCPWM_FOC] Make rotor lock feature use D axis
ElwinBoots Dec 23, 2021
1ab9584
Merge pull request #393 from kubark42/rotor_lock_d_axis
vedderb Dec 29, 2021
95c6717
First attempt at a resistance and temperature observer
vedderb Dec 29, 2021
d1b962b
Merge pull request #392 from luna-cycle/luna_bbshd_support
vedderb Dec 31, 2021
ab0aa12
Collected luna-files in one place, removed some old files
vedderb Dec 31, 2021
a77179c
bbshd: add appconf
nitrousnrg Dec 31, 2021
a1dd7f4
bbshd: include appconf
nitrousnrg Dec 31, 2021
5401557
Merge pull request #394 from luna-cycle/luna_bbshd_appconf
vedderb Jan 2, 2022
aeda17e
Moved luna appconf
vedderb Jan 2, 2022
015dce3
Balance App: bugfix for speed based variable tiltback config
surfdado Jan 3, 2022
af55c79
Renamed foc_f_sw to foc_f_zv
vedderb Jan 6, 2022
a092ea9
More consequences of the f_sw renaming
vedderb Jan 6, 2022
648b8a3
MCCONF_FOC_F_SW backwards-compatibility
vedderb Jan 6, 2022
768a9a6
Added deprecation warning
vedderb Jan 6, 2022
88a3601
Merge branch 'dev_fw_5_03' into dev_fw_5_03
vedderb Jan 9, 2022
76f100f
Merge pull request #383 from TechAUmNu/dev_fw_5_03
vedderb Jan 9, 2022
988c68b
Merge pull request #395 from surfdado/speed_tb_bugfix
vedderb Jan 9, 2022
40ddb64
fix some config things for stormcore
Jfriesen222 Jan 11, 2022
0ad58b4
Merge branch 'dev_fw_5_03' of https://github.com/vedderb/bldc into de…
Jfriesen222 Jan 11, 2022
53f6186
Added build script entries for new stormcore hardware
Jfriesen222 Jan 11, 2022
37ac4ff
Merge pull request #399 from Jfriesen222/dev_fw_5_03
vedderb Jan 12, 2022
16385f1
Renamed compression to lzo, added observer offset parameter
vedderb Jan 12, 2022
7d38621
Indentation fix
vedderb Jan 12, 2022
9ed0456
Added support for CAN2 and hardware with dual CAN. Added sensor port …
vedderb Jan 13, 2022
3856631
Added hw_60v2alva
vedderb Jan 13, 2022
4f0388d
Added lispbm test module (disabled by default)
vedderb Jan 13, 2022
786ee1f
lispbm updates
vedderb Jan 13, 2022
6c0c85b
Lisp updates
vedderb Jan 14, 2022
06386fb
Add extensions without allocating and copying string
vedderb Jan 14, 2022
c1e106d
lispBM: use existing pointer for extension names, do not overallocate…
vedderb Jan 14, 2022
ef58f7d
Minor fix
vedderb Jan 14, 2022
1c841ee
More fundamental fixes
vedderb Jan 14, 2022
24d5640
Remove print error buffer
vedderb Jan 14, 2022
cfd6685
More extensions
vedderb Jan 14, 2022
2ef226f
Added more extensions and example
vedderb Jan 15, 2022
4e37d63
More lisp
vedderb Jan 15, 2022
c8426bb
Added lisp stack monitor and another example
vedderb Jan 15, 2022
1b688ed
Lisp ADC extension and example
vedderb Jan 15, 2022
bf7bd9d
Added foldl to example
vedderb Jan 15, 2022
53286b8
Updated bms print example
vedderb Jan 15, 2022
3b8b81c
More lisp extensions
vedderb Jan 16, 2022
92efab4
Changed to release settings
vedderb Jan 16, 2022
9988d4d
added 60v2_alva to build script
vedderb Jan 17, 2022
d5407fe
Fixed hw name string
vedderb Jan 25, 2022
0b5c9fd
Rebuilt binary
vedderb Jan 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ build
.project
.cproject
.settings/language.settings.xml
.DS_Store
workspace.code-workspace
49 changes: 49 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
=== FW 5.03 ===
* Fixed inductance measurement bug.
* Speed tracker windup protection.
* Phase filter support.
* Phase voltage offset calibration.
* Better current offset calibration.
* Added power switch commands.
* Synchronize observer state when running in open loop.
* Force oberver state magnitude above 50% of flux linkage. This prevents the motor from getting stuck and 'screaming'.
* Observer global convergence update. Helps tracking the motor through 0 speed.
* Added HFI start sensor mode.
* Added TEMP_SENSOR_KTY84_130.
* Major UAVCAN update. See: https://github.com/vedderb/bldc/pull/269
* Avoid numerical instability when mapping is done over a narrow range. See: https://github.com/vedderb/bldc/issues/262
* App Balance updates.
* Added servo_out_enable appconf option, so that the PPM port can be used to control servos with the default firmware.
* Better current controller windup protection.
* Field weakening support (experimental, be careful and use at your own risk).
* Use filtered current for axis decoupling.
* Odometer is now persistent after firmware updates.
* Added hw runtime counter (see hw_status in terminal)
* Added custom UI support.
* Limit hall sensor angle rate of change based on ERPM.
* Added p_pid_gain_dec_angle parameter.
* Low pass filter input voltage.
* Dual hardware CAN-scan fix.
* Dynamic QML-script write support.
* Use fast speed tracker for current controller.
* Disable motor for 5 seconds after flash operations.
* Added kill switch support.
* Added process derivative term to position controller.
* Added position PID-controller angle offset.
* Configurable PID controller rate.
* Added several AUX port modes.
* Added configurable safe start modes.
* Added fusion IMU filter.
* Added constant torque PAS mode.
* Correct scaling for resistance and inductance.
* Fixed inductance measurement bug with f_sw > 30k.
* Corrected inductance measurement algorithm.
* Fixed max power loss calculation.
* Better input current estimation.
* Added raw sampled data mode.
* Compensate inductance for motor saliency in observer.
* Added MTPA mode based on measured current.
* Faster overvoltage protection.
* Added statistics counters.
* Added configurable observer offset.

=== FW 5.02 ===
* IMU calibration improvement.
* Added COMM_GET_MCCONF_TEMP command.
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ When making updates it is easy to break things for different configurations. In

=== Other guidelines ===

* Use single precition floating point operations, as the FPU in the STM32F4 is 32 bits only. Double precision operations can take up to 50 times (!) longer.
- float instead if double
* Use single precision floating point operations, as the FPU in the STM32F4 is 32 bits only. Double precision operations can take up to 50 times (!) longer.
- float instead of double
- Use the math library functions ending with f (sinf, cosf, powf, fabsf etc.)

* Make sure that the code compiles without warnings.

* Avoid dynamic memory allocation if possible, so that the RAM usage is known at compile time.

* If the code crashed randomly, use the ChibiOS state checker:
http://www.chibios.org/dokuwiki/doku.php?id=chibios:articles:state_checker
https://www.chibios.org/dokuwiki/doku.php?id=chibios:documentation:books:rt:kernel_debug#system_state_checks


=== Be patient, and don't take criticism personally ===
Expand Down
44 changes: 36 additions & 8 deletions Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# NOTE: Can be overridden externally.
#

USE_LISPBM=0

# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99 -D_GNU_SOURCE
Expand Down Expand Up @@ -42,7 +44,7 @@ endif

# Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),)
USE_VERBOSE_COMPILE = yes
USE_VERBOSE_COMPILE = no
endif

# If enabled, this option makes the build process faster by not compiling
Expand Down Expand Up @@ -109,9 +111,15 @@ include applications/applications.mk
include nrf/nrf.mk
include libcanard/canard.mk
include imu/imu.mk
include compression/compression.mk
include lora/lora.mk
include lzo/lzo.mk
include blackmagic/blackmagic.mk

ifeq ($(USE_LISPBM),1)
include lispBM/lispbm.mk
USE_OPT += -DUSE_LISPBM
endif

# Define linker script file here
LDSCRIPT= ld_eeprom_emu.ld

Expand Down Expand Up @@ -145,8 +153,6 @@ CSRC = $(STARTUPSRC) \
commands.c \
timeout.c \
comm_can.c \
ws2811.c \
led_external.c \
encoder.c \
flash_helper.c \
mc_interface.c \
Expand All @@ -161,13 +167,20 @@ CSRC = $(STARTUPSRC) \
mempools.c \
worker.c \
bms.c \
events.c \
$(HWSRC) \
$(APPSRC) \
$(NRFSRC) \
$(CANARDSRC) \
$(IMUSRC) \
$(COMPRESSIONSRC) \
$(BLACKMAGICSRC)
$(LORASRC) \
$(LZOSRC) \
$(BLACKMAGICSRC) \
qmlui/qmlui.c

ifeq ($(USE_LISPBM),1)
CSRC += $(LISPBMSRC)
endif

# C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
Expand Down Expand Up @@ -207,8 +220,20 @@ INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(NRFINC) \
$(CANARDINC) \
$(IMUINC) \
$(COMPRESSIONINC) \
$(BLACKMAGICINC)
$(LORAINC) \
$(LZOINC) \
$(BLACKMAGICINC) \
qmlui \
qmlui/hw \
qmlui/app

ifeq ($(USE_LISPBM),1)
INCDIR += $(LISPBMINC)
endif

ifdef app_custom_mkfile
include $(app_custom_mkfile)
endif

#
# Project, sources and paths
Expand Down Expand Up @@ -312,3 +337,6 @@ upload-pi-remote: build/$(PROJECT).elf

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

size: build/$(PROJECT).elf
@$(SZ) $<
61 changes: 52 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,29 @@ There are also many other options that can be changed in conf_general.h

### On Ubuntu

Install the gcc-arm-embedded toolchain


Install the gcc-arm-embedded toolchain. Recommended version ```gcc-arm-none-eabi-7-2018-q2```

**Method 1 - Through Official GNU Arm Embedded Toolchain Downloads**
1. Go to [GNU Arm Embedded Toolchain Downloads](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
2. Locate and Download version **gcc-arm-none-eabi-7-2018-q2** for your machine
```GNU Arm Embedded Toolchain: 7-2018-q2-update June 27, 2018```
Linux 64-bit version can be downloaded from [here](https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2?revision=bc2c96c0-14b5-4bb4-9f18-bceb4050fee7?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,7-2018-q2-update)
3. Unpack the archive in the file manager by right-clicking on it and select "extract here"
4. Change directory to the unpacked folder, unpack it in /usr/local by execute the following command
```
cd gcc-arm-none-eabi-7-2018-q2-update-linux
sudo cp -RT gcc-arm-none-eabi-7-2018-q2-update/ /usr/local
```

**Method 2 - Through apt install**
```bash
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt update
sudo apt install gcc-arm-embedded
```

Add udev rules to use the stlink v2 programmer without being root


**Optional - Add udev rules to use the stlink v2 programmer without being root**
```bash
wget vedder.se/Temp/49-stlinkv2.rules
sudo mv 49-stlinkv2.rules /etc/udev/rules.d/
Expand All @@ -120,9 +131,6 @@ brew install openocd
```

## Build

Build and flash the [bootloader](https://github.com/vedderb/bldc-bootloader) first

Clone and build the firmware

```bash
Expand All @@ -131,11 +139,46 @@ cd vesc_firmware
make
```

Flash it using an STLink SWD debugger

## Upload to VESC
### Method 1 - Flash it using an STLink SWD debugger

Build and flash the [bootloader](https://github.com/vedderb/bldc-bootloader) first

```bash
make upload
```
### Method 2 - Upload Firmware via VESC tool through USB

1. Clone and build the firmware in **.bin** format

Reminder : Remember to select your board in [**conf_general.h**]

```bash
git clone https://github.com/vedderb/bldc.git vesc_firmware
cd vesc_firmware
#make build/your_firmware_name_here.bin
make build/VESC_fw.bin
```
In VESC tool

2. Connect to the VESC
3. Navigate to the Firmware tab on the left side menu
4. Click on Custom file tab
5. Click on the folder icon to select the built firmware in .bin format (e.g. VESC_fw.bin)

##### [ Reminder : It is normal to see VESC disconnects during the firmware upload process ]
##### **[ Warning : DO NOT DISCONNECT POWER/USB to VESC during the upload process, or you will risk bricking your VESC ]**
##### **[ Warning : ONLY DISCONNECT your VESC 10s after the upload loading bar completed and "FW Upload DONE" ]**

6. Press the upload firmware button (downward arrow) on the bottom right to start upload the selected firmware.
7. Wait for **10s** after the loading bar completed (Warning: unplug sooner will risk bricking your VESC)
8. The VESC will disconnect itself after new firmware is uploaded.

## In case you bricked your VESC
you will need to upload a new working firmware to the VESC.
However, to upload a firmware to a bricked VESC, you have to use a SWD Debugger.


## Contribute

Expand Down
Loading