Commit Graph

110 Commits

Author SHA1 Message Date
Andrej Vlašić 710a2e9a6d Send back app and mc config to requester port 2022-05-10 13:27:09 +02:00
Benjamin Vedder d87ada9b1a Added FOC detection command 2022-05-06 19:49:58 +02:00
Marcos Chaparro 46d132a2d7 Add hw specific backups
Data stored in this memory will be persistent across firmware updates.

This uses the same method used in the VESC BMS firmware.

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2022-05-05 16:28:58 -03:00
secupol 8475f3ef4d
Fixed typo 2022-05-05 07:13:28 +09:00
Euan 5e5c6f6d0e Stop on fault in flux linkage measurement 2022-05-04 20:17:38 +01:00
Euan 3db2860cf4 Improve fault handling during detection routines
Added more checks for faults during detection routines.
Always return an error if a fault occured.
Handing for returned errors.
2022-05-04 19:41:09 +01:00
Kenn Sebesta cf6f32332d [Utils] Update the header includes 2022-03-23 20:25:37 -04:00
Benjamin Vedder e9d6fd5842 Use bitfields for CAN-messages and support two different CAN status rates 2022-03-11 18:08:28 +01:00
Kenn Sebesta 3de18a249d [Math] Use a macro for the two-norm
No code differences, just a little easier on the reader.
2022-03-07 11:37:56 -05:00
Kenn Sebesta 5da38dfedf [Make] Capture git branch, commit, dirty state, and arm compiler
This code pushes those strings into #defines which are available inside the
firmware.
2022-03-06 19:07:15 -05:00
Jakub Tomczak da4b3e0edd Merge branch 'master' into dev_fw_5_03 2022-01-21 15:07:44 +01:00
Jakub Tomczak 2a120615be encoders to encoder refactor 2022-01-09 17:10:40 +01:00
Benjamin Vedder af55c79a2a Renamed foc_f_sw to foc_f_zv 2022-01-06 20:44:00 +01:00
Kenn Sebesta 2978e9b8e3 [conf_general] Brief code cleanup
1) Use `false` instead of `0`. This communicates that it is a bool which is being sent, and not a decimal
number.

2) Add some code comments
2021-12-27 16:55:33 -05:00
ElwinBoots fefa32e7bf Fix the clunk at the end of the open loop flux linkage measurement.
Old code tried to remove all current instantly. New code disabled the pwm first.
2021-12-27 16:55:33 -05:00
Jakub Tomczak 4743194894 old encoder files deleted 2021-12-20 14:18:51 +01:00
Jakub Tomczak f26f3beb2d WIP: 3 encoders partially implemented, AS504x tested
compiled on gcc-arm-none-eabi-7-2018-q2
2021-12-14 16:40:40 +01:00
Benjamin Vedder 4fa7a922fe Fixed dual motor detect offset problem 2021-12-01 13:46:49 +01:00
Benjamin Vedder 36c333cc03 Apply ld_lq_diff in detection 2021-11-21 19:23:19 +01:00
Benjamin Vedder 98587c961b Updated inductance calculation, include motor saliency in observer, separate setting for MTPA 2021-10-24 13:25:12 +02:00
Benjamin Vedder 1763fd59d3 Fixed loss calculation 2021-10-16 12:53:49 +02:00
Benjamin Vedder b1f564c3bb
Merge pull request #352 from kubark42/convenience_math
Use convenience macros for deg/rad conversions
2021-10-15 22:35:47 +02:00
Benjamin Vedder d8a99fd0f1 Inductance and resistance measurement and scaling fixes, various other fixes 2021-10-15 22:25:07 +02:00
Kenn Sebesta bec06ac85a [Utils] Change convenience multiplication factors into convenience MACROs 2021-10-13 14:18:05 -04:00
Kenn Sebesta aeb5d74488 [Utils] Use convenience macros for deg/rad conversions 2021-10-13 11:52:04 -04:00
Benjamin Vedder 75b84f1f2d Added kill switch support 2021-06-13 13:46:27 +02:00
Benjamin Vedder 509713e21a Fixed timeout values 2021-05-13 10:59:33 +02:00
Benjamin Vedder 9e9e13ae14 Wait for motor release where needed 2021-05-13 10:42:40 +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 8900c41c34 First phase filter and offset calibration attempt 2021-02-28 20:36:02 +01: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 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
Benjamin Vedder 6f7c40b4e1 Improved flux linkage measurement 2020-04-16 09:12:08 +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 c0f75f14ac Current ramping during resistance measurement 2020-04-02 20:43:11 +02:00
Benjamin Vedder a61e74db82 Fixed memory leak 2020-03-20 20:40:41 +01:00
Benjamin Vedder 51f0fcea09 gpdrive fix, observer gain calc updates, added COMM_SET_BATTERY_CUT, added CAN_PACKET_SHUTDOWN, detect all fix 2020-03-20 17:35:25 +01: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
Benjamin Vedder 8739b22f3e Stop both motors when saving configurations 2020-03-16 20:22:01 +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 5df92463f3 Pos PID fix, AS5047 fix, changed FOC time constant, updated conf generator 2020-02-27 17:49:35 +01:00
Benjamin Vedder b6949d60dc FW4.00: HFI and many updates, see changelog 2020-01-28 19:46:19 +01:00
Benjamin Vedder 23e61925b6 FW upload compression support, TS5700N8501 support 2019-12-05 19:50:17 +01:00
Benjamin Vedder 602db7435b FW3.59. Many updates, see changelog for details 2019-09-03 20:39:05 +02:00
Benjamin Vedder 30aabb77d7 Detect FOC fix, adc brake multi fix, make ppm pulses invalid above 150 percent 2019-07-01 17:17:49 +02:00
Benjamin Vedder a141e750bb Added CAN status msg 5, fixed issue 94, use defaul HW parameters after autodetect 2019-05-16 23:30:40 +02:00
Benjamin Vedder 404bbcf64b Fixed current offset fault bug, added support for multiple IMUs and ICM-20948 2019-05-03 19:55:36 +02:00
Benjamin Vedder 4a9fe93f41 Added support for storing hw-specific and custom variables in EEPROM 2019-04-19 10:42:43 +02:00
Marcos Chaparro 3c6083c34d Keep the flash memory locked during normal operation
Only unlock when it is necessary to write it. This prevents memory
corruptions caused by software or EMI glitches.

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-04-16 00:33:22 -03:00