casainho said:
So I want to implement limit max motor and battery currents. Do you guys know if I should do also limit battery and motor max currents? -- because before I were just limiting battery current for regen...
After last lizardmech's post I wonder how does the ouput of the shunt look like, will get an osciloscope. Suggestions? Would like USB to PC app only.
Anyway to your question since until now you was succesfully limiting DC - battery current to set value, can stay same for now. Is it using filtered value or not? If filtered, it should use not filtered and filter by fw so theres no delay at start..?
Phase current - I dont know which way you want
The simple calculation phase/pwm=battery
or some calculation from 1 phase hall (not good enough)
Or maybe shunt reads phase current combined and we were limiting just phase current? (I dont believe that beacuse starting torque will be low)
Geoft has probably tested more than me so he can tell and say what Amp setting he used vs stock
Or maybe stock fw reads shunt phase current combined and calculates battery current the simple way, but then no way battery current limit can work now since you wrote the code so you know what it does?
I am thinking where is the change happening from 10 battery amps to 30 phase amps, if 30A is top of sine wave, possibly capacitors taking care of that, so when shunt is between caps and fets it sees phase current combined then? Not battery current that should be measured before capacitors?
I see a lot of good info in lizardmech's post, maybe he can help.
Am I wrong that everytime there is a current to motor it goes through one low side and one high side mosfet?

If Iam right then lizardmech is wrong in that part about combined phase current not being able to detect short (overcurrent in normal use)
All above just my assumtions, not knowlege.
Hope it hepls and I would like someone to review and discuss.
Edit: if stock fw limits phase current combined only, I lived in a lie

will test well tomorow