Commit Graph

262 Commits

Author SHA1 Message Date
Mitch Lustig de9400e461 Add brake timeout 2021-06-05 16:05:19 -07:00
Mitch Lustig d68fc0ff4f Balance: Updates
-Fix D term to use angle rather than error (which includes tilt steps)
-Switch TT to Biquad (Clear z1 z2)
-Split TT Relax speed
-Add Biquad to D term
-Add console command to graph specific variables
-Add console command to dump realtime data from specific variables
2021-06-01 03:20:00 -07:00
Benjamin Vedder 007eb9bb92 Updated er qml 2021-05-29 14:35:54 +02:00
Benjamin Vedder 25be00df54 Updated er and finn apps 2021-05-29 14:09:26 +02:00
Benjamin Vedder 6dd35cbbc3 Updated er-app 2021-05-26 22:09:50 +02:00
Mitch Lustig 1711ff953a Balance app cleanup
Increase motor timeout to account for sleep inaccuracy and whatever else.

Set motor timeout to a variable, to reduce calculation repetition.

Only calculate motor timeout after config is set, so we never divide by 0.

Reorder functions so exposed functions are at the start.

Make app's internal functions static.
2021-05-23 14:58:47 -07:00
Benjamin Vedder e74eb17429 Simplified QML 2021-05-23 20:19:08 +02:00
Benjamin Vedder 3e7bd17d7d er updates 2021-05-23 15:42:30 +02:00
Benjamin Vedder eca6a233d5 er updates 2021-05-23 14:46:49 +02:00
Benjamin Vedder 19d2a4078c Added qmlui to conf 2021-05-22 21:40:19 +02:00
Benjamin Vedder 6d945cb4ab Added er qml config 2021-05-22 21:01:33 +02:00
Benjamin Vedder 1c83713540 Updated er app 2021-05-21 00:00:28 +02:00
Mitch Lustig b237cf4b9f Add High Pass FIlter, implement current off delay, refactor constanttilt 2021-05-16 14:53:03 -07:00
Benjamin Vedder 77af43935a Removed outdated LED-support 2021-05-11 09:57:27 +02:00
Benjamin Vedder 24b8a6f100 Change default DRV OC mode for HD60 and HD75 2021-05-07 09:49:01 +02:00
Benjamin Vedder f25144cc30 Removed iterative observer, added p_pid_gain_dec_angle 2021-04-26 23:14:05 +02:00
Benjamin Vedder 36d32ed96d
Merge pull request #291 from Mitchlol/balance_4.2
Balance 4.2
2021-04-20 15:53:12 +02:00
Marcos Chaparro d8d2088137 app adc: allow hardwares to override the brake input
With this hook the brake can be overriden from the hw_*.c file without
polluting the app configuration UI.

Some examples of commanded braking:
* Tilt/crash sensor
* Gear shift sensor
* Emergency stop
* Kill switch

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2021-04-19 11:33:57 -03:00
Mitch Lustig c9ed013f13 Fix low speed Full switch faults, Fix Booster, Improve turn/torque tilts 2021-04-17 18:05:24 -07:00
Benjamin Vedder 89d854f4c4 Added Finns app 2021-04-12 19:46:37 +02:00
Benjamin Vedder 998bc17ba7 Cleanup 2021-04-12 09:48:29 +02:00
Benjamin Vedder ca8e7b4f05
Merge pull request #271 from CTSchorsch/dev_05_03
- Add driver for SX1278 LoRa boards, eg. HopeRF RFM95W (driver by Woj…
2021-04-12 09:35:38 +02:00
Benjamin Vedder 1f1e1e99fb
Merge pull request #276 from Mitchlol/balance_4.1
Balance 4.1
2021-04-08 18:07:54 +02:00
Mitch Lustig 273f067db3 Code Cleanup 2021-04-07 22:42:21 -07:00
Mitch Lustig af941b3182 Little cleanup 2021-04-07 00:30:37 -07:00
Benjamin Vedder a9c2a4fcc9 Added ER application 2021-04-06 14:12:57 +02:00
Mitch Lustig 08f27f433c Add turn tilt 2021-04-06 02:18:32 -07:00
Mitch Lustig 175ed9e21c Merge branch 'dev_fw_5_03' into brc_mod_1 2021-04-01 20:57:44 -07:00
mattbutlar fae1466601 Add comment on value mapping 2021-04-01 14:35:57 -07:00
mattbutlar bb7b049d86 Remove loop timing test 2021-04-01 09:53:03 -07:00
CTSchorsch 4f048442d0 cleanup spaces 2021-03-31 19:46:31 +02:00
Benjamin Vedder fcb7e12158 Made servo output a config option 2021-03-31 16:28:46 +02:00
CTSchorsch 755ff98ec9 fix spaces, delete lines and default config 2021-03-31 14:10:27 +02:00
Benjamin Vedder 69d3a1ba33 Only change UART pin mode when needed 2021-03-31 09:54:59 +02:00
mattbutlar b61049b18e Change roll comp math to avoid external deps 2021-03-30 23:20:35 -07:00
mattbutlar 4f74c179a2 Simplify roll comp math 2021-03-29 14:42:30 -07:00
Mitch Lustig 9f41e4407f Fix compiler warning 2021-03-28 14:41:05 -07:00
Mitch Lustig decdc7e7d6 Add torquetilt 2021-03-27 20:13:22 -07:00
Mitch Lustig 3b9fe6ec67 Add Booster 2021-03-27 14:00:55 -07:00
CTSchorsch 331494291d - move lora files from hwconf/ to lora/
- modify Makefile and add lora/lora.mk
- hopefully have all idents fixed
- restore commands.c and add new function again
- fix memory leak bug in gesc.c
- rfm95w.c add delay in while loop
- add gesc to build_all / rebuild all works
2021-03-27 21:13:24 +01:00
Mitch Lustig 49e624ba3b Remove boring features 2021-03-27 12:17:10 -07:00
CTSchorsch cdb8e82c32 - Add driver for SX1278 LoRa boards, eg. HopeRF RFM95W (driver by Wojciech Domski, https://github.com/wdomski/SX1278)
- Add a simple bool isInitialized() to commands.c, to check if commands are initialzied
- Add hwconf for GESC, hobby open source ESC (https://github.com/CTSchorsch/gesc) including a simple double pulse test function
- Add app_dpv.c to read out a simple I2C magnetic field sensor and two hall sensors to control a underwater scooter
2021-03-27 14:15:22 +01:00
Benjamin Vedder 2133d21fbc Avoid numerical instability when utils_map is used over a range that approaches 0 2021-03-27 11:18:47 +01:00
mattbutlar 583e62933d Add roll compensation to the balance app 2021-03-14 22:57:47 -07:00
Benjamin Vedder 703f1ed9a3 Fixed RPM limit bug for curret hyst rev mode 2021-03-13 11:33:29 +01:00
Benjamin Vedder 9a0973cba1 Style fix 2021-01-15 14:01:16 +01:00
Benjamin Vedder ecb43e70bb Cleanup 2021-01-13 21:51:55 +01:00
Jeffrey M. Friesen 57a13ec2da cleanup merge 2021-01-13 09:05:16 -08:00
Jeffrey M. Friesen 6a3dfb8526 Patched bug with gpio AF in uart 2021-01-05 12:30:41 -08:00
Jeffrey M. Friesen e862f29298 Re-wrote uart driver a bit 2021-01-05 09:39:45 -08:00
Marcos Chaparro 33b5d5c1ba Pedal assist support (PAS)
This commit enables cadence-based pedal assist for ebikes using
quadrature-style pedal speed sensors.

There are 2 operation modes:
* PAS only: Motor current is based only on pedal feedback
* ADC + PAS: The code will use both ADC and pedal feedback and use
the strongest command to provide seamless overlap when the user is
pedalling and requests extra torque with the throttle.

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2020-12-07 17:06:36 -03:00
Till Rosenband 82e5bcd845 Verify FLASH integrity of MC and APP config with CRC.
* Currently the FW code has CRC checks, but configs are also important!
* This helps maintain FLASH integrity when the config pages are occasionally
  re-written due to odometer updates (later commit).
* If the config CRC checks fail, store the fault and fall back to default config.
* New 'crc' terminal command displays CRC values.
2020-10-04 00:31:31 -04:00
Mitch Lustig 52f8f2cf35 Merge remote-tracking branch 'vedderb/dev_fw_5_02' into balance_3 2020-07-09 01:06:02 -07:00
Mitch Lustig 27e1d11f4a Lil fixes 2020-07-04 03:35:19 -07:00
Mitch Lustig 0f5c6f5379 Add confgen and running states 2020-07-04 00:11:20 -07:00
Mitch Lustig 7db04df582 Add all the variables 2020-07-03 20:33:15 -07:00
Peemouse ca05c36c7f App PPM rework - fix previous commit
CHANGED : Master keeps the slave(s) running even if a local fault occurs
CHANGED : Master now sends relative value instead (%) instead of absolute value (A) (great for multiple VESC with different currents settings)
FIXED : Timeout current brake feature not working
FIXED : brake command sent over CANbus even if Multiple VESC over CAN disabled
FIXED : delay before switching slave off in case of RX timeout
ADDED : Traction control auto-disabling in case of fault on master, re-enable only if no effect on motors will happen (avoid weird behaviour exiting fault state on master).
2020-07-03 15:16:46 +02:00
Mitch Lustig 8299445c66 Basic feature set complte
Fix some bugs
Add D-Term PT1 Filter
Add all the fault delays
Setpoint clamp no longer breaks tiltback
Add configurable constant tiltback erpm
2020-07-02 01:07:54 -07:00
Peemouse 37e9c2143b CHANGED : Master keeps the slave(s) running even if a local fault occurs
CHANGED : Master now sends relative value instead (%) instead of absolute value (A) (great for multiple VESC with different currents settings)
FIXED : Timeout current brake feature not working
FIXED : brake command sent over CANbus even if Multiple VESC over CAN disabled
FIXED : delay before switching slave off in case of RX timeout
ADDED : Traction control auto-disabling in case of fault on master, re-enable only if no effect on motors will happen (avoid weird behaviour exiting fault state on master).
2020-07-01 14:39:31 +02:00
Mitch Lustig b61a0ea7be Add additional timer for switch half state 2020-06-19 01:28:52 -07:00
Mitch Lustig da7b3a0ffb Mix of stuff (Not a working state)
Organize vars
Hack in dterm PT1
Improve faults
Remove dead state
2020-06-19 01:00:37 -07:00
Benjamin Vedder 6196805d8c Added CHUK_CTRL_TYPE_CURRENT_BIDIRECTIONAL, some fixes on last PR 2020-05-03 22:35:37 +02:00
Benjamin Vedder 80fffdea73 Fixed PPM bug in previous release 2020-04-27 14:23:49 +02:00
Benjamin Vedder ef4ebfde93 Allow throttle in opposite direction even after passing speed limit for PPM and VESC Remote apps 2020-04-26 11:48:55 +02:00
Benjamin Vedder 84ce74c325
Merge pull request #141 from Mitchlol/Balance_app_sprint_3
Balance sprint 3
2020-03-16 20:35:26 +01:00
Benjamin Vedder 52e17059e5 Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
Mitch Lustig 24afd4e6f3 Balance sprint 3
-Can steering based on speed
-Can steering current clamp
-Min rpm for half switch state fault
-Soft mode tuning (pitch angle affinity, setpoint affinity, setpoint limit)
-Reset I value on faults issue #117
-fix startup tiltback
2020-03-15 23:18:34 -07:00
Mitch Lustig 6d29b6741f Use ADC for switches 2020-02-23 13:34:51 -08:00
Mitch Lustig d4f6036de7 Implement nose angle adjustment 2020-02-23 10:23:19 -08:00
Mitch Lustig 2c07512091 Add can bus, 2 wheel steering & stabilization, brake, dead & fault dealy 2020-02-23 00:22:21 -08:00
Benjamin Vedder ffbc6eb89b First attempt at HFI 2020-01-20 09:39:33 +01:00
Benjamin Vedder b002e5d78e FW 3.66: Many changes, see changelog 2020-01-12 21:25:21 +01:00
Benjamin Vedder 210ec40d74 PTC motor thermistor support, APP_PPM sleep fix 2019-12-22 21:22:07 +01:00
Benjamin Vedder ceb8b7bf7d HW60_MK3 support, shutdown fix, added COMM_SET_CURRENT_REL, ramp fix, PPM timeout fix, IRQ prio fix 2019-12-19 16:55:38 +01:00
Benjamin Vedder 0855169754 Merge branch 'master' of https://github.com/vedderb/bldc 2019-12-09 13:47:34 +01:00
Benjamin Vedder 78d3cef3ff Added support for HW60_MK3 and disable shutdown when watchdog runs slowly 2019-12-09 10:57:33 +01:00
Kirill Kostiuchenko 72ab61ba1a pretty printing 2019-12-09 10:59:04 +05:00
Kirill Kostiuchenko f06d8b8bda convert units and accurate zero reach added 2019-12-08 15:02:22 +05:00
Benjamin Vedder 23e61925b6 FW upload compression support, TS5700N8501 support 2019-12-05 19:50:17 +01:00
Benjamin Vedder ce31092c1d Merge branch 'master' of https://github.com/vedderb/bldc 2019-09-21 12:50:41 +02:00
Benjamin Vedder f34d0159bf Fixed nunchuk bug and added COMM_BM_MEM_READ command 2019-09-21 12:50:39 +02:00
Benjamin Vedder 7a9fbae54c
Merge pull request #104 from Mitchlol/remove_axis_config_from_balance_app
Remove axis config from balance app
2019-09-21 12:49:53 +02:00
Mitch Lustig 343dba369a Remove axis config 2019-09-21 01:07:31 -07:00
Mitch Lustig 644e22a459 Add uart app to balance app when using internal IMU 2019-09-21 00:07:20 -07:00
Mitch Lustig b53102d6fd Fix build for versions without HW_SPI 2019-09-12 23:08:56 -07:00
Mitch Lustig d160f74651 Merge branch 'master' into balance 2019-09-12 22:50:12 -07:00
Mitch Lustig 3c31d264fd Add high voltage tiltback 2019-09-12 00:07:26 -07:00
Mitch Lustig 95483cff41 Centralise IMU startup sequence 2019-09-11 23:08:28 -07:00
Mitch Lustig 518776d04e Add basic low voltage tiltback 2019-09-10 19:29:44 -07:00
Mitch Lustig 22d4f7c99a Fix the index, fix the build 2019-09-10 02:25:13 -07:00
Mitch Lustig 8638036750 Fix wheel spin-up on boot
By waiting for gyro to be initialized
2019-09-10 02:04:04 -07:00
Mitch Lustig 67a4653bd8 Add support for dual fault switches 2019-09-10 01:07:05 -07:00
Benjamin Vedder eb6f5945ce FW 3.61: Added smart reverse mode to PPM app, and some fixes 2019-09-09 19:34:26 +02:00
Mitch Lustig 1cc9a9b14c Re-implement startup AHRS config override
So my EUC stops trying to kill me when i boot it up laying down
2019-09-08 22:38:09 -07:00
Mitch Lustig a4de5eb2b5 Cleanup 2019-09-08 22:23:31 -07:00
Mitch Lustig 72e9c24bd7 Make axes configurable, remove offset management 2019-09-08 18:32:53 -07:00
Mitch Lustig 011d3055f6 Merge branch 'master' into merge_new_master 2019-09-08 15:05:54 -07:00
Mitch Lustig 474d8c1691 Little more cleanup 2019-09-08 12:14:59 -07:00
Mitch Lustig 98652977a2 Merge master 2019-09-08 11:42:28 -07:00
Benjamin Vedder a233367be8 MPU9x50 fix, experiment plots, DQ voltage RT data, smart reverse for nunchuk app 2019-09-08 18:25:38 +02:00