My homebuilt VFD progress

AC, DC, amps, volts and kilowatt. It's all discussed in here
User avatar
BigMouse
Senior Member
Posts: 600
Joined: Thu, 28 Oct 2010, 02:39
Real Name: Vincent Tannahill
Location: Silicon Valley
Contact:

My homebuilt VFD progress

Post by BigMouse » Thu, 16 Jun 2011, 18:15

Hey guys,

As I mentioned in my intro post on the general discussion forum, I'm designing and building my own 3-phase motor controller. I've made some progress on it today and put a quick video up on youtube I thought I'd share. Enjoy.

http://www.youtube.com/watch?v=rnhwFFOgYAE

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

My homebuilt VFD progress

Post by Johny » Thu, 16 Jun 2011, 18:31

Nice going Vincent. Motor turning with no smoke escaping - I'm impressed!

a4x4kiwi
Senior Member
Posts: 772
Joined: Thu, 03 Jan 2008, 19:04
Real Name: Malcolm Faed
Location: Australia
Contact:

My homebuilt VFD progress

Post by a4x4kiwi » Thu, 16 Jun 2011, 19:54

Well done! brilliant.
Would you be able to describe the various parts of the drive?
IGBT model and rating, microcontroller, firmware availability etc?.

Cheers,
Mal.
Silicon is just sand with attitude.

Blog: http://malfunction.faed.name

User avatar
woody
Senior Member
Posts: 1715
Joined: Sat, 21 Jun 2008, 02:03
Real Name: Anthony Wood
Location: Mt Colah

My homebuilt VFD progress

Post by woody » Thu, 16 Jun 2011, 20:19

Very nice!
Planned EV: '63 Cortina using AC and LiFePO4 Battery Pack

User avatar
BigMouse
Senior Member
Posts: 600
Joined: Thu, 28 Oct 2010, 02:39
Real Name: Vincent Tannahill
Location: Silicon Valley
Contact:

My homebuilt VFD progress

Post by BigMouse » Thu, 16 Jun 2011, 20:53

a4x4kiwi wrote: Would you be able to describe the various parts of the drive?
IGBT model and rating, microcontroller, firmware availability etc?.


Sure, to some extent.

The controller consists of a number of modules at this point:
-IGBT Date drive power supply (SMPS-based on off-the-shelf components to keep cost down and reliability up)
-3-phase waveform generator IC (Currently using an MC3PHAC, but changing to an AVR due to lack of customisation of the current chip)
-Sensing, control, and driver interface (currently an arduino board with optoisolated ADC chips for voltage sensing).
-precharge relay, DC-DC converter relay, and main contactor driver

The arduino takes driver input, compares it to the conditions it senses, and adjusts the inverter parameters to suit. It also controls startup and shut-down sequencing, safety features (high pedal lockout, reverse speed limiting, etc), and instrumentation (not there yet).

The IGBT in there right now is a Powerex CM200TU-12F 200a 600v hex module. The final version will use three of their 300A dual modules.

Firmware: availability of that will depend on how much success I have with it (it's still very early in its development) and whether or not I decide to try to go commercial with my design. My plans for this controller are pretty ambitious and once the hardware is ironed out (I'm pretty much there), the bells and whistles will all be in the software.

I've pretty much reached the limit of testing that I can do with the little 370W motor I have. It barely draws enough current at full load (1.7A) to register on the 50A current sensor I'm using (final version will have 2x200A versions of this sensor).

User avatar
woody
Senior Member
Posts: 1715
Joined: Sat, 21 Jun 2008, 02:03
Real Name: Anthony Wood
Location: Mt Colah

My homebuilt VFD progress

Post by woody » Fri, 17 Jun 2011, 17:22

I've got an 11kW 2 pole 415V you can borrow, and the engine whisperer (not sure of username) has a few you could buy for ~$100.
Planned EV: '63 Cortina using AC and LiFePO4 Battery Pack

a4x4kiwi
Senior Member
Posts: 772
Joined: Thu, 03 Jan 2008, 19:04
Real Name: Malcolm Faed
Location: Australia
Contact:

My homebuilt VFD progress

Post by a4x4kiwi » Fri, 17 Jun 2011, 22:22

Thanks for the explanation.

Just curious that you mention 2 current sensors.

Are these on the motor phases? The VFDs I have used tend to have 3 sensors. This way they can sense fault conditions (Sum of currents in 3 phases should = 0)
If there is an earth or winding fault, any current imbalance would cause the drive to trip with an error code.
Silicon is just sand with attitude.

Blog: http://malfunction.faed.name

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

My homebuilt VFD progress

Post by Johny » Fri, 17 Jun 2011, 22:39

a4x4kiwi wrote: Thanks for the explanation.

Just curious that you mention 2 current sensors.
The Lenze VFDs only use two. The third phase current can be calculated from the other two.

User avatar
BigMouse
Senior Member
Posts: 600
Joined: Thu, 28 Oct 2010, 02:39
Real Name: Vincent Tannahill
Location: Silicon Valley
Contact:

My homebuilt VFD progress

Post by BigMouse » Sat, 18 Jun 2011, 00:22

a4x4kiwi wrote: Thanks for the explanation.

Just curious that you mention 2 current sensors.

Are these on the motor phases? The VFDs I have used tend to have 3 sensors. This way they can sense fault conditions (Sum of currents in 3 phases should = 0)
If there is an earth or winding fault, any current imbalance would cause the drive to trip with an error code.


At the moment, the plan is to have the two 200A current sensors sense battery current and would be placed in parallel so that a total of 400a could be measured. I know this probably isn't the proper way to do it, but since I'm not relying on vector mode for torque control, (to maximise compatibility with a range of motors), I'm hoping I can get away with it.

User avatar
BigMouse
Senior Member
Posts: 600
Joined: Thu, 28 Oct 2010, 02:39
Real Name: Vincent Tannahill
Location: Silicon Valley
Contact:

My homebuilt VFD progress

Post by BigMouse » Tue, 21 Jun 2011, 05:26

Can somebody identify or put me in touch with this "engine whisperer" woody mentioned? If he does have some inexpensive 3-phase motors I could pick up for testing, I'd be interested (assuming they have low voltage 220-240v windings).

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

My homebuilt VFD progress

Post by Johny » Tue, 21 Jun 2011, 15:03

BigMouse wrote: Can somebody identify or put me in touch with this "engine whisperer" woody mentioned? If he does have some inexpensive 3-phase motors I could pick up for testing, I'd be interested (assuming they have low voltage 220-240v windings).
This is his website, there is a Contacts tab: http://www.enginewhisperer.com/wp/?cat=44

bga
Senior Member
Posts: 492
Joined: Mon, 01 Sep 2008, 19:27
Real Name: Bruce Armstrong
Location: Perth WA

My homebuilt VFD progress

Post by bga » Wed, 22 Jun 2011, 21:02

Hi Bigmouse

Good to see that there are other crazies around doing their own motor 3 phase controllers.

I am using the Microchip DSPIC 6010A, which I would reccomend because it has good computational performance and some 3ph IM applications already written that should speed the development process.

On the current sensor front, two of the three phase outputs will require current sensing (up to 450A peak?) and simultaneous 2-channel sampling to be able to measure them infer the third phase current accurately. Commercial products meeasure all three, but the PIC can only sample two simultaneously. An alternative would be to run the phase (or battery!) wires through a big bore hall sensor to get the earth leakage current.

The battery current will not be very high, it is limited by the 40AH battery capabilities, so will be typically 20-30 amps and 120-150 amps maximum.

I was fairly conservative around the link and bypass capacitors, opting for high performance plastic film types instead of the usual electro. Search for "EACO Capacitor" (www.eaco.com.cn)

The (unlisted) SHD type looks to be similar to their SHP, but has slightly thicker metal in the plates and better RMS capability per V/C combination. Also from them are the snubbers for the Powerex CM300DY-24H modules I have.

Don't know where the SHD type info has gone to on their web pages.
- you may have to inquire.

With 140 x TS cell, the peak voltages can exceed 600 volts when a bit of inductance and high currents are added in. I would suggest that 1200 volt semiconductor components are more suitable. The design I am working with should tolerate 750 volts with no ill effects.
My 40AH battery will be 512 volts with an option to extend it to 563 volts.


There is a reference project that was done a few years back:

Circuit cellar article here

It looks to be 1/2 completed, but is a start. I downloaded their software and compared it to the Microchip reference design. It was almost the same with additions for their communications. I thought a month or so of evening work to turn the reference application into a useful industrial quality driver application.
It's not the end of the world, but I can see it from here.

User avatar
BigMouse
Senior Member
Posts: 600
Joined: Thu, 28 Oct 2010, 02:39
Real Name: Vincent Tannahill
Location: Silicon Valley
Contact:

My homebuilt VFD progress

Post by BigMouse » Thu, 23 Jun 2011, 00:34

Thanks for the info.

The AVR I've got my eye on (and have been playing with) also has some code written for it, but unfortunately it doesn't seem to work with the latest version of the compiler/IDE it was written for.

I have already invested in AVR hardware and programmers, plus my Uni uses AVRs in the digital hardware courses that I'll be taking.

The hex IGBT I'm using now is for simplicity as I develop my controller. The enclosure, heatsink, and driver is sized for the CM300DU-24F modules I have and am planning to use in the final version. They are rated to 1200v.

The space vector method certainly seems to be a higher performance option, and the AVR I'm using is capable of it as well, but I'm still getting my head wrapped around the code for the V/F method. I want to master it before moving up to space vector. From the research I've done, the method I plan to use (relating battery current to torque) will work, but may have slower response. I'm okay with that for now, and if it works out okay I may stick with it for cost reduction reasons.

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

My homebuilt VFD progress

Post by Johny » Thu, 23 Jun 2011, 04:33

BigMouse wrote:From the research I've done, the method I plan to use (relating battery current to torque) will work, but may have slower response.
I would think that motor current is much more closely related to torque. Using battery current would be extremely difficult as it depends on motor speed.

User avatar
BigMouse
Senior Member
Posts: 600
Joined: Thu, 28 Oct 2010, 02:39
Real Name: Vincent Tannahill
Location: Silicon Valley
Contact:

My homebuilt VFD progress

Post by BigMouse » Thu, 23 Jun 2011, 05:42

You're probably right, I'll write my thinking and hopefully you guys can tell me if I'm making incorrect judgements and guide me in the right direction.

Sum of currents in a 3-phase motor equals zero (for equal load in each phase). This is because at any given point in the rotation, currents are flowing in different directions and magnitudes (some being negative). Correct?

If that is true, then the sum of the absolute values of the currents in each phase should equal the total current into the 3-phase bridge. This would be the "battery" current (with the capacitors on the battery side of the current sensor).

Because the magnitude of the total current determines the strength of the magnetic field (and the resulting torque), it seems that "battery" current should have a direct relationship to torque.

I'll stop there, before I go making too much of a fool of myself.

Does it work this way?

User avatar
coulomb
Site Admin
Posts: 3780
Joined: Thu, 22 Jan 2009, 20:32
Real Name: Mike Van Emmerik
Location: Brisbane
Contact:

My homebuilt VFD progress

Post by coulomb » Thu, 23 Jun 2011, 13:31

BigMouse wrote: If that is true, then the sum of the absolute values of the currents in each phase should equal the total current into the 3-phase bridge. This would be the "battery" current (with the capacitors on the battery side of the current sensor).

You've taken care of the capacitor's current, but not that of the inductors (in the motor usually) or the "freewheel diodes" (at all time, one of the switches acts like a freewheeling diode). The inductors (or motor windings) store significant energy, so current can be going into or out of the inductors, and circulating in the motor loops.

Remember that each phase output is like a DC controller, each of which is like a "DC transformer". Consider that at low speed, the motor current can easily be ten times the battery current. Adding the absolute values of the motor currents will show a lot more current than the DC bus current.

[ Edit: also, as far as I can see, the concept of taking the absolute values of the currents and adding them, to avoid the fact that they go to zero, is invalid. Currents do have signs, and they can't be ignored. ]
Last edited by coulomb on Thu, 23 Jun 2011, 03:37, edited 1 time in total.
Nissan Leaf 2012 with new battery May 2019.
5650 W solar, 2xPIP-4048MS inverters, 16 kWh battery.
1.4 kW solar with 1.2 kW Latronics inverter and FIT.
160 W solar, 2.5 kWh 24 V battery for lights.
Patching PIP-4048/5048 inverter-chargers.

User avatar
coulomb
Site Admin
Posts: 3780
Joined: Thu, 22 Jan 2009, 20:32
Real Name: Mike Van Emmerik
Location: Brisbane
Contact:

My homebuilt VFD progress

Post by coulomb » Thu, 23 Jun 2011, 15:01

I'm always suspicious of clever ideas that decades of experts seem not to have discovered. But it seems to me that the idea, slightly modified (or maybe this was intended all along) may have merit.

I noted the transformer action, but of course full motor current is seen by the main capacitor. There are too many snubbers to measure, so their effect has to be ignored. But when only one phase has the upper switch on, and this may be only for a microsecond, it seems to me that the capacitor and battery current positive lead is equal to instantaneous motor current.
Nissan Leaf 2012 with new battery May 2019.
5650 W solar, 2xPIP-4048MS inverters, 16 kWh battery.
1.4 kW solar with 1.2 kW Latronics inverter and FIT.
160 W solar, 2.5 kWh 24 V battery for lights.
Patching PIP-4048/5048 inverter-chargers.

User avatar
BigMouse
Senior Member
Posts: 600
Joined: Thu, 28 Oct 2010, 02:39
Real Name: Vincent Tannahill
Location: Silicon Valley
Contact:

My homebuilt VFD progress

Post by BigMouse » Thu, 23 Jun 2011, 16:19

Good point about the motor windings storing energy. When you say that motor current is many times battery current at low speed, are you referring to actual rotor speed, or low frequency?

My torque control method will depend on a direct (not nessecarily linear) relationship between motor torque and battery/capacitor current. If such a relationship does exist, my method should be possible.
coulomb wrote:also, as far as I can see, the concept of taking the absolute values of the currents and adding them, to avoid the fact that they go to zero, is invalid. Currents do have signs, and they can't be ignored.

The absolute value idea was just a way to relate battery current to motor current. As I'm not actually measuring the phase currents, no such math is actually being performed. The reason I suggest that the concept is valid is because, due the the nature of the 3-phase bridge, regardless of the direction of current flow in the motor, if the motor is acting as a load, current will be flowing in one direction from the battery/capacitors (proportional to torque). The current direction would be opposite when the motor is acting as a generator (also proportional to torque).

My reason for using this method is mainly to reduce complexity, component count, and component cost in my controller. I understand that it may sacrifice response time and/or performance, but it should still result in a driveable EV at much lower cost than existing controllers.

That's my hope at least. Of course, development will continue. I'm learning as I go (the reason why this project has taken 3 years to get to this point). Image

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

My homebuilt VFD progress

Post by Johny » Thu, 23 Jun 2011, 16:47

BigMouse wrote: The absolute value idea was just a way to relate battery current to motor current.
As an example at say 50 RPM (a few km/h) your battery current may be 3 Amps while your motor current (per phase) might be 50 Amps. As your approach the knee in the torque curve, motor current and battery current would be a lot closer - say 40 Amps battery current for 50 Amps motor current.
Think of it in power terms. At one 30th of rated motor speed and thus voltage, the current is close to 30 times LESS at the battery.
Whilst being a bit more complicated, as coulomb says, it's similar to the buck convertor used in DC motor controllers.
Battery power in = motor power out. The current varies widely from battery to motor at less than rated speed.

You could take into account motor RPM but by then it would be easier to compare actual motor RPM via a shaft encoder to applied frequency (applied RPM) and control slip. Slip being directly related to torque.

This was the approach I was considering with the MC3PHAC way back here.
viewtopic.php?keywords=MC3PHAC&p=7875&t=585#p7875

Edit: knee not knew
Last edited by Johny on Thu, 23 Jun 2011, 06:48, edited 1 time in total.

User avatar
Johny
Senior Member
Posts: 3729
Joined: Mon, 23 Jun 2008, 16:26
Real Name: John Wright
Location: Melbourne
Contact:

My homebuilt VFD progress

Post by Johny » Thu, 23 Jun 2011, 16:55

Here's some posts that explain the MC3PHAC approach a little better:
viewtopic.php?keywords=MC3PHAC&t=967&p=9636#p9636

a4x4kiwi
Senior Member
Posts: 772
Joined: Thu, 03 Jan 2008, 19:04
Real Name: Malcolm Faed
Location: Australia
Contact:

My homebuilt VFD progress

Post by a4x4kiwi » Thu, 23 Jun 2011, 16:58

Think of the inverter as acting like a buck converter. The field winding is the inductor and the load.

So for example when starting under mechanical load, the DC battery voltage might be say 100V and current of 1A. On the motor side it is a different story. The motor current might be 100A and 1 volt. (or a bit less with losses. )

This was evident on my VFD in the ute.

Only after you reach the RPM of the constant power point where increasing RPM, the power is constant and torque diminishes with an inverse ^2 does the battery voltage and current equal the motor voltage and current.

I guess this is why it is called an inverter.

Regards,
Mal
Silicon is just sand with attitude.

Blog: http://malfunction.faed.name

User avatar
coulomb
Site Admin
Posts: 3780
Joined: Thu, 22 Jan 2009, 20:32
Real Name: Mike Van Emmerik
Location: Brisbane
Contact:

My homebuilt VFD progress

Post by coulomb » Thu, 23 Jun 2011, 16:59

BigMouse wrote: When you say that motor current is many times battery current at low speed, are you referring to actual rotor speed, or low frequency?
Err, they're usually within a few percent of each other. But I meant low rotor speed, so there is low back EMF, so the voltage across the motor coils is low, so the difference between RMS battery current and RMS motor current is large. Of course, when there is such a difference, the capacitor is supplying most of the full motor current for a short part of the PWM cycle (and the battery charges the capacitor for the rest of the cycle at much lower current).
The reason I suggest that the concept is valid is because, due the the nature of the 3-phase bridge, regardless of the direction of current flow in the motor, if the motor is acting as a load, current will be flowing in one direction from the battery/capacitors (proportional to torque).
But as noted earlier, circulating currents, which the battery won't see, also produce torque.
My reason for using this method is mainly to reduce complexity, component count, and component cost in my controller.
Well, you will need one large hall effect current sensor instead of two, but that will still save some $50-$100 I guess; those things aren't cheap. Or maybe on the DC side you could arrange resistive current measuring, for better long term stability and lower cost. It might make sense to put the current shunt in the negative supply lead, and measure only when only one lower switch is on. You will need to keep the wires short and low inductance between the capacitor bank and the IGBTs. Definitely don't use a wirewound resistor; it will have way too much inductance. It sounds dodgy to me, but I'll be interested to see how you go.
I'm learning as I go (the reason why this project has taken 3 years to get to this point). Image

Three years? Wow. That's almost as bad as some MX-5 builders I know. They're coming up to 2.5 years, and are using an off-the-shelf controller Image . I hope it all works out; I'm sure you'll have leaned a heap no matter what happens.
Nissan Leaf 2012 with new battery May 2019.
5650 W solar, 2xPIP-4048MS inverters, 16 kWh battery.
1.4 kW solar with 1.2 kW Latronics inverter and FIT.
160 W solar, 2.5 kWh 24 V battery for lights.
Patching PIP-4048/5048 inverter-chargers.

User avatar
BigMouse
Senior Member
Posts: 600
Joined: Thu, 28 Oct 2010, 02:39
Real Name: Vincent Tannahill
Location: Silicon Valley
Contact:

My homebuilt VFD progress

Post by BigMouse » Thu, 23 Jun 2011, 17:10

Johny wrote:
BigMouse wrote: The absolute value idea was just a way to relate battery current to motor current.
(..)
Think of it in power terms. At one 30th of rated motor speed and thus voltage, the current is close to 30 times LESS at the battery.
Whilst being a bit more complicated, as coulomb says, it's similar to the buck convertor used in DC motor controllers.
Battery power in = motor power out. The current varies widely from battery to motor at less than rated speed.


That makes sense. The relationship is there and as a result, torque could be modelled as a function of battery current and motor rpm.

Perhaps the motor rpm could be estimated by relating battery current at a given frequency to slip. That would allow an equation to be created expressing torque as a function of battery current and frequency. I'll have to play with combining some formulas.
Johny wrote:You could take into account motor RPM but by then it would be easier to compare actual motor RPM via a shaft encoder to applied frequency (applied RPM) and control slip. Slip being directly related to torque.
I plan to sample the speedometer drive pulses from the rear diff for cruise control. I wonder if the resolution of that signal would be high enough for the method you suggest, since the motor will be directly driving the diff.

Also, I was considering using an encoder to drive the speedometer for conversions in cars where the speedo signal is lost as a result of removing the transmission. If so, the slip control method could be implemented, but the cost increases.

bga
Senior Member
Posts: 492
Joined: Mon, 01 Sep 2008, 19:27
Real Name: Bruce Armstrong
Location: Perth WA

My homebuilt VFD progress

Post by bga » Thu, 23 Jun 2011, 19:10

Hi Bigmouse and all,

No wonder I couldn't do a post last night - all this activity. It's good to see.

BMWs have the speedometer sensor on the diff housing :)

ACMotor did some experiments on RedSuzi with a shaft sensor. One version I saw looked like a castlated nut with about 8 poles. At low speed it produced an effect like a broken CV joint with pronounced cogging and shake each time the controller received another pulse from the sensor. This disappeared above about 15 kph.

The diff sensor is probably very similar and will have the added problem that it is at the end of a long shaft with uni joints, rubber buffers and gears in it, making the effect more severe.

Generally, the controller makers suggest sensors in the range of 500 pulses per rev to overcome this sort of issue.

In another thread, I identified an IC that should make high resolution shaft sensing a $50 problem for 1000 PPR class sensing. I will try this IC in due course, but don't see any reason that it won't work nicely.
(here)

Once there is a shaft sensor, the controller has access to really good speed information. If there's no gearbox to worry about, cruise control should be straight forward.


Microchip has a SVM application in 'C' for the DSPICs. There are some application notes that help explain it as well. It may be a good source of inspiration.
It's not the end of the world, but I can see it from here.

User avatar
BigMouse
Senior Member
Posts: 600
Joined: Thu, 28 Oct 2010, 02:39
Real Name: Vincent Tannahill
Location: Silicon Valley
Contact:

My homebuilt VFD progress

Post by BigMouse » Thu, 23 Jun 2011, 19:40

bga wrote:(...)In another thread, I identified an IC that should make high resolution shaft sensing a $50 problem for 1000 PPR class sensing. I will try this IC in due course, but don't see any reason that it won't work nicely.
Very interesting part you've found. The cost of implementing something like this seems to be low enough to make slip-based torque control simple on my controller. I'll have to include one of these on my next element14 order and play with it a bit.

Post Reply