This firmware (well 5.20.R also) in its FOC flavour is the first one to send current to your motor that is NOT related to your throttle input. If you use a poorly tuned syncofs or randomly play with syncadv your car will end up self-accelerating in the upper rev range. Before putting your car to regular use, make sure that is not the case. Be prepared to brake hard!
https://github.com/jsphuebner/stm32-sin ... ag/v5.24.R
No sine release this time as nothing relevant happened there.
- Removed curkifrqgain, it seems no longer needed and creates confusion
- Added binstream command (binary streaming of real time data)
- PWM overflow fix in FOC implementation
- Limit iq at the same rate that ifw is ramped up
- Limit id MTPA at the half the rate that ifw is ramped up
- Replaced field weakening controller with simple IIR filter which is smoother
- Do not disable PWM when stationary with Prius Gen2 inverter
- high inductance motors, such as Prius or MGR need also have higher winding resistance and this need high curkp, around 500 or so
- low inductance and thus low resistance motors need low curkp, around 50
- curki seems not to need the same amount of tweaking, I run the Prius motor with 10000 and the Leaf motor with 20000
- syncadv is always 10, I don't think there is a reason for changing it (not sure if it should even be a parameter)
- fwcurmax is the critical current needs some math or trial and error. I run -100A on the Prius and -500A on the Leaf motor
- vlimflt should be 10 or higher, maybe some extreme use cases need modifying this
- vlimmargin should be around 2000 (not sure if it should even be a parameter)
- fluxlinkage is used for MTPA, see example here: viewtopic.php?p=48358#p48358
- lqminusld needs measuring motor inductances (also somewhere in the IPM thread). Is set to 0 for SPM motors. For IPM motors, if you're too lazy to measure set to 1 or so. Might give away some efficiency and performance but not a huge bit