Commit Graph

123 Commits

Author SHA1 Message Date
Benjamin Vedder 1b3e01e276 Flux linkage measurement tweaks 2022-12-04 14:21:15 +01:00
Benjamin Vedder fbd39c020c abs_max fix for dual motors 2022-12-02 09:55:50 +01:00
Benjamin Vedder 00a4cd9c17
Merge pull request #490 from TechAUmNu/set-abs-max
Set abs max to reasonable value during detection
2022-12-02 09:16:40 +01:00
Benjamin Vedder 1e7da25160 Send foc can detect result back to sender even if some other interface communicates in-between 2022-11-22 18:18:38 +01:00
Benjamin Vedder 7cacf99e09 Some cleanup 2022-11-08 18:21:06 +01:00
Benjamin Vedder 226c40cdb0
Merge branch 'master' into Improvements 2022-11-08 17:37:21 +01:00
Euan Mutch d06fce3ee4 Interface commands for openloop 2022-11-08 11:46:08 +00:00
Euan Mutch 7bf78592f7 Correct spaces to tabs, remove fault checks from low level funcs. 2022-11-08 10:46:35 +00:00
Benjamin Vedder 2b7e323481 Wait a bit longer for can detection result 2022-11-06 15:21:09 +01:00
Euan Mutch f77409c57b correct description of conf_general_detect_apply_all_foc
Fault code is returned as -100 + fault, to allow backwards compatibility. VESC Tool decodes the code and displays the text description during detection.

The terminal also does the same when manually running the command.
2022-09-27 22:12:05 +01:00
Euan Mutch f7a2e4c621 Fault handling, Terminal improvements and better flux linkage.
Add fault handling to all functions that touch the motor.
Improve terminal usability by echoing commands and giving feedback on faults and missing / invalid arguments.  Improve flux linkage measurement by increasing switching frequency and using the measured resistance and inductance to set the kp & ki.
2022-09-27 21:54:50 +01:00
Benjamin Vedder ff9679d336 Lisp code streaming, more native functions and checks, custom config support, moved global send buffer to mempools 2022-09-18 22:47:50 +02:00
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
Euan e115c853ff Set abs max during detection
ABS max is set to 1.5x motor current, truncated to hw limit.
2022-05-05 12:49:58 +01: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