# Anyone good at math?



## bart_dood (Sep 2, 2010)

So I'm building my EV around two Honda IMA hybrid brushless BLDC motors and honda controllers, I found a paper from Oak Ridge national Laboratory on driving these motors and in it it talks about the current control feedback:

Quote:
 
"ORNL’s dynamometer test cell and Opal-RT-based speed and current feedback controller were adapted to
provide the torque needed at each reference speed. Thus, as the applied torque from the dynamometer
was varied manually, the controller regulated the torque producing current appropriately. The current
controller consists of two standard proportional-integral (PI) controllers for the direct and quadrature
currents,​​​​_id _and _iq _respectively. These _d-q _components are obtained by applying the _d-q _transformation to
the three-phase currents which have a fixed reference. The transformation converts the three-phase
currents into two-phase vectors, which have a reference that rotates with the rotor. Therefore, precise​
rotor position feedback is used during this transformation."

I'm not naturally a good mathhead so I'm trying to understand how this works. Are they saying that they use a PID loop to control the maximum current by measuring it during the different phases and then using that feedback to control the PWM on each phase to limit the current to some maximum value?

Or does it work by matching a control input (in this case current IE torque) required and adjusting the PWM to give that current output.

Hmmm confusing...I've written to the authors but I'm not sure they have the time to explain this to me....

http://info.ornl.gov/sites/publications/files/Pub2642.pdf


----------



## major (Apr 4, 2008)

bart_dood said:


> So I'm building my EV around two Honda IMA hybrid brushless BLDC motors and honda controllers, I found a paper from Oak Ridge national Laboratory on driving these motors and in it it talks about the current control feedback:
> 
> Quote:
> 
> ...


Hi bart,​ 
This isn't just math. It is the basic field oriented control (FOC). If you have to get into that, you might as well forgetaboutit. The "motor controller" software will take care of this. If it doesn't, you'll need to hire a team of engineers and PhDs. What you need to do is figure out the input to the motor controller required to produce a level of torque from the motor. Likely this will be a CAN message.​ 
I think I saw a web site once where some guys had hacked the IMA system. I'd look for something like that as opposed to learning quadrature current and Clark&Park transforms.​ 
Good luck,​ 
major​


----------



## gdirwin (Apr 7, 2009)

Major is correct - this is a standard field oriented controller.

The three phase ABC currents are rotating at a given frequency - a phase locked loop (PLL) tracks the frequency. The PLL angle is used in a DQ transformation - this converts 3 rotating quantities to 2 DC quantities: D axis and Q axis - you can think of them as the current that is in phase with the voltage (ie real power) and the current that is 90 degrees out of phase (reactive power).

The DQ signals (now DC signals) go into PI controllers, and adjust the firing modulation signals (ie the IGBT gate pulses) - think of the PWM converter as a voltage source, and you are manipulating the magnitude and phase of the voltage source. In reality it is applying and removing the DC voltage source on/off/on/off at a high frequency - it looks like a square wave at the IGBT terminals, but a valve reactor (and often a shunt capacitor) are used to filter out the high frequencies and leave you with nice clean fundamental frequency output from the converter...

This type of controller (and variations of it) are used in wind farms, voltage sourced converters for high power applications (MW), drive systems etc...

Opal is a real time simulator - most often used for small-scale hardware-in-the-loop testing. A more powerful version of this is called RTDS (real time digital simulator) and is the standard simulator used in very large power systems applications (VSC/HVDC etc...). These simulators model the differential equations of motors, loads, RLC electrical components, IGBTs etc... - they have D/A and A/D on them to interface to real hardware/controllers for real time testing.


----------



## bart_dood (Sep 2, 2010)

major said:


> Hi bart,​
> 
> This isn't just math. It is the basic field oriented control (FOC). If you have to get into that, you might as well forgetaboutit. The "motor controller" software will take care of this. If it doesn't, you'll need to hire a team of engineers and PhDs. What you need to do is figure out the input to the motor controller required to produce a level of torque from the motor. Likely this will be a CAN message.​
> I think I saw a web site once where some guys had hacked the IMA system. I'd look for something like that as opposed to learning quadrature current and Clark&Park transforms.​
> ...


Thanks, the motor controller I'll be trying to get to work uses simple low level PWM for each high/low phase with external dead time generation. It doesn't use anything fancy like a CAN bus. 
Each phase leg has a current sensor built into it with some conditioning electronics, I don't have the actual units in front of me (still waiting for shipping) so I don't know what their output is.

The motors also have commutator feedback sensors in them for position.

From what I understand I'll need to drive the PWM including dead time generation using the position feedback on when to switch signals, then use the current feedback as a reference to make sure I don't run too much current through the motor and saturate it, causing heat and lowering efficiency.


----------



## major (Apr 4, 2008)

bart_dood said:


> Thanks, the motor controller I'll be trying to get to work uses simple low level PWM for each high/low phase with external dead time generation.


Why not use the Honda controllers?



> The motors also have commutator feedback sensors in them for position.


That paper you linked (BTW, thanks, I hadn't seen that before) said they used a resolver.



> From what I understand I'll need to drive the PWM including dead time generation using the position feedback on when to switch signals, then use the current feedback as a reference to make sure I don't run too much current through the motor and saturate it, causing heat and lowering efficiency.


You may be able to get the motor to rotate with this approach, but I seriously doubt you could make a drivable system without FOC. Sounds like what you describe is scalar control and you need a vector controller.


----------



## bart_dood (Sep 2, 2010)

major said:


> Why not use the Honda controllers?
> 
> 
> 
> ...


I am using the honda controller, or at least one of them. The tasks are split between two controllers to drive the BLDC, there is a low level one that has logic gating and IGBT module driving and then there is a higher level one with a microprocessor in it that reads the current sensing and drives the lower level module.
The problem is the higher level module that has all the stuff pre-programmed into it requires a lot of fooling to make it believe its actually in a car, its looking for many different signals because it normally resides in a hybrid car with a gasoline motor.

I found a paper on current control of BLDC drives using feedback, in it it looks they they talk about reading the current on the fly and adjusting the PWM based off of it, I've attached a sample screen shot.
My clock frequency for the honda is going to be 12khz, will the current rise fast enough for me to measure it on the fly like this and adjust the PWM? I'll be using a microcontroller to control everything.
If I find I need more horsepower I can assign a different microcontroller just to monitor each current leg and do some processing on it before passing this data to the main MCU.


----------



## bart_dood (Sep 2, 2010)

Oh and I forgot, this current limiting should really only be a problem at full or near full throttle and especially from a standstill.

At higher speeds and with low throttle settings the current draw will be less and won't be in danger of causing saturation.


----------



## IamIan (Mar 29, 2009)

You might want to touch base with Mike D.
www.99mpg.com

He knows allot about the Honda IMA system.

He gets busy with allot of projects, but he is a good guy , and an excellent resource for Honda IMA technicals.

If you need something involved ... I have always known him to make fair deals.

Out of personal curiosity ... do you know what type of the Hona IMA you are considering using ??? From what HEV did it come from?


----------



## bart_dood (Sep 2, 2010)

IamIan said:


> You might want to touch base with Mike D.
> www.99mpg.com
> 
> He knows allot about the Honda IMA system.
> ...


 
Thanks, I've already met Mike in the past and e-mailed him about this. I think he is interested in understanding how to drive these honda controllers/motors but at the moment he is quite tied up with lots of projects.
His mima signal changes a signal to the high level electronics so bypasses the problems I have, he is still running a gasoline motor in his.

I bought two Insight IMA motors and two MDM controller/inverters off of ebay for my project, I expect them to arrive in my workshop sometime next week.


----------



## etischer (Jun 16, 2008)

Here is another analogy:

Picture the AC motor like a torque converter. You have an input shaft and an output shaft. The transmission fluid represents lines of magnetic flux.

Think of the torque converters "Input shaft speed" as the AC motors "commanded speed" based on the Inverters output of voltage and frequency. 
([email protected] usually corresponds to 1800 RPM).

Think of the torque converters "Output shaft speed" as "actual shaft speed" on an AC motor. It can be measured by an encoder, or it can also be derived by monitoring the phase shift of current. 
([email protected] usually corresponds to 1750 RPM). 


Input shaft speed - Output shaft speed = slip speed

just like

Commanded speed - Actual speed = slip speed​
Slip speed is proportional to torque. If you grab the output shaft of the torque converter and stop it with your hand, there is a certain slip speed which is producing a certain amount of torque. Increase the slip speed, you get more torque. 


If the output shaft is spinning at 1750 rpm, and you want positive torque, you command the inverter to output 1800rpm + slip, say 1810 rpm. If you want even more torque increase slip even more. If you want to slow the motor down, use negative slip.

The key to good torque control in an AC inverter is knowing the actual motor speed. This lets the inverter calculate just how much slip is required to produce the torque you want. If you call for too much slip, the motor might "skip a tooth" and stall out. 

The inverter needs to have enough current flowing through the motors windings to produce enough torque to prevent "skipping a tooth". Even when the motor is not turning, there is current flowing through the motor to allow it to produce torque. This current is controlled by a PID loop. There is a PID loop controlling the motor speed, there is also a PID loop controlling the slip (torque). 





gdirwin said:


> Major is correct - this is a standard field oriented controller.
> 
> The three phase ABC currents are rotating at a given frequency - a phase locked loop (PLL) tracks the frequency. The PLL angle is used in a DQ transformation - this converts 3 rotating quantities to 2 DC quantities: D axis and Q axis - you can think of them as the current that is in phase with the voltage (ie real power) and the current that is 90 degrees out of phase (reactive power).
> 
> ...


----------



## bart_dood (Sep 2, 2010)

etischer said:


> Here is another analogy:
> 
> Picture the AC motor like a torque converter. You have an input shaft and an output shaft. The transmission fluid represents lines of magnetic flux.
> 
> ...


I kinda see what your saying; however I was under the impression that BLDC motors had the controller phase exactly timed to the rotor position. Just like a brushed DC motor when the alignment is correct (IE the right phase lines up) the mosfets or IGBT's are fired to either attract or repel the rotor magnets.
In its most simplistic form this would just be a square wave, the mosfets or IGBT's would switch on 100% at the right time and then switch off (ignoring dead time effects).
However this would not allow throttling, in order to throttle you could actually keep the duty cycle effectively 100% like the example above but instead vary the supply voltage. In practice it is easier to keep the voltage the same but pulse width modulate it to accomplish the same thing.
The issue with BLDC motors is the peak currents that are pulled from a standstill especially with a car which is quite heavy, without some kind of current control if you floored the throttle you would pull a huge peak current and blow the fet stage, when moving the phases pass by much more quickly so its more practical to have less current control or none at all, at some point you can switch the voltage on 100% and before the current even gets close to a high value you are off on the next phase.

The other thing to avoid is saturation, at some current point you can keep increasing the current but you will get little in the way of more magnetic flux, at this point the efficiency of the motor drops.

I'm still learning about all of this so please forgive me if I sound off base.

When you say 'commanded speed' this would work for a lightly loaded motor, however in a vehicle the throttle does not control speed/rpm it merely controls power, power is a function of torque and rpm so really the throttle is like a torque control.
Torque is proportional to current on a motor, so in varying the duty cycle on each pulse we are really controlling the integrated current across that pulse, integrated because it does not form a simple pulse due to the inductance of the coils.


----------



## etischer (Jun 16, 2008)

Yes, you are right, BLDC motors need an encoder for commutation, I missed the BLDC part, sorry =) 



bart_dood said:


> I kinda see what your saying; however I was under the impression that BLDC motors had the controller phase exactly timed to the rotor position. Just like a brushed DC motor when the alignment is correct (IE the right phase lines up) the mosfets or IGBT's are fired to either attract or repel the rotor magnets.
> In its most simplistic form this would just be a square wave, the mosfets or IGBT's would switch on 100% at the right time and then switch off (ignoring dead time effects).
> However this would not allow throttling, in order to throttle you could actually keep the duty cycle effectively 100% like the example above but instead vary the supply voltage. In practice it is easier to keep the voltage the same but pulse width modulate it to accomplish the same thing.
> The issue with BLDC motors is the peak currents that are pulled from a standstill especially with a car which is quite heavy, without some kind of current control if you floored the throttle you would pull a huge peak current and blow the fet stage, when moving the phases pass by much more quickly so its more practical to have less current control or none at all, at some point you can switch the voltage on 100% and before the current even gets close to a high value you are off on the next phase.
> ...


----------



## major (Apr 4, 2008)

bart_dood said:


> The other thing to avoid is saturation, at some current point you can keep increasing the current but you will get little in the way of more magnetic flux, at this point the efficiency of the motor drops.


Hey bart,

You have a permanent magnet (PM) motor. The field is set by the magnets. The field is, for practical purposes, constant. While it is possible to have an armature current high enough to saturate the tooth, this condition would be so far above the allowable range it would demagnetize a good portion of the PM and, such a high level of current would undoubtedly be well beyond the capabilities of a reasonably sized drive.

If you see saturation in a PM motor, either there is a design flaw in the motor, or you have other problems which have permanently damaged the motor.

Regards,

major


----------



## IamIan (Mar 29, 2009)

bart_dood said:


> Thanks, I've already met Mike in the past and e-mailed him about this. I think he is interested in understanding how to drive these honda controllers/motors but at the moment he is quite tied up with lots of projects.
> His mima signal changes a signal to the high level electronics so bypasses the problems I have, he is still running a gasoline motor in his.
> 
> I bought two Insight IMA motors and two MDM controller/inverters off of ebay for my project, I expect them to arrive in my workshop sometime next week.


I have MIMA in my Insight ... If you have an MDM for each IMA motor, you might be able to use a MIMA system to give the MDM the signal it wants to move the way you want.

If you cut the gasoline from going to a Gen-I Insight like mine that is equipped with MIMA, you can drive the IMA motor to full assist or full regen ... or you don't need the ICE for the IMA+ MDM+ MIMA to work.

Mike offers pre-built , tested, and upgraded MIMA systems for sale ... but if you are handy with electronics the basic schematic he put up on-line , so you could build it just for the cost of parts and your time... one MIMA should be able to work both MDMs simultaneously.

Of course if you are trying to get a ... bit more under the hood ... so to speak ... than figuring out the motor controller would be a must at some point ... another informed guy ( who of course is also very busy with personal projects ) about the Gen-I Insight IMA motor system is Peter P. one of his many projects is over driving the IMA motor past the OEM 10kw... if you haven't already you might also want to touch base with him as well ... but he like Mike is also busy with lots of projects.

http://www.solarvan.co.uk/


----------



## bart_dood (Sep 2, 2010)

IamIan said:


> I have MIMA in my Insight ... If you have an MDM for each IMA motor, you might be able to use a MIMA system to give the MDM the signal it wants to move the way you want.
> 
> If you cut the gasoline from going to a Gen-I Insight like mine that is equipped with MIMA, you can drive the IMA motor to full assist or full regen ... or you don't need the ICE for the IMA+ MDM+ MIMA to work.
> 
> ...


This is ground I've already covered with Mike, the MIMA sends a signal to the MCM not the MDM, Mike's signal drive is relatively simple and would be easy for me to reproduce. The MDM is a dumb box that needs a higher level controller to function, normally the MCM.

The MCM requires fooling into believing its still operating in a gasoline car, a lot of reverse engineering, plus I don't have a working insight to measure signals from.

I've already spoke to Peter, he send me the pdf of the accord IMA report.

thanks


----------

