Hi all, I am hoping to get some advice for current limiting on a project I am working on. The project is an electric vehicle which is run by an Arduino Due. The Due, or VCU, sends torque commands via CAN to the Inverter which drives an axial Flux AC motor. These torque commands are sent every 40ms. The systems works great but I have gotten to the point of the project where I would like to implement some battery current and voltage limits. The VCU receives a battery current reading every 100ms as well as other relevant battery information like cell voltages, temps, etc.
What I need to be able to do is to set a maximum current limit out of the battery where the VCU will limit the torque command to the inverter to keep from going over that limit. My idea is to have the VCU recall the last torque command and current measurement and if the current measurement is over my limit, then reduce the torque command by some amount until the current falls below the current limit or the throttle request from the pedal is reduced.
I am sure that there is a better, more robust way of doing this but I haven't found anything that really fits my application. I do not think a PID will work since the throttle input and torque commands are constantly varying and I am really only concerned with limiting the maximum current rather than trying to control the current all of the time.
I find it odd that you are asking this given what you have already done. If you are capable of doing all the things you mention then it seems to me a simple thing to compare the measured current to some limit and issue an appropriate command to reduce the torque.
I'm not going to begin to suggest code, partly because you've not posted any that I might suggest modifications to, and partly because even if I did see your code you know it far better than I ever could.
No, not missing anything. I get where you are coming from with that reply. I should have included that I had implemented a simple strategy of reading the current and reducing the torque commanded to compensate but the result wasn’t as smooth as I’d like and the actual current values would bounce back and forth above and below the current limit.
I was really just wondering if I was missing an obvious solution or if there was a tried and true method for this like a PID control scheme if I was targeting a specific value.
I am no expert on control loops. As far as I know, and someone more knowledgeable might read this and give you a better answer, if a control loop causes the controlled value to oscillate around the desired value then you need to attenuate the feedback. This will damp the oscillation but also slow the response. I think full PID will compensate for this, but I am at the limit of my knowledge on this.