Commit Graph

108 Commits

Author SHA1 Message Date
Benjamin Vedder 32af87b08a Added aux out modes 2021-06-19 17:50:44 +02:00
Benjamin Vedder f81093922a Added event logging 2021-06-15 12:56:38 +02:00
Benjamin Vedder 75b84f1f2d Added kill switch support 2021-06-13 13:46:27 +02:00
Benjamin Vedder fdad367c8d limit mc_interface_set_current_off_delay time to 5s 2021-05-20 00:57:26 +02:00
Benjamin Vedder 934d7b9751 Locking around stop code, added mc_interface_set_current_off_delay 2021-05-15 15:24:39 +02:00
Benjamin Vedder b3ed7a67d7 Fixed DRV fault reset 2021-05-14 13:52:41 +02:00
Benjamin Vedder 2c2238f76a Unified DRV fault reset interface, reset DRV faults after fault stop time ends 2021-05-14 11:24:01 +02:00
Benjamin Vedder 9e9e13ae14 Wait for motor release where needed 2021-05-13 10:42:40 +02:00
Benjamin Vedder be5ce41c17 Disable motor for 5 seconds after flash operations 2021-05-11 19:25:03 +02:00
Benjamin Vedder 77af43935a Removed outdated LED-support 2021-05-11 09:57:27 +02:00
Benjamin Vedder 7a0e560e8b Lowpass filter input voltage and battery level 2021-04-27 17:48:15 +02:00
Benjamin Vedder 55dba9a79d Made odometer persist after firmware updates, added hw runtime counter 2021-04-11 19:36:11 +02: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
Benjamin Vedder e7921ff5bd Merge branch 'dev_fw_5_03' of https://github.com/vedderb/bldc into dev_fw_5_03 2021-03-17 11:55:11 +01:00
Benjamin Vedder bdb7b0bf7b Added KTY84 temp sensor support 2021-03-17 11:54:42 +01:00
Benjamin Vedder b162692081
Merge pull request #263 from powerdesigns/external_speed_sensor_support
Allow using external speed sensors on custom hardwares
2021-03-15 20:12:09 +01:00
Benjamin Vedder c82346b42e Added HFI start sensor mode 2021-03-13 11:42:23 +01:00
Benjamin Vedder 86445edf1a Fixed speed limit regression 2021-03-04 14:26:48 +01:00
Marcos Chaparro fba22914bd Allow using external speed sensors on custom hardwares
When the vehicle has a gearbox or clutch, the motor speed is not
correlated to actual vehicle speed, which makes the data logs,
stats and display data somewhat confusing.

This just introduces the speed sensor polling and query when
HW_HAS_WHEEL_SPEED_SENSOR has been defined in hw_*.c

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2021-03-02 10:39:59 -03:00
Benjamin Vedder 8900c41c34 First phase filter and offset calibration attempt 2021-02-28 20:36:02 +01:00
Dado Mista e567c460f1 NTC 100K@25C Temperature Sensor support added
Some PHUB188 hubs have a 100k instead of 10k temperature sensors, including the first
few batches of Fungineers hubs for balance vehicles.

Signed-off-by: Dado Mista <dadomista@gmail.com>
2020-12-18 09:09:38 -08:00
Marcos Chaparro 50bc55e487 MT6816 SPI encoder support
This encoder needs x2 16bit SPI transfers so the hardware SPI peripheral
was used to run SCLK at 10MHz and reduce the ISR duration.

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2020-11-30 19:12:58 -03:00
Benjamin Vedder b7b0182856 CAN fixes, renamed HD to HD60, fixed multiturn position control 2020-11-18 14:26:55 +01:00
Benjamin Vedder 6509065ca2 Added BMS module 2020-10-22 08:32:51 +02:00
Benjamin Vedder cabd83a8a6 Fixed merge conflict 2020-10-09 21:19:16 +02:00
Benjamin Vedder c77f92470b IO board support, initial bms support, more openloop parameters, removed D current injection, added new HWs 2020-10-09 21:08:48 +02:00
Till Rosenband 5d26063152 Store odometer in emulated EEPROM (update at shutdown).
* New "dist" terminal command shows odometer and trip distances.
* Odometer value is sent to UI via COMM_GET_VALUES_SETUP.
* UI can set the odometer via COMM_SET_ODOMETER.
* Unfortunately, the bootloader clears the odometer to 0 when FW is reprogrammed.
2020-10-04 00:33:06 -04: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
Jeffrey M. Friesen 216a009d10 remove comment on motor temp 2020-07-28 13:04:39 -07:00
Jeffrey M. Friesen 75f9b1cdd0 removed motor temp offset and fixed bug in 60D header 2020-07-27 10:56:01 -07:00
Jeffrey M. Friesen f41a54c23d Merge branch 'dev_fw_5_02' of https://github.com/vedderb/bldc into dev_fw_5_02 2020-07-21 08:27:33 -07:00
Marcos Chaparro 2a3110cc53 Fix id and vd sign during inverted direction
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2020-06-06 22:14:06 -03:00
Jeffrey M. Friesen 6069b2f872 minor changes to fault reporting 2020-06-06 17:38:53 -07:00
jxltom 52a1e1d446 Fix warning: missing initializer for field 'ah_charge_tot' of 'setup_values' 2020-05-09 12:00:02 +08:00
Benjamin Vedder 57c5d04214 Added l_duty_start and set correct motor in mcinterface_timer 2020-04-21 19:58:12 +02:00
Benjamin Vedder 4dab6ed9e7 Fixed merge, renamed utils_batt_norm_v_to_capacity, scale battery ah with 0.85 since the battery is not fully depleted at 3.2V per cell 2020-04-16 09:39:47 +02:00
Jeffrey M. Friesen acfc93e693 Patched some weird behavior with motor temp on stormcore and added #define for filter constant
Was seeing a lot of coupled noise on stormcore with phase currents so I turned up the LPF on the motor temp sensor. I think it might be a good idea to turn up that LPF generally since motor temp is generally slow to change anyways.

Also found a problem in the #define for motor temp 2 in my header file. Fixed it.
2020-04-14 14:05:47 -07:00
Jeffrey M. Friesen 6e83fd3408 Added gentle li-ion curve mapping
Should provide a slightly more accurate estimate of the remaining battery, I fit a fifth order polynomial to a discharge graph of a samsung 30q cell.

Technically the watt hours left should be integrated across this curve instead of using the average remaining voltage but maybe the combination of both provides a good midway estimate between the actual curve and a line since all cells are slightly different.
2020-04-14 09:12:57 -07:00
Benjamin Vedder 3ab8002fa4 Motor temperature filtering bug fix 2020-04-09 22:33:20 +02:00
Benjamin Vedder 282b40cbd5 Select motor in fault thread 2020-04-08 09:16:31 +02:00
Benjamin Vedder 88d74ae0b6 Added mutex to DRV SPI driver, moved fault stop to thread, smooth current ramping for sensor and flux linkage detection 2020-04-03 20:12:12 +02:00
Benjamin Vedder c408a86b21 Stop on faults for both DRVs on DUAL_PARALLEL hw 2020-03-29 17:24:07 +02:00
Benjamin Vedder 6b3bcca4c1
Merge pull request #143 from powerdesigns/BBSHD-tuning
More bbshd support
2020-03-29 17:12:21 +02:00
Benjamin Vedder 7ccf626b42 Some updates on PR 2020-03-29 17:00:43 +02:00
Jeffrey M. Friesen 47813b1ab6 One motor Double Current Drive on Dual 2020-03-28 11:21:45 -07:00
Marcos Chaparro 278f767854 BBSHD: monitor 12V rail
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2020-03-26 11:04:37 -03:00
Benjamin Vedder f4b31b8133 More refactoring 2020-03-21 12:04:20 +01:00
Benjamin Vedder b1945b7dfc Cleaning, optimization and refactoring 2020-03-21 11:40:50 +01:00
Benjamin Vedder 28d97a421d Updated changelog 2020-03-20 21:55:01 +01:00
Benjamin Vedder 68163a88b6 Some optimizations to make mc_interface timer ISR run faster 2020-03-20 21:48:21 +01:00