Commit Graph

162 Commits

Author SHA1 Message Date
Benjamin Vedder afe85a2937 Handle different max and min currents in braking mode 2021-11-27 16:38:32 +01:00
Benjamin Vedder b524773c0d Another attempt at braking 2021-11-27 10:58:52 +01:00
Benjamin Vedder 76b4f58e4e Another attempt at braking smoothly to 0 2021-11-26 00:43:41 +01:00
Andrej Vlašić 132c603699 Use the same minimal temp value for Temperature compensation 2021-11-24 12:18:29 +01:00
Benjamin Vedder f6e78a09b6 Fixed measured MTPA mode, send ld_lq_diff detection result 2021-11-21 18:17:40 +01:00
Benjamin Vedder fff18eb76b Reset PID controller filters when not running to avoid start glitch 2021-11-15 21:29:05 +01:00
ElwinBoots 78065cf74d SVM sign fix
The original SVM code output was 1-dutycycle instead of dutycycle.
To make the math correct this was "corrected" by having the mod_alpha and mod_beta inputs negative.
This code now instead really fixes the output to dutycycle. Now the input should not be taken negative anymore.
2021-11-13 21:51:20 +01:00
Benjamin Vedder cb84c94788 Disable HFI start in braking mode 2021-11-08 22:48:15 +01:00
Kenn Sebesta 67738328cb [SVM] Comment the function API 2021-11-07 18:21:23 -05:00
Benjamin Vedder bc63a3127a Added q-axis modulation filter and use it for input current limits 2021-11-07 23:00:48 +01:00
Kenn Sebesta 80adea0336 [MCPWM_FOC] Condense math in order to save on FPU operations 2021-11-07 09:01:54 -05:00
Kenn Sebesta 6dbea7ed86 [MCPWM_FOC] Eliminate repeated divisions
`/((2.0/3.0) * v_bus)` is the same as `* 1.5/V_bus`. Abstracting this out
saves at least one division per loop, and in some cases as many as three.

Each STM32F4 FPU division takes 14 cycles.
2021-11-07 07:35:08 -05:00
ElwinBoots bbb8a3d6a8 Added comments to the current loop 2021-11-05 07:32:08 +01:00
Benjamin Vedder d79d12a489 Fixed braking mode 2021-10-31 21:51:40 +01:00
Benjamin Vedder 78e750a338 Scale down measured inductance. Read the comment for details. 2021-10-31 17:47:09 +01:00
Benjamin Vedder 5304872a92 Added missing bracket from PR 2021-10-31 09:35:52 +01:00
Kenn Sebesta d97793bf7b
Update mcpwm_foc.c
Co-authored-by: kalvdans <github@kalvdans.no-ip.org>
2021-10-27 14:14:27 -04:00
Kenn Sebesta 0e58e29072 [MCPWM_FOC] Fix mislabeled variable
It's not estimated RPM, it's estimated rad/sec.
2021-10-27 14:09:10 -04:00
Kenn Sebesta 8de85899b7 [Convenience math] Capture a last couple laggards which were missed earlier 2021-10-27 14:08:35 -04:00
Benjamin Vedder 78887f35cf Added link to forum post as comment to explain factor 4 2021-10-25 12:39:54 +02:00
Benjamin Vedder f1c4e713d7 Added MTPA modes 2021-10-24 18:10:00 +02: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 8cf082e0e0 Better bus current estimation, HFI max voltage and duty scaling fix 2021-10-16 12:54:33 +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 86cbc92b8d Fixed regression in sensorless braking 2021-08-20 21:36:44 +02:00
Benjamin Vedder 4603ff5d4e Change filtered duty cycle to absolute value 2021-08-16 20:33:26 +02:00
Benjamin Vedder 741dd2b38a Speed PID fixes 2021-07-14 19:59:34 +02:00
Benjamin Vedder 3c88ecb7aa Added configurable PID loop rate and more AUX port modes 2021-07-12 14:31:01 +02:00
Benjamin Vedder 804f49b2a8 Moved position control loop to 1 khz timer 2021-07-11 21:10:14 +02:00
Benjamin Vedder 1ab25a47db Added position PID offset support and KD_PROC term 2021-07-11 20:19:26 +02:00
Benjamin Vedder 75b84f1f2d Added kill switch support 2021-06-13 13:46:27 +02:00
Benjamin Vedder 93b405add9 Merge branch 'master' into dev_fw_5_03 2021-05-24 08:49:05 +02:00
Benjamin Vedder 3d2aad0977 Take current limit into account when going to full brake 2021-05-20 18:13:40 +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 c30a93119a Wait for input voltage to rise and settle before attempting offset calibration at boot 2021-05-13 11:45:30 +02:00
Chas Leichner 3aaaeaf3a3 Correct spelling, broken links, and missing parameters in documentation 2021-05-07 15:27:50 -07:00
Benjamin Vedder 0d6a9824e4 Use fast speed tracker for BEMF decoupling 2021-05-07 09:47:45 +02:00
Benjamin Vedder 7a0e560e8b Lowpass filter input voltage and battery level 2021-04-27 17:48:15 +02:00
Benjamin Vedder f25144cc30 Removed iterative observer, added p_pid_gain_dec_angle 2021-04-26 23:14:05 +02:00
Benjamin Vedder 99b0cb79d2 Limit hall sensor angle rate of change based on ERPM 2021-04-26 17:57:49 +02:00
Benjamin Vedder 14b25e9aa4 Added foc_fw_q_current_factor 2021-04-15 10:04:28 +02:00
Benjamin Vedder ac360ae7f6 Give D-axis current priority when limiting current, added mcpwm_foc_set_current_off_delay 2021-04-14 22:29:50 +02:00
Benjamin Vedder 3d57ed2f06 Cleanup 2021-04-11 19:38:55 +02:00
Benjamin Vedder 9a00234346
Merge pull request #282 from powerdesigns/ipm_bemf_decoupling
bemf_decoupling: improved math for IPM motors.
2021-04-11 19:36:35 +02:00
Maximiliano Cordoba c7819a8722 speed_pid: improved integral term antiwindup.
-we feedback the output saturation to the integral term to improve the antiwindup mechanism.

Signed-off-by: Maximiliano Cordoba <mcordoba@powerdesigns.ca>
2021-04-11 11:59:22 -03:00
Maximiliano Cordoba fbd35f15ad bemf_decoupling: improved math for IPM motors.
-In IPM motors (ld_lq_diff > 0) Ld affects in the Q axis, and Lq affects in the D axis.

Signed-off-by: Maximiliano Cordoba <mcordoba@powerdesigns.ca>
2021-04-11 10:51:09 -03:00