Commit Graph

97 Commits

Author SHA1 Message Date
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
Jeffrey M. Friesen 1c29679218 Merge remote-tracking branch 'upstream/dev_fw_5_00' into dev_fw_5_00 2020-03-17 09:34:30 -07:00
Benjamin Vedder a06f09e7f2 Observer gain scaling update, print correct motor on faults, updated timer terminal command 2020-03-17 09:38:09 +01:00
Jeffrey M. Friesen 36bdbebae3 100D Functioning
Modified hw config of 100D to get running.

Increased delay in drv8323s to improve stability of spi bus (was getting erroneous read/write at anything lower)

added custom settings for drv8323s for things like adjustable gate drive currents and shunt amplifier gains.  Maybe should move to hw conf and do the motor switch from mc_interface.
2020-03-16 19:33:33 -07:00
Benjamin Vedder 5219bb36ff Better thread/isr motor selection 2020-03-16 22:42:44 +01:00
Benjamin Vedder 52e17059e5 Major restructuring for dual motor support, and added unity hw files 2020-03-16 18:32:39 +01:00
Benjamin Vedder 97ef43cff8 Leave debug mode on NRF5x after SWD upload, more TS5700N8501 encoder features, more CAN baud rates 2020-02-01 00:37:25 +01:00
Benjamin Vedder 287cabe76f Common motor temperature validity check 2020-01-21 09:13:18 +01:00
Benjamin Vedder ae5ea13998
Merge pull request #124 from powerdesigns/Axiom-resolver
Axiom full resolver support
2020-01-21 08:35:36 +01:00
Benjamin Vedder 2a910e17d6
Merge pull request #120 from ddosoff/master
KTY83/122 and priority to custom commands
2020-01-21 08:34:58 +01:00
Marcos Chaparro 9965bb52d5 Axiom: Full resolver support
Fixes a low level SPI timing bug.
Provide Loss of Signal, Degradation Of Signal and Loss Of Tracking
fault sources, and stats to the 'encoder' terminal command.

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2020-01-20 11:06:02 -03:00
Marcos Chaparro 356f3db20e Add Break function for instant PWM disable
When enabled, the Break (or BRK) is a mechanism that upon a active
level in the TIMx_BRK pin disables asynchronously the PWM output pins,
achieving fast reaction times when an external fault even happens.
See AN4277.

Signed-off-by: Marcos Chaparro <mchaparro@paltatech.com>
2020-01-19 15:36:40 -03:00