3 Phase Motor Control
Tapperman
Posts: 319
· I have been trying to build my own 3 phase inverter for some time now ... and finally made some headway in the last 2 days ... success at last!
· I'm hoping·that Beau Schwabe, who wrote the PWM object (in the object exchange) will help with this one, maybe?
· I want to convert the code included in the AN984 to the propeller ASM.· But I'm not very good at assembly on either micro ... and believe the one in the AN984 is a PIC of some sort, below is a link to the doc.
···· http://ww1.microchip.com/downloads/en/AppNotes/AC Induction Motor 00984a.pdf
I wrote a real clunky SPIN version (works ok at slow speed)· using the PWM from the object exchange.· Which I attached below.· Watch Pin 1, 2 or 3 on an o-scope and see what happens.· I happen to be lucky enough to have 3 phase motor out of a UHER reel to reel tape recorder, that operates on 6 volts.
As soon as I figure out how to make my camera take motion pictures, I'll attach a video of the thing running.· Boy is it smooth.
Anyone else want to make an electric car?··
· I'm hoping·that Beau Schwabe, who wrote the PWM object (in the object exchange) will help with this one, maybe?
· I want to convert the code included in the AN984 to the propeller ASM.· But I'm not very good at assembly on either micro ... and believe the one in the AN984 is a PIC of some sort, below is a link to the doc.
···· http://ww1.microchip.com/downloads/en/AppNotes/AC Induction Motor 00984a.pdf
I wrote a real clunky SPIN version (works ok at slow speed)· using the PWM from the object exchange.· Which I attached below.· Watch Pin 1, 2 or 3 on an o-scope and see what happens.· I happen to be lucky enough to have 3 phase motor out of a UHER reel to reel tape recorder, that operates on 6 volts.
As soon as I figure out how to make my camera take motion pictures, I'll attach a video of the thing running.· Boy is it smooth.
Anyone else want to make an electric car?··
Comments
Looks like you're having some real fun though. [noparse]:)[/noparse]
http://www.mouser.com/ProductDetail/STMicroelectronics/STGE200NB60S/?qs=BJlw7L4Cy7%252bM2r%2fNHVO%252bEA%3d%3d
The above link should show the IGBT's I plan on using.
Post Edited (Tapperman) : 1/27/2010 1:49:46 AM GMT
My brother-in-law is more on the EV scene, but more on the scale of motorized bikes at the moment with dreams of building a car. I haven't visited my PWM code in awhile, but I think it should be doable. That said, I don't know how a 3-Phase motor would react to a square wave, I see plenty of applications that do it that way though. Personally I would want to create a nice sine wave, not too difficult after reverse engineering a couple of Sine wave inverters of my own.
Tapperman,
You do know that there is an option with the PWM code that I wrote that allows you to Phase sync multiple pins... looks like you are doing it in a loop when the object already will do it for you.
...You should be able to adjust the speed by varying '16665' and '5555' the latter being 1/3rd of the former.
For Sine Wave:
My own misconception was that you needed an inductor and capacitor at a resonant frequency of 50 Hz or 60 Hz ... This is a false assumption on my own behalf and doing so would require a HUGE inductor. You do need an inductor and capacitor however but only acting as a low-pass filter towards your PWM frequency. In this case the inductor capacitor combination ends up being MUCH smaller. Typically your PWM frequency is 5kHz and up. Whatever it happens to be, set your low-pass filter to be at least a third of that frequency.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 1/27/2010 4:13:13 AM GMT
And also, I was unaware that you could control a motor that way either!!! I thought as you do, that you need capictor, inductor network of some sort to smooth out the square wave into a perfect sine wave. Appearantly there are energy losses if you don't have a perfect sine wave. Something the engineers refer to as power factor. I'm learning, but at this point I'm not sure about this last parameter. Here's a concept link:
http://www.freescale.com/webapp/sps/site/overview.jsp?code=WBT_MOTORPWMTUT_WP
If you follow the link in my original post, you can view the AN-984 PDF ... and clearly outlines the technique used in this application. As a matter of fact, her is the link to there promo-video:
http://www.microchip.com/get/PCJT
Not only do they control 3 phase motors with the unit ... they can also drive a brushless DC motor (and if I remember correctly - it does have a permenant magnet in it).
Watch the video, then go back and read the application note (source code is at end) ... but, the code can not be directly converted ..as it uses interupts.
Also, would your PWM object run faster if the ASM portion, only provided control over say 6 pins versus 32?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
www.tdswieter.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
www.tdswieter.com
OK, just read the source code ... and I can't use it.· All the signals (from 1 to 8) are leading edge aligned.
Even though, I'm inducing a AC current with a DC voltage, I would like the current draw off of the batteries to be stepped one at a time.· Rather than all at once.
... Onward, more research.·
Post Edited (Tapperman) : 1/28/2010 6:29:41 PM GMT
http://obex.parallax.com/objects/414/
...it may be of some use.
why not use the sine table of the propeller and generate true sine waves? For an electric vehicle, I think, you don't need very precise control of the motor, so a simple V/f control should do. You can also drive the motor in the weakened field area, I mean, if your motor is rated for 220 volts at 1800rpm and you only have 110 you can still drive it to 1800rpm but with only half the torque. Ramp up the voltage until 900rpm (30Hz) and then apply constant voltage up to 1800rpm (60Hz). Torque will drop inversely proportional to speed above 900rpm, then. But that doesn't matter much. You need the highest torque at low speeds anyway for acceleration and climbing.
BTW. I'm currently building a three phase sine wave motor controller for permanent magnet motors. I do it "state of the art" with current vector control, clarke transformation and so on. But this is much too complicated for your application. Just a preview: http://benezan-electronics.de/forum/videos/BeneHack22.avi
There's only one "problem". You surely want the throttle to control the torque and not the speed of the motor. So you need some feedback of the actual motor current or motor speed or both. Otherwise the motor will stall if you drive it with too high frequency while it's still spinning at low rpm.
Cheers
Thanx
I checked the link, it should work. But you need a media player capable of displaying divx format. Google for divx or take VLC media player.
If you have an encoder (grey code sensor) on your shaft then it's easy. Torque control can also be done sensorless but that's very complicated.
An induction motor (squirrel cage motor) produces torque proportional to slip. If your motor is rated, for example, 60Hz 1740rpm then it has 2 pole pairs and 2Hz slip at rated torque. It would spin at 1800rpm with no load. 1740rpm = 29rps. 29/s * 2 = 58Hz. 60Hz - 58Hz = 2Hz. So you can simply add 2Hz to the sensed speed and drive the electric field a little faster than the shaft spins. Below the rated speed the voltage should be nearly proportional to speed with an offset to compensate for the resistive losses. Typically, 5 to 10V at 0Hz ramped up linearly to rated voltage at rated speed will do.
You could vary the slip proportionally to the desired torque (throttle pedal angle). However, that results in a poor efficiency at partial load. The motor would have an idle current of 50 to 60% of the rated current at full torque. So you can also decrease the voltage linearly·from say 30% to 100% for 0 to 100% torque. This has the disadvantage that it takes some time to reach the full current due to the large inductance and delay between stator current and rotor current. But we don't need a high dynamic servo system here. You want to low-pass filter the throttle singal anyway to avoid jerks.
My own motor controller is still in the experimental stage. I'll release more infos when it does something useful.
Cheers
······· http://forums.parallax.com/showthread.php?p=886880
I'm no expert on power electronics but this is what I was pointed to by the power electronics guys at Nottingham Uni when I was interested in making a switched supply. It does cover quite a bit of drive stuff.
Graham
Thanx again.
My own need to drive a hard-drive platter motor was satisfied long before I got to the sophisticated driver I sketched out for myself. Spin code + a 40v current limited lab psu + 3/2 H-bridge = 20,000rpm hard disk [noparse]:D[/noparse] This worked so well I didn't even bother implementing back emf block commutation, let alone 3-phase sine wave PWM with current and power factor feedback, or a full flux vector drive.
Look forward to what you produce,
Lawson
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lunch cures all problems! have you had lunch?
Graham
For my application, I can not exceed 5KHz.· My IGBT's wont take it.· So I downloaded Mr. Schwabe's driver in the OBJECT exchange, and modified it for my own purposes.· His object let's me set the phase between pulses, which is handy to keep the draw from the Bat's staggered.· I can set the carrier freq, and then change the duty cycle on the fly.
I do have a mystery though, according to what I have read .. the sum of all three currents should be zero at any instant in time.· But I get the signal shown in the BMP attachment from the stator, and it seems to center around 2v (I'm driving the motor w/6V)
Post Edited (Tapperman) : 3/7/2010 12:37:56 AM GMT
I usually bat these ideas around on DIYelectriccar.com more than I do here. I'm glad to see the lights coming on here too. At work we have antique inverters driving 200 hp and 400 hp motors that pump water. The are so noisy you need ear plugs to be around them. Based on their age I wouldn't be surprised to find SCRs in them if I opened them up. The noise/THD problem produces unneeded heat and requires the motors to be "inverter duty". The square waves cause eddy currents in the rotor shaft that will knock out bearings if one of them isn't properly insulated electrically. Reducing THD will cut the cost of traction motors from mine trucks to light rail cars. Prop-on.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
MOORE'S LAW: The capabilities of electronics shall double every 18 months.
cloyd's corollary: Hardware is easy, software is hard.
Post Edited (yarisboy) : 3/7/2010 3:36:04 AM GMT
··· http://www.mouser.com/catalog/specsheets/L01ZXXXS05.pdf
This sensor?