# DIY AC or BLDC Controller



## JonasMeyer (Feb 28, 2009)

After reading several threads on here about trying to come up with cheap diy controllers to use with cheap off the shelf industrial motors, I came up with an idea. I have no ability to implement it myself, so I am posting it here in the hopes that it will be useful to someone and that I can someday buy one of these cheap.

An AC or BLDC is really just two things, right? It's a very large class-D amplifier, and a signal generator that can drive this amplifier, correct?

I know there are lots of people who build their own class-D amplifiers. Perhaps we can take a page out of their book(s), or find some filterless off the shelf cheap audio amps to use.

On the signal generator end, and this is the meat of my real idea, every single person reading this post already has a high processing power general purpose signal generator in their house. It's called a computer with a soundcard. Cheap laptops or tablets have all the processing power one could possibly want to pair with any possible ACIM or BLDC motor. If someone wants multiple motors per car, that's fine! Just pick a sound card with the appropriate number of channels. Implement the software end as a package for debian or ubuntu that takes over the sound card and outputs whatever we want.

This has the added bonus that the same software can be used to drive sophisticated 4 wheel drive setups with regeneration, ABS, traction control, turn on a dime, etc. The same software can be used to test new motors that don't exist yet through simulation. The same software can be used for EVERY BLDC or ACIM motor out there, with a plugin model of the appropriate motor loaded.

Properly architected (and open sourced, of course), this software package would allow for all the things which are common to every controller to be written once and for all, and debugged and optimized extensively. Cars could change driving dynamics via driver selectable modes "sports mode," "economy mode," "snow mode," "track mode," etc.

Anyway, there is my brainstorm. I'm throwing it out there on the internet in the hopes that someone likes it and runs with it. Maybe someday I can own or build a car based on it. Thoughts?


----------



## etischer (Jun 16, 2008)

Industrial AC motor controllers are not putting out an analog sinewave, they are using pwm to simulate a sinewave. I think making a 3 channel 70kw class D amplifier would be quite a feat though! It would be super quiet! I think the pwm approach would be more efficient. 





JonasMeyer said:


> After reading several threads on here about trying to come up with cheap diy controllers to use with cheap off the shelf industrial motors, I came up with an idea. I have no ability to implement it myself, so I am posting it here in the hopes that it will be useful to someone and that I can someday buy one of these cheap.
> 
> An AC or BLDC is really just two things, right? It's a very large class-D amplifier, and a signal generator that can drive this amplifier, correct?
> 
> ...


----------



## JonasMeyer (Feb 28, 2009)

Silly, a class-D amplifier IS (usually) pulse width modulated. See http://en.wikipedia.org/wiki/Class-d_amplifier

The real meat of my idea, though, is that a ruggidized (or not) laptop or even an Android or iPhone device can be the signal generator and do all the hard computation that makes controllers expensive. If people have to write new software for every controller, that makes controllers more expensive than if the same software can be used over and over.


----------



## piotrsko (Dec 9, 2007)

Just for laughs: 
25 years ago I worked for a test house that had the world's largest shaker table and we powered it with class "C" audio amps. However, I think all we could get was 1KW, but running Ln2 as "fuel" and some wierd mirata valves we could play Xmas carols that you FELT for miles.

down side of idea: whAt happens if my kid downloads some metallica while I'm driving?


----------



## JonasMeyer (Feb 28, 2009)

piotrsko said:


> down side of idea: whAt happens if my kid downloads some metallica while I'm driving?


I can't tell if you are serious, but the idea is not that one hooks one's stereo to the motor. It would be a dedicated audio signal generator based upon inputs from the accelerator, etc. Anyone have any idea if regeneration could be controlled this way?


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> Silly, a class-D amplifier IS (usually) pulse width modulated. See http://en.wikipedia.org/wiki/Class-d_amplifier


A class D amplifier is a far more complicated thing than a BLDC controller would be.

The power stage of large Class D's can have $100-150 just in capacitors. 

The design is actually fairly close (tons of paralleled MOSFETS in the output stages), but a BLDC controller will be substaintially cheaper in parts per wattage.


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> A class D amplifier is a far more complicated thing than a BLDC controller would be.
> 
> The power stage of large Class D's can have $100-150 just in capacitors.
> 
> The design is actually fairly close (tons of paralleled MOSFETS in the output stages), but a BLDC controller will be substaintially cheaper in parts per wattage.


Interesting. Do you think it would be possible to drive a BLDC controller with a sound card and generic software?


----------



## aeroscott (Jan 5, 2008)

JonasMeyer said:


> Interesting. Do you think it would be possible to drive a BLDC controller with a sound card and generic software?


AC propulsion says his inverter is a large audio amp . 6 igbts 6 channels for 3 phase . speakers are called motors in the audio world .sounds like it would work .


----------



## etischer (Jun 16, 2008)

JonasMeyer said:


> Interesting. Do you think it would be possible to drive a BLDC controller with a sound card and generic software?


running a BLDC motor requires an encoder for commutation. 

AC induction motor needs current feedback on at least two of the three phases for regen. 

An Ipod would just be running open loop, meaning without feedback. You could probably run an AC motor in its most basic mode, volts/hz. Basically giving it 30 hz at 120v to run 50% speed, or 60hz at 230v to run 100% speed.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> Interesting. Do you think it would be possible to drive a BLDC controller with a sound card and generic software?


No... you have to monitor the movement of the coil in some way I believe... but someone with more design expertise could tell you.

think of an AC or DC motor controller as an amplifier with a tone generator attached to it... likewise instead of amplifying the current (which is why audio amplifiers are inefficient compared to controllers) all a AC/BLDC controller is doing is limiting the current through PWM and varying the amperage output.

This is similar to what a D class amplifier would do with gain adjustment, the problem is using a pot style resistor is not something you'd want in a motor controller for efficiency... so this is done digitally, meaning larger/more expensive input line circuitry.


----------



## JonasMeyer (Feb 28, 2009)

So it sounds like you could do it, but you'd need to utilize microphone inputs and shunts to get feedback back from the motor for regen.

So the basic idea is this. Signal generator is an open source piece of software running on a ruggedized laptop permanently mounted in the car. It takes input from the driver, probably through the form of a set of USB pedals used in video games.

Output from the signal generator runs along 3 audio channels to 3 HUGE monoblock class-d amplifiers, which pull dc from the batteries and signal from the laptop, and do low frequency PWM (like around 500Hz or so) to drive the motors. The wires for the motors have shunts in them which measure feedback from the motor, and feed it back into 3 microphone inputs. A USB temperature probe could monitor the motor for overheating.

All the hard work is done in the laptop in software. The laptop runs a stripped down linux kernel compiled for real time usage, and a bare minimum of operating system cruft that lets you ssh in and upload new versions of the control application. I think a basic form of the application could be programmed by someone with the appropriate skill set (linux audio driver hacking) in under a month, perhaps way less than that. Basic software parameters would ensure that the motor didn't overrev, or that too much current wasn't pushed through the motor or pulled from the batteries.

Version 2 would have a "learning mode" where it could take additional input from a dyno to create a profile of any motor you hooked up to it, using basic learning algorithms to find by trial and error the optimal inputs for efficiency for the desired amount of torque.

I think the laptop could be had for under $200, if you were willing to modify a netbook to make it more rugged (or just mount it in the cabin). It would be massively overpowered processor wise for this kind of work. That leaves the cost of the 3 class d monoblock amps as the main impediment, but if IGBTs are as cheap as people say they are, we could probably build a basic controller for under $500 - $750 in componant costs. And if you wanted more power, just stick bigger amps on it. We're talking competition for a Tesla Roadster, controller wise (in terms of raw power output) for only a few thousand $. Since it would be open source, we could quickly generate profiles for all sorts of standard vector controlled industrial AC motors, which would mean the sky was the limit in terms of power. And although those motors aren't light, they would probably be good enough for a generation of AC electric vehicles that would be WAY cheaper and more powerful than any other AC systems out there.

Anybody a linux kernel / audio hacker out there? I can create the custom linux distribution, if you can write the app.


----------



## Technologic (Jul 20, 2008)

etischer said:


> Industrial AC motor controllers are not putting out an analog sinewave, they are using pwm to simulate a sinewave. I think making a 3 channel 70kw class D amplifier would be quite a feat though! It would be super quiet! I think the pwm approach would be more efficient.


It wouldn't be an amplifier in any literal sense... it would be a software fed selectable PWM system that's active correct?

Instead of passive control software it would allow for selectable presets that are run through audio controls unless I misunderstand the point...

it wouldn't be any cheaper probably, but far more dynamic.


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> It wouldn't be an amplifier in any literal sense... it would be a software fed selectable PWM system that's active correct?
> 
> Instead of passive control software it would allow for selectable presets that are run through audio controls unless I misunderstand the point...
> 
> it wouldn't be any cheaper probably, but far more dynamic.


I think there is some misunderstanding about how digital audio works, both in the computer and in the amplifier. When I play an sound file off my hard drive, it comes into the sound card as a PWM signal with a pulse frequency of 44.1 KHz. That exits the sound card on an analog output (unless you are using digital optical audio out), but it is still PWM. Very high frequency PWM that simulates a sine wave closely enough for our ears to blend it together (if we are using headphones).

That output is usually run into an amplifier, not headphones, however. If it is a class A or B amp, then it uses an analog circuit to amplify this PWM signal and send it to the speakers. If it is a class D amplifier, however, it samples the signal and uses PWM to output it at higher voltage.

The reason why class-D amplifiers have until recently only been used for subwoofers is because we did not have cheap high voltage circuits which could sample at greater than 200Hz or so, which of course is shit for sound. Recent advancements in technology let us sample at MUCH higher frequencies, like 100KHz, which lets us amplify a 44.1 KHz digital signal without any audio artifacts. But we really don't need 100KHz. We realistically only need to modify the signal to the motor a few hundred times a second. That means what we need is an old school class-d amp like the gangstas use to blast you from a mile away as they drive by.

So we output from the computer at 44.1 KHz, because we can do that for free (it is built into the sound card). But all we are outputting is a simulation of a basic tone that is the appropriate "loudness" (for voltage) and frequency (for speed). That tone gets amplified in our 3 monoblock amps, and we don't care if it is chopped to a lower sampling rate. It is my guess that higher sampling rates probably lead to greater efficiency, since there is less artifacting from sawtooth waves that will try to push the motor the wrong direction or interfere with each other or whatever, but we can do that later. In the mean time, a simple 200Hz or 500Hz, or whatever is cheap pulse width does the job.

The point is we build the signal generator ONCE, in software that is going to get cheaper and cheaper to find hardware for. It might even run on a gumstix computer, in which case you are talking $20 - $50 in hardware costs for the most advanced signal generator you can imagine. The monoblock amps are simple circuits with some basic hardware overcurrent protection (a fuse?), but they should have a minimum of componants, and thus be cheap, simple, and elegant. The motors are off the shelf industrial motors.

We can say good-bye to the metric mind effect. We can build 400V 3000A AC controllers for the prices we used to pay for 100V 500A controllers for. We can build hot cars for the kind of budget that makes our neighbors sit up and say "I WANT that!". As battery prices fall futher and our controller gets more and more sophisticated (because all the hard stuff is in software), it will get harder and harder for people to dismiss electric cars.

I see in my mind two pickups back to back. One is a big block V10 and the other is a diy electric. Their hitches are tied together with a huge chain. They have huge wide tires with studs for maximum traction in the hard ground. The flag drops, the V10 roars, and then pops a rod as the electric effortlessly pulls it backwards dispite the massive amounts of gasoline being vaporized. The electric does a victory lap with the dead gas guzzler in tow, and every small town mechanic in america puts out a shingle for converting vehicles to electric.

But to get there, the price HAS to drop. One piece of the puzzle is cheap LiFePO4 batteries. The Chinese government seems to want to do that, and early next month DLX is opening production on 500 tons per year of anode material. But the other side of the equation is cheap controllers. Cheap AC controllers.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> I think there is some misunderstanding about how digital audio works, both in the computer and in the amplifier. When I play an sound file off my hard drive, it comes into the sound card as a PWM signal with a pulse frequency of 44.1 KHz. That exits the sound card on an analog output (unless you are using digital optical audio out), but it is still PWM. Very high frequency PWM that simulates a sine wave closely enough for our ears to blend it together (if we are using headphones).
> 
> That output is usually run into an amplifier, not headphones, however. If it is a class A or B amp, then it uses an analog circuit to amplify this PWM signal and send it to the speakers. If it is a class D amplifier, however, it samples the signal and uses PWM to output it at higher voltage.


What sound card are you using exactly?

I've used top end mic/tone generators and 44.1KHz isn't the output frequency of the audio, it's the sound accuracy (I can't remember exactly what it's called anymore).

At any rate no I see perfectly what you're getting at here... the problem is that's not how a PWM controller works... You could have a signal generator but using the battery's power to amplify that circuit would be grossly inefficient (even a Class D is about 75% efficient... try cooling 20kw of heat... won't happen).

What you need to be looking at is Class G and Class H designs since you can approach 95% efficiency if you choose the proper outputs... I'd suggest IGBTs simply because distortion is almost completely irrelevant.

http://www.dself.dsl.pipex.com/ampins/classg/g.htm

There are advantages to doing it this way to be sure... your input stage could be raw power and cap bank could be saved costs (you could survive with a very small one because the tone won't be variable during use)

In actuality though, and I say this with much respect for this idea... if I were you I'd look into superconducting the output stage... it sounds way more expensive than you could rig it for... and it'd be worth it in overall cost savings and make it approaching 100% efficient.

Beyond that I'm not sure what you're hoping to get out of this... the modulation portion of a PWM controller is often not the most expensive part...


----------



## JRP3 (Mar 7, 2008)

I think it should be pointed out that the other piece of your idea, using industrial motors, isn't practical. Industrial motors are way overbuilt, designed to run for hours and days on end, and are heavy and often inefficient, compared to EV traction motors. Putting one of them in a passenger vehicle would be similar to putting a diesel from a backhoe into a car. Yes you could do it but you wouldn't want to. The extra weight of the industrial electric motor would be better put into battery weight.


----------



## aeroscott (Jan 5, 2008)

JRP3 said:


> I think it should be pointed out that the other piece of your idea, using industrial motors, isn't practical. Industrial motors are way overbuilt, designed to run for hours and days on end, and are heavy and often inefficient, compared to EV traction motors. Putting one of them in a passenger vehicle would be similar to putting a diesel from a backhoe into a car. Yes you could do it but you wouldn't want to. The extra weight of the industrial electric motor would be better put into battery weight.


 having spent a lot of time in a motor shop looking at and talking to people that know .industrial motors are built in *many *configurations ( light, medeum heavy , extra heavy , differant *lamination's​*, copper , insulation , bearings , frames ( aluminium , steel , cast iron ) eff are in the 90%+ range . horse power rating are *misleading* . its the build of the motor and its cooling . a new 200 lbs alu frame, inverter rated , 90%+ *eff* cost $1200 . know forget the 15 hp rating its a cooling rating for worst case industrial service . water cooling ,oil cooling and gas cooling can be added . not as good as ev motors , but it would still kick a--


----------



## Bingo Sun Noon (Mar 13, 2009)

Hi
I built a BLDC controller for a 2 phase hub motor I built for a motorcycle. It is no trivial task. What is your skills level as an electronic tech? Can you use an oscilloscope? It took me many months to get mine to work and I work in the industry as an engineer. Be careful about making this sound too easy. 100 watts pretty easy, 10,000 watts, watch out.


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> Beyond that I'm not sure what you're hoping to get out of this... the modulation portion of a PWM controller is often not the most expensive part...


What is the most expensive part? The IGBT's? The custom one-off engineering? I assume the custom one-off engineering. Thus the open source. Let's all develop it together. Or even better, someone smarter than me develop it and sell them for competitive with DC and we'll all buy them.

As for the IGBT's, and this is going to reveal the true extent of my ignorance here, it doesn't seem like they are TOO expensive. I found one rated to 400A and 1200V for $131 on google in 30 seconds. I understand they need to be way over-rated to compensate for transient voltage and current spikes, but surely that would do for one channel, right?



Bingo Sun Noon said:


> Hi
> I built a BLDC controller for a 2 phase hub motor I built for a motorcycle. It is no trivial task. What is your skills level as an electronic tech? Can you use an oscilloscope? It took me many months to get mine to work and I work in the industry as an engineer. Be careful about making this sound too easy. 100 watts pretty easy, 10,000 watts, watch out.



Hey. I'm not building this thing. I'm just suggesting that dividing the signal generator off from the power circuitry could save us all some engineering headache. If the signal generator was software based, the same piece of software could work with any power circuitry and any motor.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> As for the IGBT's, and this is going to reveal the true extent of my ignorance here, it doesn't seem like they are TOO expensive. I found one rated to 400A and 1200V for $131 on google in 30 seconds. I understand they need to be way over-rated to compensate for transient voltage and current spikes, but surely that would do for one channel, right?


No it wouldn't... not 400A... at least not for your average 2500lb EV.
Of course you can find them for a lot cheaper than $131 each.

Realistically something like a 600A 600v IGBT for each channel (in this case one channeL) will be fine... Since you're doing a AC drive motor (again I don't know enough about AC motors to help on what they need outside of just straight AC power).

There's strong possiblities to make a low cost amplification circuit... as I told you the problem is efficiency... and though I could "in theory" help you design a Class A or Class A/B amplifier I'm completely lost trying to help you design a IGBT Class G or H circuit to keep efficiency high enough.

If you're going AC though you could probably pump out 220v-400v and keep the amperage to say 50amps tops... that's the best way to go about this not to mention you will save tons in efficiency.

Someone with AC motor design experience needs to help that sort of thing though. I could draw up an output stage (though clearly not a traced board which is what you need), but besides that the direct input and ton generator you'll need to figure out yourself. A computer isn't necessary for that phase... and a waste of money.





> Hey. I'm not building this thing. I'm just suggesting that dividing the signal generator off from the power circuitry could save us all some engineering headache. If the signal generator was software based, the same piece of software could work with any power circuitry and any motor.


That's the problem... you need an engineer...

I'm not an EE and am merely a hobbyist... I know almost nothing about 3 phase AC drive systems. They certainly don't seem that much more "complicated" than a sound amplifier, but then again I've never made an amplifier over 200w (and you're talking about a 20kw-30kw AC controller).

I know it can be done... and probably for not much... I could source it, draw up a PCB trace and get it for the cheapest price in the world for you manufactured... but yeah you need someone with more expertise than me to figure out such a drive stage... I wouldn't even know where to start.

These IGBTs probably cost about $20 in small volume $5 or so in large volume
http://www.alibaba.com/product-gs/213441578/Sell_IGBT_module.html

The price won't be the problem... you need an EE (or a self taught one) to at least figure out the drive portion of the amplification

I also am curious if you could vary the PWM frequency to control the motor's output in AC motors... if so I could imagine ungodly cheap ways to do that via software management (simple stuff and a tone generator)...

Some large amplifiers so you don't get scared of this idea:
http://cgi.ebay.com/QSC-PL380-8000W...-PL3-PL-3_W0QQitemZ370171355586QQcmdZViewItem

That's a 8000w RMS rack amplifier, and yes PL's have been bench tested to output that much power.

You wouldn't need the transformer, rectification stage (maybe... again I'd need to see what design you're doing) so you could in theory cut a massive portion of those components out (the most expensive ones, especially cap banks).


----------



## Technologic (Jul 20, 2008)

Here's another example of a "max current draw" amplifier near the 8kw range:
http://www.theloudest.co.uk/?sectionid=2&page=view_product&product_id=91

No fans just the case.

Now I want to be clear that if you opened it all you would see is about 80 large caps and mostly just basic paralleled mosfets in the output stages. 

As you can imagine though, the lower the frequency (subwoofer frequencies being <50hz down to 15hz) the more heat build up there will be in general due to electrons traveling much further.

I do like the idea of having such a variable AC system though... that you could drop it into any system without having to "custom program it for each motor" just modify it till it's perfect with tone generators and gain functions.

Edit:
Here's the DC amplifier I was looking for:
http://salestores.com/jbla6000.html

that thing was benched to do over 8000w continuous... though I'm showing you these only so you realize you could trim at least half the components out of such a thing... if not all of them (since sub amps almost never use IGBTs probably upwards of 20-30 expensive MOSFETS out of the output stage)


----------



## Anaerin (Feb 4, 2009)

Technologic said:


> Realistically something like a 600A 600v IGBT for each channel (in this case one channeL) will be fine... Since you're doing a AC drive motor (again I don't know enough about AC motors to help on what they need outside of just straight AC power).


Wouldn't you need 2 per phase (one for 0/+ and one for -/0 switching, to make full AC, rather than half-wave)? Or are you proposing going from -/+ (Which means your IGBT would need to be rated for double your voltage)...?


----------



## Technologic (Jul 20, 2008)

Anaerin said:


> Wouldn't you need 2 per phase (one for 0/+ and one for -/0 switching, to make full AC, rather than half-wave)? Or are you proposing going from -/+ (Which means your IGBT would need to be rated for double your voltage)...?


In general either would work, you could have 2 transistors (IGBTs) per phase, which is usually how it's done, however if you did so you wouldn't functionally need that voltage and amperage (I'd have to go through my EE books I have to reread on voltage across paralleled circuits but each would only see about 1/3 the total voltage/current seen by the motor if I remember correctly).

Likewise an amplifier (his proposition) would be more akin to a single phase AC motor than a 3 phase, however you could use a 3 phase inverter in the output portion of the amplifier.

Like I said I'm not deeply familiar with what this would entail. Based upon the few patents that exist for 3 phase drive AC inverters I could find briefly searching tonight it's not that promising to adapt such a circuit. This would surely be a one off endeavor considering you're not even creating a high amperage PWM circuit, instead you're taking a low amperage signal and boosting it via amplification (pulled from the battery).

I like this idea for many many reasons (low voltage/amperage software components and ability to change things on the fly), but at the same time I have no idea what this would entail.

Certainly having a straight gain on the input signal is soooooooo much safer and cheaper than putting that gain inside the PWM circuit itself, especially if the tone generator is a set one.

I might be getting way over my head here though.


----------



## Anaerin (Feb 4, 2009)

Technologic said:


> In general either would work, you could have 2 transistors (IGBTs) per phase, which is usually how it's done, however if you did so you wouldn't functionally need that voltage and amperage (I'd have to go through my EE books I have to reread on voltage across paralleled circuits but each would only see about 1/3 the total voltage/current seen by the motor if I remember correctly).


I was under the impression that an IGBT acted sort-of like a diode, in that it only conducts one way.

Given that an AC waveform goes from -a to +a volts, if you had a single IGBT you would only get the positive half of the waveform, thus to build an AC controller/inverter with them you need a pair.


----------



## Technologic (Jul 20, 2008)

Anaerin said:


> I was under the impression that an IGBT acted sort-of like a diode, in that it only conducts one way.
> 
> Given that an AC waveform goes from -a to +a volts, if you had a single IGBT you would only get the positive half of the waveform, thus to build an AC controller/inverter with them you need a pair.



You might be right, I was under the impression that AC inverters pumped out square waves though... I'll have to double check that.

2 IGBTs per phase wouldn't be a big deal anyway though, and each IGBT would be much much smaller than if you were doing a straight DC motor controller

In fact you could do something like a 200v 100a IGBT 6 of them for a 3 phase motor... at $10-20 each that would make a very afforable output stage... the general remainder of components would probably be rather insignificant (if my prior class D amplifier schematics were any indication the cap banks and MOSFETs in the output stage trumped all of the remaining components in price by a few orders of magnitude)


----------



## Anaerin (Feb 4, 2009)

Technologic said:


> You might be right, I was under the impression that AC inverters pumped out square waves though... I'll have to double check that.


AC inverters do, yes (And then typically use a capacitor or two to smooth it into an almost-sine wave). But an AC controller needs to be able to have a phase at 0v (So it's not interfereing with the attracting/repelling forces of the other two phases) while the other two are at +v and -v respectively. Using a smoothing capacitor is not possible as the wave frequency changes dependent on the speed, and the smoothing effect of the capacitor would not change.


----------



## Technologic (Jul 20, 2008)

Anaerin said:


> AC inverters do, yes (And then typically use a capacitor or two to smooth it into an almost-sine wave). But an AC controller needs to be able to have a phase at 0v (So it's not interfereing with the attracting/repelling forces of the other two phases) while the other two are at +v and -v respectively. Using a smoothing capacitor is not possible as the wave frequency changes dependent on the speed, and the smoothing effect of the capacitor would not change.


I see thanks for the info. I wasn't particularly suggesting not to use 2 IGBTs per phase... but since it wasn't talked about how many phases these motors would use I was talking about "per channel" of sorts.

I'm curious now about something that I'm winding in my head after reading a bit about AC inverter stages... can one control the motor via frequency?

I know this might sound "annoying" but it actually would whine like an engine if it's possible.

http://ww1.microchip.com/downloads/en/AppNotes/00843a.pdf

Looking over the software delays they suggest for their chip, and frequency min to frequency max is it possible to wind down the frequency through an adjustable frequency source (incredibly simple to make) that is then inputed as the drive signal?

Ie. into the drive IGBT for the PWM you fed the signal from the frequency generator... output would be dictated by frequency not by amperage controls?


----------



## Anaerin (Feb 4, 2009)

Technologic said:


> I see thanks for the info. I wasn't particularly suggesting not to use 2 IGBTs per phase... but since it wasn't talked about how many phases these motors would use I was talking about "per channel" of sorts.
> 
> I'm curious now about something that I'm winding in my head after reading a bit about AC inverter stages... can one control the motor via frequency?
> 
> ...


Not only is it possible, it's generally the primary method of controlling an AC drive system:

http://en.wikipedia.org/wiki/Variable_frequency_drive


----------



## Technologic (Jul 20, 2008)

Anaerin said:


> http://en.wikipedia.org/wiki/Variable_frequency_drive


Hmmm it must be getting to late for me (3:18am).

Time to sleep 

I wonder why the hell these things are so expensive then now. I just can't imagine that VFD's, even 30kw ones, cost more than $1000 (considering there's no transforming and rectification going on).


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> Hmmm it must be getting to late for me (3:18am).
> 
> Time to sleep
> 
> I wonder why the hell these things are so expensive then now. I just can't imagine that VFD's, even 30kw ones, cost more than $1000 (considering there's no transforming and rectification going on).



Exactly! 

Btw, Tesseract told me about an open source hardware project called open source motor control. They have a kit they sell that is a 2 phase BLDC drive controller for $490, or $599 fully assembled and tested. It is only designed to do 160A continuous or 400A peak at 50V (per channel), but if we could scale up the voltage by using higher rated components (is that all it would take?), it could be an awesome AC controller for an electric car.

It's not surprising, but they already thought of and implemented my idea. It separates the signal generation out from the power amplification. I guess there is nothing new under the sun. But it is nice to have validation.

If we could scale up the voltage 3x or 4x, you would be talking raw power that would rival most cars on the road. Even as is (if my math is right), it can do 53HP, which is a fair bit cheaper than the cheapest kits out there. No enclosure, but that is easy enough to build.

www.robotpower.com

Go to the web store and look at the OSMC

I'm going to call them and see if they would be interested in selling me a higher voltage model and how much it would cost.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> Exactly!
> 
> Btw, Tesseract told me about an open source hardware project called open source motor control. They have a kit they sell that is a 2 phase BLDC drive controller for $490, or $599 fully assembled and tested. It is only designed to do 160A continuous or 400A peak at 50V (per channel), but if we could scale up the voltage by using higher rated components (is that all it would take?), it could be an awesome AC controller for an electric car.


I'd be much more interested attempting to change the output stage to a 3 phase AC than keep it as a 2 phase...

You'd probably need to modify more than just adding higher rated components, but I'd have to see the schematic to even have a guess at it.

PCB would certainly need to be changed to provide larger leads etc.

Just from looking at the PCB and what diodes etc they're using I'd say the thing would only cost about $70 fully populated as it stands...


----------



## Gistole (Mar 20, 2009)

For newbies who have NO ideas  of what BLDC controllers are, here is the simplest explanation.

There are three different sections in a BLDC controller, purely for motor controller with NO charging 

1) First, the controller chip which control the speed and direction of the motor(usually 1 piece)
2) Second, the interface chips (usually 3 pieces) which interface controller chip and the actual relay (electronic relay known as MOSFET)
3) Third, the electronic relays (usually 6 pieces) which the channel the current from the batteries to the motor.

Anyone following?

From the BLDC motor, there are 2 types
1) With sensor 
2) Without sensor

BLDC with sensors will have at least have 6 cables coming out from the motor. Of which, 3 are for powering up the motor and 3 for monitoring the position of the rotor. The 3 monitoring cables are fed into the controller chip. The 3 power cables are fed to the electronic relays.

For those Off-The-Shelves-BLDC-Controller that claims to work only at 60V, you can usually change the 6 power MOSFET & 6 diodes to a higher ratings (let's say 100V) and you can run a higher voltage motor provided that current drawn is within the specification of the MOSFET. However, there may be a speed difference with respect to the Off-The-Shelves-BLDC-Controller specifications.

For more details of how the controller works, go to http://focus.ti.com/lit/ds/symlink/ucc2626.pdf. This is a motor controller chip (UCC3626) that control the speed and direction of the motor with NO over-current protection. On page 18 of the pdf, there is a detail schematic of the motor controller chip (UCC3626) , interface chip (IR2110) and N-Channel MOSFET (IRF730). 

Hope that this de-mystified the BLDC Motor Controller. If you are adventurous, you could probably order the parts from DIGIKEY and built the circuit for less than 200 bucks. For higher voltage, choose a higher voltage rated MOSFET like IRF630 from STM. For higher current, have 2 MOSFET instead of one at each phase (connect them in parallel, so you have 12 MOSFET instead of 6) so that the current load is split between 2 MOSFET instead of 1

As for BLDC without sensor, there are more electronics involved and more theory involved and more complicated thus not recommend. For for those who are even more adventurous and wanted to know more. Read here http://scholar.lib.vt.edu/theses/available/etd-09152003-171904/unrestricted/T.pdf:D

For those who are already lost , wait for BYD then


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> I'd be much more interested attempting to change the output stage to a 3 phase AC than keep it as a 2 phase...
> 
> You'd probably need to modify more than just adding higher rated components, but I'd have to see the schematic to even have a guess at it.
> 
> ...



Each OSMC is 1 phase. That is, they are simple amplifier circuits. Here is a link to the schematic. http://www.robotpower.com/downloads/ The OMSC stuff is about half way down the page.

I spoke to a guy at robotpower and he said that he wasn't interested in selling a higher wattage unit, but he did speak to me at some length about the OSMC itself. It takes a 5V logical input voltage and amplifies it with no filters. There is also no overheating or overvoltage protection. He said there would be no problem taking the schematic and replacing the MOSFETs with IGBTs and running the design at higher voltage, but that there were no pin-compatible components that he was aware of, so new boards would have to be constructed.

Also, he said that there was nothing preventing someone from redoing that schematic on a different board so that it had better cooling, and could thus handle higher current (up to the limits of the parts, of course).

Still at 3 per channel, and 4 motors per car, this could be ALMOST workable as is. You're talking 4 motors * 3 OSMC's per motor * 160A continuous * 50V = 96 KW, which is enough to power something pretty light slowly. The peak current of the OSMC was 400A, but that was only for a couple seconds, so not enough for a full acceleration event. If we could only double the voltage, we'd have plenty of raw power for those that wanted to keep their differentials. If we could quadruple it, we'd have plenty of raw power for pretty much any application.

Last note, it was mentioned to me that without brushes, we aren't going to see the same kinds of transient voltage spikes as in a DC controller, so we can run the MOSFETs or IGBTs much closer to their max rating. Any idea if this is true?


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> Each OSMC is 1 phase. That is, they are simple amplifier circuits. Here is a link to the schematic. http://www.robotpower.com/downloads/ The OMSC stuff is about half way down the page.
> 
> I spoke to a guy at robotpower and he said that he wasn't interested in selling a higher wattage unit, but he did speak to me at some length about the OSMC itself. It takes a 5V logical input voltage and amplifies it with no filters. There is also no overheating or overvoltage protection. He said there would be no problem taking the schematic and replacing the MOSFETs with IGBTs and running the design at higher voltage, but that there were no pin-compatible components that he was aware of, so new boards would have to be constructed.
> 
> Last note, it was mentioned to me that without brushes, we aren't going to see the same kinds of transient voltage spikes as in a DC controller, so we can run the MOSFETs or IGBTs much closer to their max rating. Any idea if this is true?


So they designed it around the amplifier model, which is smart

Redoing the board layout isn't difficult at all... you could even move the IGBTs directly to a heatsink (which is what I'd suggest anyway).

The problem is there's no reason to use BLDC motors... both because almost none exist that are worth a crap for cars and there are lots of 3 phase AC motors (with regen) already out there.

I'm not sure if the OMSC is even set up for braking at all (doesn't appear to be) so there again is another issue.


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> So they designed it around the amplifier model, which is smart
> 
> Redoing the board layout isn't difficult at all... you could even move the IGBTs directly to a heatsink (which is what I'd suggest anyway).
> 
> ...


Yeah, 3 phase AC is definitely the way to go. Unfortunately, although the OMSC will work in a 3 phase setup by just using 3 of them, the "brain" unit they have can't drive 3 OMSCs. So we are going to need a signal generator and processor, and are back to my pc soundcard idea.

He said regen was no problem. If we were in a situation where we were feeding 40V and 0A to the motor (because we were coasting), and we drop the voltage to 5V, then the amps would start running backwards from the motor into the battery, because of back-EMF. Drop it to 0, and we would see stronger negative torque from the motor. I think he was talking a BLDC motor though, so I think for an AC induction you phase shift the voltage instead? In any case that is a signal generator issue, not a power circuitry issue. The power circuitry can handle it.


----------



## frodus (Apr 12, 2008)

Gistole said:


> Read here http://scholar.lib.vt.edu/theses/available/etd-09152003-171904/unrestricted/T.pdf


There's TONS of theses on VT.edu available.... they're really well done and a good read. I think I have a few in PDF from when I went to Virginia Tech from early 2000's that had to do with motor control... I'll see if I can dig them up... helped explain a lot of things in great detail.

GO HOKIES!!!!!!


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> Yeah, 3 phase AC is definitely the way to go. Unfortunately, although the OMSC will work in a 3 phase setup by just using 3 of them, the "brain" unit they have can't drive 3 OMSCs. So we are going to need a signal generator and processor, and are back to my pc soundcard idea.


A sound card won't be able to read the motor position sensors for each phase...


----------



## Technologic (Jul 20, 2008)

frodus said:


> There's TONS of theses on VT.edu available.... they're really well done and a good read. I think I have a few in PDF from when I went to Virginia Tech from early 2000's that had to do with motor control... I'll see if I can dig them up... helped explain a lot of things in great detail.


I'm fairly disappointed after getting to about page 25 in that master's thesis.

Not only is his grammar incredibly poor, but his marketing skills are highly questionable (especially considering the fact he is a master's student in electrical engineering).

Maybe I expect too much perfection after going to Duke University then subsequently into a top law school, but there are grammar errors every other sentence.

At any rate the paper is somewhat useful.


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> A sound card won't be able to read the motor position sensors for each phase...


Wouldn't a shunt on each phase that produced the appropriately scaled voltage that was fed into the microphone and line-in ports (which could accommodate up to 4 channels between them) work? I was under the impression that AC 3 phase motors didn't have position sensors, and that the controllers sensed position data through the back-emf.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> Wouldn't a shunt on each phase that produced the appropriately scaled voltage that was fed into the microphone and line-in ports (which could accommodate up to 4 channels between them) work? I was under the impression that AC 3 phase motors didn't have position sensors, and that the controllers sensed position data through the back-emf.


Not sure which you were talking about a BLDC or AC 3 phase... you could detect it via back EMF but you'd need software designed for it (or something useful at least prebuilt... which I have absolutely zero abilities to help with).

microphone inputs would need scaled down or you'd quickly blow the inputs... it could be done maybe... 

I'd rather someone with an amount of electrical sense just design one though in hardware... such a high end sound card wouldn't be cheap.

Edit:
Here's a paper about VFD for AC induction motors... maybe this will give me an idea as to what the control/detection circuit would look like
http://scholar.lib.vt.edu/theses/available/etd-04252006-084002/unrestricted/tymurphy-MSthesis.pdf


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> Not sure which you were talking about a BLDC or AC 3 phase... you could detect it via back EMF but you'd need software designed for it (or something useful at least prebuilt... which I have absolutely zero abilities to help with).
> 
> microphone inputs would need scaled down or you'd quickly blow the inputs... it could be done maybe...
> 
> I'd rather someone with an amount of electrical sense just design one though in hardware... such a high end sound card wouldn't be cheap.


Look, a shunt is designed to measure amperage by creating a voltage across it. A very small voltage for a very large current. An appropriately sized shunt put in between the controller and the motor would produce the 1.7V necessary for input into the microphone jack. (In practice, we would probably rather get a shunt that produced less of a voltage drop, then scale the voltage back up again so as not to waste as much power). The microphone input would therefore handle two phases, since each phase could be assigned to a channel. We would need two microphone inputs. Such a sound card is not expensive. Such a sound card has been built into every motherboard I've owned in the last 10 years.

I agree that it might be simpler to do the position sensing in hardware. But it is more flexible to do it in software. With appropriate software, the controller could work with ANY motor and ANY sized power circuitry. Software could also be easily configured to do ABS, traction control, and all sorts of other interesting features. And such software, while somewhat difficult, is within reach of your average linux programmer easily. Which are not that hard to find (I could probably dust off my rusty linux programming skills and get it done, if need to).


----------



## JonasMeyer (Feb 28, 2009)

Check out http://www.ehow.com/how_2278973_use-sound-card-as-oscilloscope.html to get an idea of what I am talking about.


----------



## frodus (Apr 12, 2008)

Technologic said:


> I'm fairly disappointed after getting to about page 25 in that master's thesis.
> 
> Not only is his grammar incredibly poor, but his marketing skills are highly questionable (especially considering the fact he is a master's student in electrical engineering).
> 
> ...


Maybe that one isn't done well gramatically, but the ones I've read seemed well put together.... He's likely an exchange student, with english as a second or third language. Engineers aren't known for writing the best papers, but its not as much that, but that it contains useful information and data. I see what you mean though, it needs some "polishing"... 

When you say his marketing skills are questionable...... he's an electrical engineer.... I guess I don't see where marketing comes into play... maybe I'm missing something.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> The microphone input would therefore handle two phases, since each phase could be assigned to a channel. We would need two microphone inputs.
> 
> I agree that it might be simpler to do the position sensing in hardware. But it is more flexible to do it in software. With appropriate software, the controller could work with ANY motor and ANY sized power circuitry. Software could also be easily configured to do ABS, traction control, and all sorts of other interesting features. And such software, while somewhat difficult, is within reach of your average linux programmer easily. Which are not that hard to find (I could probably dust off my rusty linux programming skills and get it done, if need to).



There's nothing wrong with doing it this way... I just am saying that a properly designed software package would be better served hardwired into the controller itself instead of portable computers (for lots of reasons).

You don't need to design it that way if you don't want to, and of course the versatility of having a LCD screened program would be nice.

I'm not sure why you can't just grab up some basic small motherboards (for pocket PCs etc) and design the program for them

For instance something like:
http://www.alibaba.com/product-gs/204256673/MINI_ITX_M4S2GAP_Intel_945GSE_computer.html

this with the CPU and everything ready to go for $20-30 each... mount it directly to a DC-DC converter and you should be basically good to go (saving the end user the effort and time... they can just plug and play)...

Sure it will eat up a tad bit of efficiency (160watts or so tops), but it'll function well.


----------



## Technologic (Jul 20, 2008)

frodus said:


> When you say his marketing skills are questionable...... he's an electrical engineer.... I guess I don't see where marketing comes into play... maybe I'm missing something.



If you're a professional in any field and don't have marketing skills (even self marketing skills) you won't get far


----------



## frodus (Apr 12, 2008)

Technologic said:


> If you're a professional in any field and don't have marketing skills (even self marketing skills) you won't get far


Ok, you were more referring to self marketing  gotcha. I was reading through it and didn't see any mention of marketing a product and was like.... WTF are you talking about  

I agree though, it would have done him good to proofread it more.... peer review. But he'll likely go back to Asia and work for some huge company and be able to write in his tongue again.


----------



## Technologic (Jul 20, 2008)

frodus said:


> I agree though, it would have done him good to proofread it more.... peer review. But he'll likely go back to Asia and work for some huge company and be able to write in his tongue again.



 Actually national retention in the sciences are the highest in history... over 67% of Asian post graduates in Engineering stay in the country.

/random fact 

You're absolutely right though. Going back and doing engineering work in Asia is probably a better option these days.


----------



## Evan (Feb 20, 2008)

I have no dog in this fight. 

Though on the earlier talk about motor control no one should use embedded computers (desktop ones) for a motor controller. Don't use a sledgehammer to insert a thumb tack.


----------



## Technologic (Jul 20, 2008)

Evan said:


> I have no dog in this fight.
> 
> Though on the earlier talk about motor control no one should use embedded computers (desktop ones) for a motor controller. Don't use a sledgehammer to insert a thumb tack.


A lot of times I'd totally agree with you, but people don't design these motor controllers with intelligence in mind 

They usually just pull crap out of nowhere and shove it in there for the software, often extremely expensive domestic components.

I mean is it really logical to spend $40 in parts just to oscillate the frequency based upon a looped input (or however they do it)? No it's not... it's dumb as hell, but the crap happens on a very regular basis in motor controllers for cars.


----------



## Evan (Feb 20, 2008)

I get the impression ACP and Azure (Solectria) are using DSPs from ether Motorola or TI. Both TI and Motorola have application notes for using a few of their product lines for AC motor control. That said this is still not the whole thing because there are car related things that have to be built into the controler, like an interface for CAN Bus or accelerator petal for example. I will grant you we tend to over think the problem and the chips they are using are likely over kill but that has more to do with the maturity of the product than anything else. As a machine matures from prototype to commerical product it typically gets it's part count thinned and excess things like processing power are better scaled for the job. I suspect that this is what ACP has been largely doing for the last 10 years, besides working out largescale lithium BMS issues. As for Azure, I have no idea what they have been up too. Solectria went threw a managment turnover as I understand it when they changed hands and moved to Canada. Azure might not have done anything to their product. 

The real cheasy work on EV motor controlers as I see it is largely in the area of DC ones from mostly Chines vendors. The few domestic ones we have like Zilla are very good from what I hear. The bad ones are not the result of people looking to do quick engineering they are the result of people looking to make a cheap product for a high profit margin.

No AC or DC motor controler could be made for $40. The SVM stuff might have a parts cost close to that but once you get done paying for the engineering time it goes past $40. The cost for DIY fabricating a good sized PCB board is like $35, good 4 layer (to keep noise down), conformaty coat (corrosion). Then you add the parts which would be another $40. So that is what $75, now all you need is the IGBTs, caps, copper, and connectors. For a good DIY 3 phase system not including the motor this is around $1000. What a company would get in reduce costs given the current size of the market is anyones guess. Unless it grows past a few hobbiest right now though I suspect they will end up with costs around the scale I have just illistrated. Now what kind of mark up would you need to add to be able to make these for a market this small and still be able to eat? I would be it is fairly large and considering the engineering involved not undeserved. Oh and your company if they serve the DIY conversion community will need insurance to protect itself from that user who zaps him/her self with 500V when they don't read the instructions.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Now what kind of mark up would you need to add to be able to make these for a market this small and still be able to eat? I would be it is fairly large and considering the engineering involved not undeserved. Oh and your company if they serve the DIY conversion community will need insurance to protect itself from that user who zaps him/her self with 500V when they don't read the instructions.


I've been refreshing myself in the last 4 days on this matter and I'm going to mock up a simple oscillation circuit for the inputting task. I'm hoping I can do so... I've read about 800-1000 pages of EE textbooks in the last 36 hours (yeah what can I say... I'm a nerd).

You don't need to worry about if some moron zaps himself with 500v (especially not in my case as I'll be licensed sometime next year to practice law )

At any rate, the reason there isn't anything out there is because the DIY people aren't bothering to make it. 3 phase AC motor controllers might be sufficient to get your PH.D in the field, but they do not warrant this kind of "voodoo" and price scales going on right now.

You talked about the prices of PCBs, etc but even in small quantity it starts becoming highly questionable why you're sourcing anything domestically.

I can find no good reason, for example, to purchase parts on Digikeyll, or to purchase $800 in general components for 1 controller... there just isn't any price scales like that outside of resellers (and small volume people like digikey)

I don't know the dynamics of the "engineering" but making the motor controllers only programmable with some other motor controller programmer always seemed equally as crazy as using discrete parts to do basic MOSFET functions on the input control portion.

Why not just put a USB jack on it and if someone buys it include a CD to change the functions? surely OEMs will like that idea just as much as any end consumer would.

Though 3 phase AC motor controllers are more important to have them timed correctly to the proper motor you're using, this in the end just keeps begging the question.

I've viewed that BLDC schematic for both the monitoring and output stages and I just don't see where the engineering time was spent... I realize it's not easy at all to perfect the input stages and amplification (I can't imagine it would be anything but difficult with large amounts of trial and error), but the basis is highly workable and a generalized schematic could be ready for modification in a fairly limited amount of time.

Are these AC controllers really worth more than DC ones? well lots of companies like Curtis and Zapi don't really seem to think so, and rightly so.

Controlling gain frequency vs controlling current directly (like in DC controllers) is a completely different ball game of easy design. It seems the stigma stems from the "unknown" factor because almost none of these ultra large format AC controller schematics have even been seen.

If you asked a lot of people on here or OEMs they'd prefer the motor controller that died after 2-3 years of use and cost them 20 times less, over the $25,000 ACP system.

I can't say I blame them either.


----------



## Evan (Feb 20, 2008)

This is America home of the Million dollar coffee burn, you can sue for anything if you do it correctly. You might get by with a warning label but I doubt it. A ladder is simpler, safer and easier to use and yet it needs a long warning label. Every year it seems someone finds a new way to sue a ladder company for not putting something on the warning label. 

Ok fine go the commercial market. They won't deal with you unless you are doing at least a few thousand of anything when it comes to the PCB. You would need at least a few hundred thousand I suspect before the IGBT/MOSFET people would be interested. I guess you could use like 600 MOSFETs instead of 6 IGBTs or 1 IGBT module but that would be a mess. I suspect that a lot of the controller failures we see are because of temperature drift and anging issues causing them to not age the same way and become unbalanced. Using one large module or at the most 6 is best.

As for this....
"I don't know the dynamics of the "engineering" but making the motor controllers only programmable with some other motor controller programmer always seemed equally as crazy as using discrete parts to do basic MOSFET functions on the input control portion."
We make them programable because when you make something domestically the parts you use is the main factor in the cost. When you do it commercially the main factor in the cost is part count. Programable parts often mean reducing the number of chips and that reduces cost more than them being programable or needing to be programmed. That is part of the dynamics of commercial engineering. Look at TIVO the first generation one was basically a modified version of an Apple Macintosh. The last one was more like a cell phone. Custom parts that would be millions domestically but commercially and in the millions they make more that way because it keeps the number of parts down. It is also basic business when you have to buy a larger variety of parts you have more to invantory to manage, more vendors to dealwith, and it tends to cost more than when you have a simpler product. 

I am talking in domestic terms but I understand how to match them to commercial ones. I could do a dirt cheap motor controler but it would be a piece of junk. It wouldn't have much in the way of safety, it wouldn't have good current control, it might burn the motor out, it would be very inefficent and etc. I take more pride in my work than that. I won't go that way. If electric cars are to be taken seriously they will have to be of a higher quality in terms of design and manufacture than commercially make ICE ones. If it needs a part, even a small one, replaced as often as an ICE requires an oil change then it isn't going to work in the market as well. These cars are going to go less distance at least initially on a charge verses a tank of gas the least we can offer the consumer is not needing repaires/servicing all the darn time. 

I suspect that if you buy say an Azure AC system it comes with such a disk. I don't know how many parameters it lets you change but it a lot of them. As I understand it the setup is done via an old school RS232 port. Even industrial USB is not good for cars or anything with this much noise. I would personally encourage it but insist that anyone who does it not expect to be able to use their warente. 

Computer comanies used to ship their products with an unlocked system BIOS. You could change the processor speed, core voltage and etc. They don't do that any more because to many people were changing settings, breaking the hardware in the process, and then calling the company for a free repair. When you have something like an electric car with KWh worth of power in it a software glitch can mean quite a big fire. Now properly designed hardware can midigate this but it can't eliminate it. Some functions will just have to be not end user accesable if they want the company to cover them period.

Yes I could turn you out a schematic on a napkin during dinner but there is more to it than that. IGBT's are prefered because for AC you *need* fast switching with low input capacitence, the input of a MOSFET is effectively a capacitor. Infact that is how some memory chips and sample and hold circuits work. For maximal effency out of an IGBT you want it to be warm but not too hot. For MOSFETs you can just keep them cold which is hard, and they do warm up as you increase the amount of power involved. IGBT's can't be paralleled period. I know some do it but buying enough of them to get a few matched pairs is hard. In the DIY market this is impractical because you would need to buy so many. In the commercial market this is impractical because of the labor costs. (I prefer to be patriotic and go american made) Now you need to monitor the current to the motor so you need ether to use a shunt or current sensing transformer. The shunt is cheep but might oxidize or corrode. The transformer will need to be protected from stray EMI of which there is a lot and it will be expensive because of the copper in it. Now you need something like a simple optical encoder or hall effect sensor to check the speed of the motor and two programmable chips, 1 for user interface and 1 for actually switching power, plus something to act as glue logic for it all. Yes you can get off the shelf 3-Phase PWM chips but their algorithems are limited in terms of the number of tunable motor parameters and they are not meant for running off a battery so power efficency is not really their strong suit. Even still that is just 1 of the two chips that would need programming. Don't forget those chips need clean regulated power, heat control of their own if they are near the IGBTs and etc. Oh yea heat you basically have to go forced air no mater which way you go. You have to impliment PID to regulate temperature if you want to wast the least amount of power running the fan. Great engineers, of which I am not one sadly, make this all look simple. I know a few such people and even they take at least 3 tries before their first completely new design works. 

If you wanted to play it risky you could merge the chips used for user interface and motor control/recharging. I would integrate the recharger in with the motor control to cut costs. If you do that though the code gets a lot more complex and the timing a lot harder to do with out more powerfull processors. If you were talking about mass production in the hundreds of thousands you could make an ASIC to combind a lot of these functions. Typically you build it the way I am describing and then combind it into an ASIC. The problem is convincing a bank to loan you the money to do it and securing the nessisary licences for things like the intelectual property for the core of those microcontrolers. Most of all you would also need atleast a few hundred thousand customers. ACP and Azure have carried this task forward and are stuck I think at this point. They need a major car company to agree to use their product in a car with more than a few thousand customers. As for the people you talked to, they are EV early adopters, people who want the technology enough to convert the car them selves, or pay someone else too. These are people who go threw a lot just to get off gasoline or because they like new tech. To lower costs the way you want you have to find someone who will work for nothing but the thanks of these people or find another 99,000 more like them with money.

You are correct there is a stigma around AC control. I find that few of the people I have met so far know about it. It isn't like there is a lot of black magic in it. Most black magic is reserved to RF engineering which is nicknamed black magic in the area of EE by the way. Curtis makes cheap made in china junk that has had a few spectacualar falures. Zap is very shady in their business dealings. I would not be using ether of them as examples if I was you. 

I have seen large format AC controler schematics. There is no voodoo but it like any unique problem has it's own unique optimal solutions. They are not all obivous. When you look at the diagram it only looks easy. Getting there is often not so. Was the design you saw for the BLDC controler one for a car? The ones for industrial equipment are simple because they have inefficent but custom made chips for them. Those chips are made just for companies like Siemens and Brusha who don't sell to the rest of us. Getting the schematic is one thing they all look basically the same. The devel is in the details. You never saw the pages of math, spice simulation code, or thermal models that were made to check the desings road worthyness or optimize it's efficency. The hours of testing? The hours of work spent finding ways to shrink the parts count to keep the costs low? It is true once you have made that first model that works the next one takes like 1/10 the time but you have to spend the time and money to get there.


----------



## Technologic (Jul 20, 2008)

Evan said:


> This is America home of the Million dollar coffee burn, you can sue for anything if you do it correctly. You might get by with a warning label but I doubt it. A ladder is simpler, safer and easier to use and yet it needs a long warning label. Every year it seems someone finds a new way to sue a ladder company for not putting something on the warning label.


Yet another reason to go overseas as far as I'm concerned... the DIYer will be rigidly limited in any recourse, though that does not mean an open source system where everyone was aware of the parts would be particularly "low quality" either.



> Ok fine go the commercial market. They won't deal with you unless you are doing at least a few thousand of anything when it comes to the PCB. You would need at least a few hundred thousand I suspect before the IGBT/MOSFET people would be interested.


Certainly if you were looking for a custom chip made... but that's probably not necessary at any level.
Chinese suppliers deal with low volume a lot, even in the realm of discrete parts (and custom PCBs).


> Programable parts often mean reducing the number of chips and that reduces cost more than them being programable or needing to be programmed. That is part of the dynamics of commercial engineering. Look at TIVO the first generation one was basically a modified version of an Apple Macintosh.


I'm not talking about PCB stamping being done or fully automated PCB construction (via precise CAD programs)... I'm talking about not using 6 x $147 IGBTs and instead use a decently larger volume overseas construction source that will offer you them for $20 (of course you could get them for 1/4 maybe even 1/8th that much in 100,000 quantities... but it's not relevant to what I'm talking about).



> If it needs a part, even a small one, replaced as often as an ICE requires an oil change then it isn't going to work in the market as well. These cars are going to go less distance at least initially on a charge verses a tank of gas the least we can offer the consumer is not needing repaires/servicing all the darn time.


You're discussing two different things... mass market appeal and DIY costs... this market won't start anywhere but the DIY market for at least another 7 years. Aptera, the only fully electric car that will be seen in the next 5 years at least, doesn't even use an AC motor/controller.



> I suspect that if you buy say an Azure AC system it comes with such a disk. I don't know how many parameters it lets you change but it a lot of them. Even industrial USB is not good for cars or anything with this much noise.


Maybe there's stuff going on in AC controllers I'm not aware of, but there's nothing that deeply dynamic about them especially if you were offering them in a motor/controller kit... could be wrong.



> Computer comanies used to ship their products with an unlocked system BIOS.


They still do if you buy any raw computer parts and build your own... Asus still hasn't been sued yet over it. In fact there's almost no precedent to expect that a parts supplier to end consumers is responsible for misuse of the product due to ignorance... basically just prevent fires from ever happening and there'd be no real concern if someone decided to hack the controller or whatever.



> Yes I could turn you out a schematic on a napkin during dinner but there is more to it than that. IGBT's are prefered because for AC you *need* fast switching with low input capacitence, the input of a MOSFET is effectively a capacitor.


The back EMF sensing circuit could use an opamp oscillator that's signal generator is looped to the throttle pot (unless I'm completely bonkers here). That in turn could provide something that would have almost no capacitance (the rest of the circuit would be signal gain from that via IGBTs).

I don't see the problem with this besides having to create some sort of adjustable timing for different motors (since each will have a different characteristic for maximum phasing).

I'm still learning more about AC motors, but it's somewhat difficult to find any good insights or comprehensive sources




> As for the people you talked to, they are EV early adopters, people who want the technology enough to convert the car them selves, or pay someone else too. These are people who go threw a lot just to get off gasoline or because they like new tech. To lower costs the way you want you have to find someone who will work for nothing but the thanks of these people or find another 99,000 more like them with money.


I don't really understand why you believe an open source AC controller wouldn't be an amazing thing for the DIY community and anyone in general... you could simply license it out to only DIY efforts to force these terrible companies to either 1) come to you so you can make it cheaper for DIYers or 2) spend more to create their own to compete with cheapening DIY costs

At any rate, people constantly sacrifice for the DIY car builders... Just look at the battery testing I've done and other's have. I personally have done it for other people more so than myself at this point, since I'm unsure when I will be ready for the batteries.

I have over 600 college textbooks in electrical engineering ... I plan to read 1/2 or 1 a day until I get a solid idea of what's involved here. Why? because it's fun... and it will give me something to keep me sane. Cheers... My semester is basically over next week... I'll have lots and lots of time from now till this summer when I finally will have sufficient means to work on my own project.



> You are correct there is a stigma around AC control. I find that few of the people I have met so far know about it.


Therein lies the problem. A lot of these car companies aren't making these controllers either. These hybrid cars are using high voltage but low amperage AC (or BLDC) controllers ... sometimes even single phase only rated for moderate wattage outputs...There's no telling when cheap, reliable, well made high mileage fully electric cars will be available to us... It might just fall back into the "never happen" phase again like it did in the 90s



> I have seen large format AC controler schematics. There is no voodoo but it like any unique problem has it's own unique optimal solutions. They are not all obivous. When you look at the diagram it only looks easy.


I don't know, the parts are common ones and readily available... Even a 90% efficient controller would best the vast majority of controllers out on the market. Though I'm not a fan of it, there's certainly ways around that efficiency problem.

Efficiency losses are certainly serious ones... but optimization can be helped along by "passerby geniuses", since they exist throughout this community. I think at this point everyone no matter their car design plans would praise and probably purchase a reliable decently cheap (<$1000) AC regen controller... and a motor selection that could run your 2500lb sedan.

Maybe I'm wrong, but it's not like I have anything better to do.


----------



## Anaerin (Feb 4, 2009)

Wow. There's a character limit? Who knew. Let's try shortening this monster! The "..." indicates where I've snipped for brevity.


Evan said:


> This is America home of the Million dollar coffee burn, ... Every year it seems someone finds a new way to sue a ladder company for not putting something on the warning label.


Great! Can I sue you for this novella of a post? 


Evan said:


> Ok fine go the commercial market ... Using one large module or at the most 6 is best.


The problem is, for AC especially, there is NO WAY to use a single module, as you need to switch 3 full phases of current, both positively and negatively, which means a minimum of 6 IGBTs.


Evan said:


> ...Look at TIVO the first generation one was basically a modified version of an Apple Macintosh. The last one was more like a cell phone.


No, it was, and still is, a Linux PC in a box.


Evan said:


> Custom parts that would be millions domestically but commercially ... and it tends to cost more than when you have a simpler product.


Working with off-the-shelf parts is always cheaper than custom making parts to suit, but there comes a point where off-the-shelf doesn't do all you want it to anymore. At that point, bespoke parts and manufacturing are a more viable option. And, of course, once those parts become more mainstream, a single part will be created by manufacturers looking to cash in on the market.


Evan said:


> ...I could do a dirt cheap motor controler but it would be a piece of junk...


Only if you made it so. If you are building your own, it is entirely up to you just how much (or how little) safety equipment and checks are implemented.


Evan said:


> ...If electric cars are to be taken seriously they will have to be of a higher quality in terms of design and manufacture than commercially make ICE ones...


Considering just how reliable ICE cars are, how much care needs to be taken with their maintenance, especially out of the "Warranty Period", even a burnt out controller in an EV is less hassle.


Evan said:


> These cars are going to go less distance at least initially on a charge verses a tank of gas the least we can offer the consumer is not needing repaires/servicing all the darn time.


And we already do. For 90% of the conversions I've seen on here and in EVAlbum, once the conversion is done it's very "Hands off", as far as maintenance is concerned. The only issues tend to be watering Lead-Acid batteries, and the popularity of Li-ion cells will make even that task a thing of the past.


Evan said:


> I suspect that if you buy say an Azure AC system it comes with such a disk... I would personally encourage it but insist that anyone who does it not expect to be able to use their warente.


Leaving aside the whole USB vs. RS232 issue (Twisted, shielded, balanced and RF Choked cabling vs. bare wires), if a fault with a controller is found to be manufacturing defect, no matter how that fault is discovered, it is not the customer's place to pay for the replacement of that product. If, however, the fault is due to bad judgment on the part of the customer, it is entirely their fault.


Evan said:


> Computer comanies used to ship their products with an unlocked system BIOS...They don't do that any more because to many people were changing settings, breaking the hardware in the process, and then calling the company for a free repair.


Actually, they still do. Most, if not all, BIOS' have overridable settings, to adjust system voltages and clock speeds beyond the limits suggested by the manufacturers. Some CPUs do have their "Multiplier" locked, but adjustment of the front-side bus is still very simple (Take the BIOS out of "Auto" mode). And AMD sell "Black Edition" CPUs, which deliberately don't have the multiplier lock engaged, so customers can overclock their systems to their hearts (and wallet's) desire. 
These days, CPUs and Motherboards have frequency scaling, so during idle periods the CPU isn't running as fast as it would at full load. It is also used to ensure if a CPU is getting close to overheat condition, it's internal frequency is scaled back to ensure there is no hardware failure.


Evan said:


> When you have something like an electric car with KWh worth of power in it a software glitch can mean quite a big fire...


As ever, with the appropriate amount of system monitoring, this shouldn't really matter. If someone runs their motor at too high a voltage and too high RPMs, the thermocouple on the motor itself will register an overheat condition, and back off the power. If someone tries to start their car WOT from a standing start, the controller will see the massive over-rush of power and moderate the control, backing off the current to maintain it's own (and the motor's) integrity. While a controller may be open to complete customisation, safety limits should still be set, both for values used and for internal measurements.


Evan said:


> Yes I could turn you out a schematic on a napkin during dinner but there is more to it than that...


Saying "Can't be paralleled period" is a little harsh. While like IGBT's may not match exactly, the difference between them, while not zero, is small enough that for most cases you can treat them as matched.


Evan said:


> Now you need to monitor the current to the motor so you need ether to use a shunt or current sensing transformer. The shunt is cheep but might oxidize or corrode. The transformer will need to be protected from stray EMI of which there is a lot and it will be expensive because of the copper in it.


Or you could use a Hall effect current sensor.


Evan said:


> Now you need something like a simple optical encoder or hall effect sensor to check the speed of the motor and two programmable chips, 1 for user interface and 1 for actually switching power, plus something to act as glue logic for it all.


Why 2 chips? Most microcontrollers (ATmega, or PIC for example) have high speeds and many analog and digital I/O lines, along with tunable PWM systems. Though for AC use, the tunable PWM on a microcontroller may not have fine enough controll for VFD use.


Evan said:


> Yes you can get off the shelf 3-Phase PWM chips but their algorithems are limited in terms of the number of tunable motor parameters...


The clean, regulated power is really not that big an issue. There is a huge industry dedicated to simple, efficient and accurate DC-DC power conversion.


Evan said:


> Oh yea heat you basically have to go forced air no mater which way you go...


Or you could try watercooling. Again, there is a small but growing market for watercooling on 12v - those PC overclockers again.


Evan said:


> ...I would integrate the recharger in with the motor control to cut costs...


Recharger? I thought we were talking about a motor controller, not a recharging system as well.


Evan said:


> If you were talking about mass production in the hundreds of thousands you could make an ASIC to combind a lot of these functions...


Or, as mentioned before, you can use an existing microcontroller to handle most, if not all, of the low-power requirements.


Evan said:


> ACP and Azure have carried this task forward and are stuck I think at this point. They need a major car company to agree to use their product in a car with more than a few thousand customers.


But we're not talking about commercially producing systems for mass consumption (at least, not yet). This is, as the title of the thread states, for a DIY controller.


Evan said:


> As for the people you talked to, they are EV early adopters, people who want the technology enough to convert the car them selves, or pay someone else too...


Or, build on a small-scale, with basic laser-printer-etched PCBs, simple through-hole design and basic reflow soldering, in a standard box, and charge a modest fee for a workable controller. Not huge, exorbitant amounts, just cost of materials + cost of labour + modest profit. Even working on a small scale, that would still be considerably less than the many thousands of dollars required for a controller today, if you can even find somewhere that makes and sells them.


Evan said:


> ...Curtis makes cheap made in china junk that has had a few spectacualar falures. Zap is very shady in their business dealings. I would not be using ether of them as examples if I was you.


Curtis is one of the most popular, and most reliable, controller makers out there. They've been doing it for years, and probably still will be. One or two "spectacular" failures, considering the sheer number of units in the field, is still a slim failure rate.


Evan said:


> I have seen large format AC controler schematics. There is no voodoo but it like any unique problem has it's own unique optimal solutions. They are not all obivous. When you look at the diagram it only looks easy.


As with anything, really. It is generally only through experimentation on the small scale that one can learn the potential problems, and solutions. But with a simple DIY system, these experimentation steps can be gone through quickly, with lessons learned on-hand, and modifications simple to make.


Evan said:


> Getting there is often not so. Was the design you saw for the BLDC controler one for a car?...


We will have peer review, and the many eyes of the internet, to help spot problems and optimise the system. And for each person building the controller (Remember the DIY part?) it will be up to them to build it as-is, or try and improve it and report back as to how their changes helped or hindered.


----------



## Evan (Feb 20, 2008)

Both of you - I am getting a wrist cramp. Sorry I will say more some other time.

Technologic - 
But with something like this preventing fires while preserving total software accessibility is impossible without adding even more hardware and associated costs. I know if you buy a motherboard they don't lock them but that is just because you will need to set all those options for the CPU you buy. Also they know there is a high end market for over clockers. 

There are technological developments in AC motor control. I have read a few papers on it from 1998 to 2006 that mention ideas that are not yet being used. I know of none newer than 2006 but these things tend to come in cycles and right now it looks like application has drifted 90 degrees out of phase with research. I have hypothesis on why this happened but it really does not matter. 

Look back EMF sensing is really best used on DC motors. The signaling noise generated by the final stages IGBT's is very very high. They tend to ring even on the ones I have for small motors. You could build some tuned analog circuits to do all this but it would not be as flexible about motor choice as doing it with code. Trust me I looked into it a *lot*. Not to mention that the parts count starts to get kind of high. Not to mention dealing with way an analog circuit would drift in timing as your battery discharges would be solvable but not easy. Look you understand the basic idea but you are missing the detail. I sugest if you don't believe me you try it.

I think in the next 10 years we will see 150Mile range cars that cost between $40K and $50K. If someone builds enough charging stations for people to out grow their range anxiety. As for anything going single phase the only car I know that does anything like that is the first generation honda insight. It wasn't really single phase though. They were just subsituting one phase of the motor for part of the stroke of the engine. (I am not an ICE person so I might be miss using the term stroke) Basically though it wasn't really using the motor for the full rotation. 

I believe an open source AC controller would be a good thing. If there is a way for me to help I will try too. As for licencing it, I don't see how that would work. True open source is like GNU software. You really only have to ways to make money. Sell you time to a company that needs to add feature X to it. Sell a book on how to do X to/with it. Sell a large enough number of kits of it to make money off the economy of scale. The only one I can see working is selling a book on the thing. I guess that might work until someone sets up a wiki for it and rewrites the book there only better. 

So if I read you right I confused your use of domestic for domestic/commercial with domestic/foregn. I have some personal reasons against doing it in china. But you know if you believe in the American capitalism then you should support American Labor by using stuff that is made in America. I don't mind buying parts that are made in Japan or where ever but I would never run a company that depeneded on chinese manufacturing. Unless they payed a decent wage, conformed to human rights standards, and etc. You have no idea how hard it is for me to buy cloths right now.

Most controlers are around high 80% to low 90% in a given range. I don't know how well that range over laps the speed/acceleration most people average though. Or for that matter how much most cars need due to high drag and weight.

There are other things I could say but I actually do have better things to do. I can't help with an open source project if I don't work to pay my bills. That means some closed source sadly. 

Anaerin - I will write the way I talk. I am normally very polite. Ask Technologic we rarely agree but we don't fight. You however talk to me like I don't know anything. So I will respond with the same. Get over it.

No the TiVO switched to an ARM processor from a PowerPC. The older PPC chip was so much more powerfull than the ARM. I have worked with PPC and talked to a TiVO programmer I know. There is a big difference there. Yes I know it runs linux. I played around with TV on a linux box before TV. Heck I had TV on my PC back in the 1980's.

Really you can't use one module? Look at Eticher. 6 IGBT's in 1 module. It is a heating nightmare but it works. I know about battery watering I have been following EVs since I was a little kid. Please look at my other posts on this forum I know what I am talking about. 

"Leaving aside the whole USB vs. RS232 issue (Twisted, shielded, balanced and RF Choked cabling vs. bare wires), if a fault with a controller is found to be manufacturing defect, no matter how that fault is discovered, it is not the customer's place to pay for the replacement of that product. If, however, the fault is due to bad judgment on the part of the customer, it is entirely their fault."
Duh the problem is they (customers) often don't see it that way.

"Saying "Can't be paralleled period" is a little harsh. While like IGBT's may not match exactly, the difference between them, while not zero, is small enough that for most cases you can treat them as matched."
And then the temperature grows and they drift farther apart. Look I don't want too or have time to teach semi conductor physics to you. Sorry if I sound condicending but you are talking to me like I don't know what I am doing.

Yes I left out hall effect sensors. I don't like them.

The PWM component of things like PICs, AVR, Propellar, ATmega which are all 8051 variants by the way isn't really meant for SVM. They are meant for doing things like controling DC motors. Long repeating pulse trains at a constant duty cycle. To make a sinewave takes a totally different aproch. 

Yes I was wrong you could go water cooled but the reason no one does it is because why add a pump when you can add a fan. Fans are cheaper, and more reliable. It is like the Curtis thing. When I make something it is designed to last min 10 years of hard use with out issue. He is talking about replacement controlers like every 2 or 3 years. The new IGBTs would cost like $300 a year.

I was etching PCB back when you needed PH buffered pens and tape. I know about laser printing paper PCB. It wastes copper and doesn't deliver the kind of quality a place like Alberta Printed Circuits or 123PCB or whatever else can do. When you make the footprints for finer pitch parts you have issues. Typically fine wiskers between pads. I hate having to go threw and take an exacto knife to the board. 

As for you analysis of costs you are thinking DC I am talking AC. When it comes to making corrections to a design that depeneds on the design in question. If you go my way and do it programmably then yes it might just be changing the code. If we go Technologics way you have to re-run a lot of numbers to change a lot of component values to retune the thing. I have written code for projects like that in matlab and octave and it is not fun.

I know about opensource projects. I started using linux back in 1998 back when it was just a project to most people. I build my first electronics project when I was 5. I have been in this for a long time. There was an eariler thread on AC Controllers and another on Open Source ones I added too look at my posts there.


----------



## Qer (May 7, 2008)

Evan, great posts. You seem to know your shit.



Evan said:


> Getting the schematic is one thing they all look basically the same. The devel is in the details. You never saw the pages of math, spice simulation code, or thermal models that were made to check the desings road worthyness or optimize it's efficency. The hours of testing? The hours of work spent finding ways to shrink the parts count to keep the costs low? It is true once you have made that first model that works the next one takes like 1/10 the time but you have to spend the time and money to get there.


Amen! And the devil is really in the details, even on the software side. To make the software reliable and safe for a controller you really have to keep a sharp eye on possible caveats. The code for the basic functionality in our controller has now passed well beyond 1000 lines of code, out of that less than a fourth of it is involved in the actual driving (ie throttle, feedback, pwm etc) but that part has given me so much more grief than the rest put together. When you look at the code now it doesn't look that impressive but that's because you can't see the history behind it.

The microcontroller generates some thousands of interrupts every second, the pwm has to be adjusted in a way that doesn't make it dangerously sluggish while not risking oscillation and there's tons of tresholds and user settings to take into account and then there's the errors. What should the controller do when there's an over current situation for example? How long can it try to rectify the situation before it should give up and abort? And, of course, to make things worse the computal power is rather limited, to say the least. All algorithms has to be boiled down to a minimum where they're accurate enough to not cause noticeable errors while still executing in a limited set of time. The fastest parts of my code executes in a few hundred nanoseconds. No .NET there, that's for sure...

Admittedly, this is a DC-controller, not an AC-controller, but most of the problems will be rather similar. After all, most of the code is not about actually changing the PWM, before that can happen a lot of calculations has to be done to know HOW to change the PWM.



Evan said:


> The PWM component of things like PICs, AVR, Propellar, ATmega which are all 8051 variants by the way isn't really meant for SVM. They are meant for doing things like controling DC motors. Long repeating pulse trains at a constant duty cycle. To make a sinewave takes a totally different aproch.


Actually, you're a little bit wrong here, but just a little. 

You could use the ATtiny261/461/861 for it since it's made for controlling BLDC's. Still no AC, of course, but still an improvment over "Long repeating pulse trains at a constant duty cycle". Minor detail, but I thought it could be a fun little tidbit. However, since it's a tiny it lacks, for example, multiplications and also only have some hundred bytes of RAM so if you don't add a second microcontroller for the high level stuff you're either a machosist or plain stupid...


----------



## JonasMeyer (Feb 28, 2009)

Qer said:


> And, of course, to make things worse the computal power is rather limited, to say the least. All algorithms has to be boiled down to a minimum where they're accurate enough to not cause noticeable errors while still executing in a limited set of time. The fastest parts of my code executes in a few hundred nanoseconds. No .NET there, that's for sure...


This is why I would advocate going for an embedded linux solution. It may be using a sledgehammer to nail in a tack, but it is a cheap sledgehammer that is only getting cheaper. The kernel has good real-time support these days, and most diy people are going to have very few issues scrounging parts. A good hardware is 1000 times more efficient than a good software one, but who cares? The pc MIGHT consume 200 watts if you are really sloppy with your build. More realistically, it's going to consume 20 watts. But it is then up to the end user to choose, and we can all cooperate on the software side. We don't have to worry about our processing power budget at all, and the sky is the limit in terms of interesting features. I'm basically sold that using the sound card is a bad idea, and we probably want to use a serial port or something else.

As for IGBTs and the power circuitry, I'd advocate a design that used fewer higher rated parts. Every part that the end user (or the cottage manufacturer) has to mount is one that can accidentally be mounted improperly (which would affect yield in manufacturing, and reputation for the project). There are cheap IGBTs out there with good power dissipation and specs well above what we need. Even if they are a little more expensive, I think it is worth it. Obviously we need to take into account heat dissipation (heat more concentrated with fewer components), but this is a well studied problem with MANY off the shelf solutions in the diy desktop computer industry.


----------



## Anaerin (Feb 4, 2009)

Evan said:


> Anaerin - I will write the way I talk. I am normally very polite. Ask Technologic we rarely agree but we don't fight. You however talk to me like I don't know anything. So I will respond with the same. Get over it.


I apologise if I sounded condescending or patronising. That was not my intent. Indeed, my opening was meant to be taken as a light-hearted and playful joke, and was supposed to set the tone for the message as a whole. I sincerely apologise if that is not how my message came across.

I make no claim to having any practical experience in this field, only what I learned taking A-level courses in Mathematics, Physics and Electronics. I do not have a Ph.D, or any other kind of formal qualifications, and what I can say can generally be taken with a truckload of Sodium Chloride.

I suppose my abrasive manner could come from having worked in consumer IT support and small-business programming for many years. In general, in support especially, you are encouraged to deal with everyone as though they are complete idiots. Then you'll only be wrong 10% of the time. I apologise for that. I thought I had it under control, but apparently when I get explanatory, I get condescending. Sorry.


Evan said:


> No the TiVO switched to an ARM processor from a PowerPC. The older PPC chip was so much more powerfull than the ARM. I have worked with PPC and talked to a TiVO programmer I know. There is a big difference there. Yes I know it runs linux. I played around with TV on a linux box before TV. Heck I had TV on my PC back in the 1980's.


I had a TV on my PC in the early nineties, and currently run a personal DVR based on Linux and MythTV. To be honest, the core processor of a system makes little difference. I was referring more to the PCI and IDE architectures used within the TiVO. I will, however, concede the point that it's not a PC in the traditional sense, and drop this altogether, as it's really not relevant to the thread.


Evan said:


> Really you can't use one module? Look at Eticher. 6 IGBT's in 1 module. It is a heating nightmare but it works.


I was not aware of this module. It does look ideal, though as you say, temperature control is a problem to be looked into.


Evan said:


> I know about battery watering I have been following EVs since I was a little kid. Please look at my other posts on this forum I know what I am talking about.


I never said you didn't. I was merely pointing out the battery watering once a month or so that an LA EV requires is much less of a chore than 3 oil changes, water filling/changing, and regular mechanical adjustment, changes and maintenance required by an ICE engine.


Evan said:


> "if a fault with a controller is found to be manufacturing defect, no matter how that fault is discovered, it is not the customer's place to pay for the replacement of that product. If, however, the fault is due to bad judgment on the part of the customer, it is entirely their fault."
> Duh the problem is they (customers) often don't see it that way.


True enough. Which is why you give them a system configured for safety, and if (when) they change it's parameters, you have an "On your head be it" disclaimer.


Evan said:


> "Saying "Can't be paralleled period" is a little harsh. While like IGBT's may not match exactly, the difference between them, while not zero, is small enough that for most cases you can treat them as matched."
> And then the temperature grows and they drift farther apart. Look I don't want too or have time to teach semi conductor physics to you. Sorry if I sound condicending but you are talking to me like I don't know what I am doing.


I am always willing to learn, indeed learning new things brings me (almost, darling - I'm sure my wife will be reading this) the greatest pleasure in life. However, with sufficient heatsinking and thermal control, again this is less of an issue. And if the parts used are sized with a sufficient margin over their required ratings, this issue is negated even further. I'm not saying it is not an issue, I'm just saying it's less of an issue than, say, getting the microcontroller programming right, or ensuring the system fails safe.


Evan said:


> Yes I left out hall effect sensors. I don't like them.


Any particular reason?


Evan said:


> The PWM component of things like PICs, AVR, Propellar, ATmega which are all 8051 variants by the way isn't really meant for SVM. They are meant for doing things like controling DC motors. Long repeating pulse trains at a constant duty cycle. To make a sinewave takes a totally different aproch.


We don't need a pure sine wave. A PWM waveform, especially one smoothed with a capacitor, will produce close enough to a sine wave for our needs.
Please see http://en.wikipedia.org/wiki/File:PWM_VFD_Waveform.png and http://en.wikipedia.org/wiki/Variable_frequency_drive


Evan said:


> Yes I was wrong you could go water cooled but the reason no one does it is because why add a pump when you can add a fan. Fans are cheaper, and more reliable.


True, but air can't transport heat nearly as well as water does. And with the larger surface area of a radiator, more heat can be sinked and dumped into the atmosphere with watercooling than with air cooling. And many do. The Siemens drive system used in Ford Ranger EVs and RAV4 EVs were water cooled, as is the BRUSA system that's commercially available.


Evan said:


> It is like the Curtis thing. When I make something it is designed to last min 10 years of hard use with out issue. He is talking about replacement controlers like every 2 or 3 years. The new IGBTs would cost like $300 a year.


That would be quite the pill to swallow.


Evan said:


> I was etching PCB back when you needed PH buffered pens and tape. I know about laser printing paper PCB. It wastes copper and doesn't deliver the kind of quality a place like Alberta Printed Circuits or 123PCB or whatever else can do. When you make the footprints for finer pitch parts you have issues. Typically fine wiskers between pads. I hate having to go threw and take an exacto knife to the board.


I realise that. But we are talking a DIY board, with medium and high voltage components. I would think that at least 70% of people making this board wouldn't want to deal with SMT components (I know I don't have steady enough hands to even think about it), preferring to use through-hole for simplicity of soldering.


Evan said:


> As for you analysis of costs you are thinking DC I am talking AC. When it comes to making corrections to a design that depeneds on the design in question. If you go my way and do it programmably then yes it might just be changing the code. If we go Technologics way you have to re-run a lot of numbers to change a lot of component values to retune the thing. I have written code for projects like that in matlab and octave and it is not fun.


I'm looking at this as an AC system. BLDC holds less interest for me than SepEx and AC. The way I see Technologic's system, you can build and set aside the high voltage section, making it almost a separate module. Once the IGBTs and capacitors are made and in place, you wouldn't need to change them. Then all you need do is perfect your low-voltage circuitry, which can be done on the bench, or in matlab, or however else you like. Once you've got the low-voltage stuff working how you like it, producing the curves you want, at the times and speeds you want, with safety checks and interlocks, you hook it up to the HV module and throw it in a vehicle (or vehicle-like simulator).


Evan said:


> I know about opensource projects. I started using linux back in 1998 back when it was just a project to most people. I build my first electronics project when I was 5. I have been in this for a long time. There was an eariler thread on AC Controllers and another on Open Source ones I added too look at my posts there.


Thanks, I will be certain to do that.

And I apologise if anything I have said in this message has caused offense. That is not my intent. I am enjoying this conversation, learning a lot, and would be honoured to count you as one of my friends.


----------



## Qer (May 7, 2008)

JonasMeyer said:


> This is why I would advocate going for an embedded linux solution. It may be using a sledgehammer to nail in a tack, but it is a cheap sledgehammer that is only getting cheaper.


Well, even though there's real time builds of Linux it's still tricky to find room to swing a sledge hammer in a closet. Your worst enemy is not lack of processing capacity, your worst enemy is latency. But that is a question of design too, if you handle all the problems like over current etc in hardware you don't have to worry about the latency, but if you rely on the computer taking care of protecting the IGBT from blowing up I'm afraid Linux might not be able to guarantee a 100% success rate.



JonasMeyer said:


> We don't have to worry about our processing power budget at all, and the sky is the limit in terms of interesting features.


Definitely, but as I see it using a micro controller or using a complete PC is two different approaches that solves at least partly different problems. The microcontroller can replace hardware since it can, if you write your code right, react in less than a microsecond. The PC can do a lot of funky stuff that the microcontroller can't, that's true, but that's not a replacement for the realy low level stuff that has to be handled in fractions of a millisecond. Personally I wouldn't trust Linux to react fast enough, but that's me. I might be wrong, but my experience tells me that your Linux isn't as much a sledgehammer as a monkey wrench in this case, and a monkey wrench makes a lousy hammer...


----------



## Technologic (Jul 20, 2008)

Anaerin said:


> I'm looking at this as an AC system. BLDC holds less interest for me than SepEx and AC. The way I see Technologic's system, you can build and set aside the high voltage section, making it almost a separate module. Once the IGBTs and capacitors are made and in place, you wouldn't need to change them. Then all you need do is perfect your low-voltage circuitry, which can be done on the bench, or in matlab, or however else you like. Once you've got the low-voltage stuff working how you like it, producing the curves you want, at the times and speeds you want, with safety checks and interlocks, you hook it up to the HV module and throw it in a vehicle (or vehicle-like simulator).



This is indeed what I'm hoping for... to deal with the controls pre amplification stage and use a super high efficiency (Class G or H) to amplify the signal.

This is the part of circuit design I am familiar with, and there's no reason off the top of my head you can't add additional hardware safety checks etc to the low voltage module as well... the delay won't be that severe (I hope)... 

Certainly far more "sane" than shoving 1000s of lines of code into custom microcontrollers... but maybe that's just because I hate programming and like to do everything prior to thinking about what I need to program (and in this case what I'd need to get someone else to program  )

Capacitor smoothing of the PWM would work extremely well.


----------



## Evan (Feb 20, 2008)

The power electronics (FET/IGBT/whatever) will burn a fair amount of power in heat. The processor that drives them should be the opposite though. I don't like things like the tiny PIC micros for this because of the math and memory limitations. Thanks for the info on that Qer and to every one else sorry I need to read more data sheets. Still those tiny chips can be made to run on microwatts of power. Some of you are worried about the power use of what I would call an embedded PC. That is going to run in the watt range no matter how you slice it. I would never trust my life or anyone elses to a car with a controller that runs a full scale operating system. I would also never wast that much power. I would be one thing if we though that one day there would be some earth changing efficiency leap that would need that kind of flexibility. The thing is there isn't anything like that one the way. Those machines are by the way capable of delivering far more processing power than they really deliver in the way of flexibility. I get that you may be comfortable in one type of language or platform than another and that is all cool. I would rather something be made by a person who was working in a medium they fully understand than working with something they don't understand on a problem they have fully researched.

I had this idea a while ago, I don't think this will work to well but why not put it out there. It won't offer any feedback, current control, it will be very shaky at the start. The safety of it should all be done by limiting the power output of the final stage. This will not tune itself to the motor, it won't have any feedback control at all really. If you wanted to just repeate a series of pwm signals at higher and higher frequencies you could do this with something as simple as a clock, up counter and PROM. Use only 6 data lines from the PROM to store the different cycles of the output stage. Have the clock cycle the counter up until it resets, use the counter to to drive the PROM's address inputs. To vary the speed simply accelerate the clocks frequency. It is a junky method as I admit but if you just want to see how hard it is to make the motor turn try to figure out what the PROM should have burned into it. Now try to tune that to a specific motor for ideal efficiency.

This is just a though but why is everyone thinking programming means using a micro controller/processor or DSP? I have been thinking personally about using an FPGA lately. Let the logic keep it self in time.

Technologic - You keep bragging about reading a lot of books and pages of documentation. Don't get me wrong being well read is something to be proud of but you might want to try to start actually calculating the details. I was wrong earlier you could make it scale though I think getting the timing right will be very hard. The more programmed approach would however be more simplistic and easier for others to develop on if we are really looking for this to start an open source project. I have learned threw bitter experience how much companies like over using programed solutions to stuff simple hardware would just as easily solve. However, I don't think this is the case here. Besides if you expect the open source community to expand your project you need to keep the design flexible for users to expand. I think the debate we are having here is over how much flexibility is really needed. Whenever an employer suggests something be done in code I have a mental cynical check I do. I think most hardware people have a healthy distrust of doing to much in code. I don't think it will take me more than 1K of code to generate the PWM.

I agree by the by that the safety stuff could be added to both ends though you really only need to test everything once. I doubt the delay will be significant if you do it right. That is the delays you add are even threw out all conditions this will be the easy part. 

JonasMeyer - Look doing initial development on a PC is cool. I have used labview in the past for this kind of thing. We are talking about audio frequencies after all so as I already said a parallel port would be fine. That said the final system shouldn't look like that. I can't and won't stop you of course. If you get it to work I will congratulate you but won't it bother you to know you could do so soooo much better.

Qer - I have done some fairly complex stuff that runs on micros with less than a few hundred bytes of ram. The trick is being careful about how you structure the code/hardware and doing it all in assembly language. I know some medical people who have really pushed the limits of real time data acquisition, lets just say you are right about the timing though at this scale linux could do it. 

Anaerin - Sorry I made such a thing about my perception of your tone. Don't worry about having an advanced degree in EE. Most of the better EE's I know are good not because of the degree they got but because of the though then invested in their work. I don't have a PhD. nor am I likely to get one, though I have to decide soon. I worked on things from network administration, to the economics of submarine cable faults and last but not least medical equipment design for research. I remember what it was like as an admin and am still cursed with those late night phone calls from last minute users, only now they are just friends and family.

TiVo doesn't really relate any more. The IDE and PCI are the same but the other buses are weird from what I here. I actually have an 8 bit system that is nothing like a PC (CPLD does the real calculations) and uses IDE but when you add the PCI bus yea it really looks like a PC.

Don't get me wrong I was just bringing up the single large module to be contrary. Sorry. That one module is not the only single large module on the market. This is actually kind of common. The fact is that using say 3 IGBT modules would be better from a heat perspective. Spreading out the heat from 1 intense point to 3 less intense points makes you heat exchange easier if you go with air cooling (my personal preference). I know you like liquid cooling but I don't like trying to be a plumber and an electrician and a programmer all at once. The weight of the larger heatsink and fan(s) I am just guessing will be lighter than the 1 large heatsink with fan, pump and fluid. Ether way I am avoiding it just to stay simple at first. Besides redistributing the IGBT's (farther a part) is a more effective way to redistribute heat than using water cooling.

I know the safety is more important that the reliability of the power electronics but I don't want to be on the highway one day and suddenly find myself costing down. The thing about trying to match IGBT's is that as I was avoiding explaining earlier bipolar based stuff has a funny problem in parallel. An IGBT is basically like a bipolar transistor with a FET sitting on top of it. The issue with bipolar stuff is this. When it gets hotter it starts switching more efficiently. This causes the better of any parallel combination to get more of the current threw it. This cause them to heat up more and more and more. Until eventually they experience "thermal run away." At that point they don't turn off, over heat and burn up. FETs the effect of heat is the reverse the hotter unit gets less efficient and as a result they tend to self balance their loads more evenly. There are ways to parallel IGBT by building hardware to shift the work load around dynamically but that is actually more complexity than the motor controller's PWM stuff. It also would require so much over rating that I don't see it working in saving money ether.

Yes of course I know about PWM generation of a sinewave. My point though was that those chips PWM functions are for the most part not suited for it. Read Qers post up there -^.

I know it is really easy to do surface mount soldering in a hacked toaster oven besides threw hole costs more to do as a PCB in any quantity. Alberta is expensive and yes fine pitch SMT parts are hard to do but there are a lot of places cheaper than Alberta, I just picked a name, and those places are if we were to do even the smallest group buy of say 3 or 4 boards cheaper than doing it our selves. Not to mention they do nicer work than anything I was ever able to do at home and they re-capture the spent copper. The spent copper recapture is almost completely industry wide now because the copper market is so high (the planet is really running out of it) and it makes a ton of economic sense.

I strongly suspect you are underestimating the amount of detailed analog electronics that Technologic will need. The high voltage stuff isn't really the problem. Sure making it run at the right temp, and with minimal EMI generation takes a little though but you could just buy that 1 large module if you can't hack it. The hard part is the low power side. I think we spend so much time talking about the high voltage end because the most of us feel when know something about it. The lower voltage end is not as well understood. Yes I don't think BLDC makes much sense ether but let them have their fun. I am wrong all the time.


----------



## Qer (May 7, 2008)

Technologic said:


> Certainly far more "sane" than shoving 1000s of lines of code into custom microcontrollers...


You know, in a world where every TV, dish washer, microwave oven, garage door opener and so on contains a micro controller or a DSP it's refreshing with the occasional Luddite.

What is it that makes you think using hardware rather than software is more sane?


----------



## Qer (May 7, 2008)

Evan said:


> Qer - I have done some fairly complex stuff that runs on micros with less than a few hundred bytes of ram. The trick is being careful about how you structure the code/hardware and doing it all in assembly language.


Yep, to just run a PWM or other autonome tasks usually don't take much place IF, as you said, you're careful and also have a very good knowledge about what you're doing. I love what you said in the beginning of your text:



Evan said:


> I would rather something be made by a person who was working in a medium they fully understand than working with something they don't understand on a problem they have fully researched.


So very true. Too often have I met people that expect that linux kernel programming or micro controller programming can't be much different than general programming, but there's a few gotchas that you are likely to run into if you. For example, program in C on an AVR and rely on your knowledge of C in, for example, Windows, the language looks the same but the change from Von Neumann architecture to a modified Harward architecture can play tricks on you. That's a very big foot to aim your shotgun at. 

And even if I used to program AVR's in assembler I've now moved over to C++. I can almost hear a few gasps and the shocked silence now, but it actually makes sense! On an AVR the only thing you get from the two plusses are classes and classes are a very good way to "hide" the gory intestines in a clean API which makes it possible to thoroughly test a module and then, when it's well tested and verified, more or less forget about it. If the object is well constructed with rigorous robustness in mind you can do rather big changes to the rest of the program without risking that your object starts to act up.

It's true that assembler has the potential to give you maximum performance, but the performance loss from using C or C++ is actually rather small (I've read the resulting assembler, it's rather impressive what the avr-g++-compiler generates) and I'll gladly trade those few percent performance for a more reliable and readable code.

I must be getting old...


----------



## Technologic (Jul 20, 2008)

Qer said:


> You know, in a world where every TV, dish washer, microwave oven, garage door opener and so on contains a micro controller or a DSP it's refreshing with the occasional Luddite.
> 
> What is it that makes you think using hardware rather than software is more sane?


It's somewhat more sane from a DIY perspective... and I possess no knowledge of programming outside of java (which was... a horrible experience for me )


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> It's somewhat more sane from a DIY perspective... and I possess no knowledge of programming outside of java (which was... a horrible experience for me )



To a hardware guy, everything looks like a hardware problem. And to a software guy (me) everything looks like a software problem. The main issue an open source controller is going to run into is the enormous variety of situations these schematics and components are going to be used in. Flexibility is key, if we can do it without compromising safety (at all) and performance (too much).

Put it this way. Our target market is cars. So the average KW to the wheel of this thing is going to be like 20KW, with occasional bursts to 200KW or more. Our controller (if it is good) is going to be over 95% efficient, which means we will be wasting 1KW nominally, and 10+KW occasionally. Even if we can hit 97.5%, we are still talking over 500W of waste. Now let's choose between a 1W microcontroller that ties us to a specific part and a specific set of code for all time (and pray they don't stop making it, or that the project doesn't grow out of it), and a generic 50W embedded PC that can be scrounged and use the same code forever. Yes it is wasteful. Yes it is overkill. Overkill is good. Overkill is another name for overengineered. And the waste in context is 0.25% for the small version (and more like 0.025% when under heavy load). I say it is worth it.

Now Qer's earlier comments about latency are the real issue. We are not going to get our processor to respond in microseconds if it is running any OS. But we can get it to respond in the low milliseconds easily if we run out of a ramdisk to avoid costly i/o flushes. Also, doing a custom linux distro that has a minimum of cruft will ensure that there are few context switches on the processor. And in exchange for doing this we open the project up from the thousands of people who can program for microcontrollers to the millions who can do C++ (or whatever language). Do not underestimate the appeal of customization.

EM interference is the other issue with the control circuitry. Many microprocessors are EM hardened somewhat, vs the RAM and processors on pcs that are not, but stray interference WILL flip bits in either situation. A software solution can mitigate this somewhat by doing calculations twice or three times to be sure (because of the spare processing power). Those who can afford it (and we can put this in the spec) can use ECC RAM, which is an off the shelf part designed to prevent this problem.


----------



## Anaerin (Feb 4, 2009)

JonasMeyer said:


> EM interference is the other issue with the control circuitry. Many microprocessors are EM hardened somewhat, vs the RAM and processors on pcs that are not, but stray interference WILL flip bits in either situation. A software solution can mitigate this somewhat by doing calculations twice or three times to be sure (because of the spare processing power). Those who can afford it (and we can put this in the spec) can use ECC RAM, which is an off the shelf part designed to prevent this problem.


Got EM issues? Put it in a grounded metal box. The box then acts as a faraday cage, and isolates the circuitry inside from any and/or all outside EM.

As for the Microcontroller (µC from here on out) vs. PC argument, I think the best solution would be pretty much the way Evan suggested. You have a small µC or ASIC or whatever to generate the PWMs required, reading info from the potbox and other sensors. Then you have a small PC (Gumstix, for example, 0.06A power requirements, 3.5-5v operating range) to act as a watchdog for the µC, and to act as the user interface, providing the necessary http/rs232/telnet/vnc/x11/whatever-the-heck-else functionality you need. 

This means the µC doesn't have to worry about carrying around a big web server while it tries to calculate the required 3-phase sine curves needed, instead talking to the PC over i²c, or something simple and easy to implement on a µC. Then the PC can handle additional safety checks, interlocks, and the user interface system, without having to worry overmuch about the need for microsecond-accurate timing. It also means that, should the user want, further functionality can be introduced easily, like driving an LCD display for (graphical) speed/distance/range calculations and the like, or running an external genset to power the vehicle when the battery levels get low.


----------



## Evan (Feb 20, 2008)

Qer - My dishwasher still uses a mechanical timer. My parents got it in 1985 I think. That was back when Maytag built solid stuff. The remark I made about knowing the medium was a take on a remark a law teacher I had once made. He said there is a saying in his profession "It is better to have a lawer who knows the case than one who knows the law." I feel that a generalized version of that statement could be applicable to almost if not everything. 

I don't think that anyone here, even me, would use ASM for this. ASM is used once you know what you are actually doing and I want to experiment a lot. I can't speak for you all but I don't yet. 

SDCC is a veraint of GCC it is very experimental. GCC does work for 1 of the 8 bit uP (6800) and nothing else. You could in principal use normal GCC for programming a 32 bit uP like a 68000. 

I remember one day trying to explain to a friend who was trying to program a uP that he couldn't use printf(); until he had written the stdio library for it.

JonasMeyer - I think that it is the ballance of performace to cost we are getting at. If you want the lowest cost you go with what Etcher is doing. The costs of using commodity FVD hardware are almost cirtinly going to be lower than what ever we design. No offense but you go your way with the processor choice and I will go mine as will Technologic. I think later on we will all make different power stage designs. For now I am playing with a small 3 Phase AC motor trying to perfect running it. I have chosen to build my power stage with MOSFETs because unlike the motor I have a very good understanding of how they limit my efficency. I just want to get the motor side of the math down pat. Right now all I have done is spend a lot of time doing math. Even a fractional HP motor is a lot of juice to be using in a "burn and learn" situation. For those who might not know embeded programming slang burn and learn refers to burning the code (firmware) to a chip and testing and then rewriting and repeating the process each chunk of code at a time. Though the burn part could be taken litterally too I guess. 

Honestly I agree we should all be working on stuff we can all understand but I don't want to assume the role of dictator of you all and I will stage a none violent rebellion in the empire of any dictator who arives. If a group forms around some common stratagy that would be great but you know they would all have to meet in person to work/test the thing or have built identical copies of the hardware. Perhaps we should all build a common 3 - Phase scale model of the situation?

No offense but from the comment you made on EM and using ECC RAM it is very clear that you don't understand what ECC actually works on. It can handle a few blone bits here or there with a series of parity checks built into the chipset. Basically there is a parity generated for every few bits and these parity bits are stored and then when the memory is acessed they are read and checked. They can to a point let the computer recover from the odd missed bit but that won't save you from EMI. Yes, it is a good thing to do in this case but it just creates partial not total redundency. If EMI of this power took out your ram it would eat it all not part. This I have seen in action. 

Once more there are sheilded chips yes I know. I have even seen the chips sheilded for nuclear/solar radiation. The voyager 1 & 2 space craft used a SOS (Silicon On Saphire) chip. That actually blocks darn near everything. However, that cost a fortune then and was only a 6052 variant. They still do sheilded chips though not with SOS. SOS was called by the engineers Silicon on Sh** because it was very hard to build the wafer, the adheason of silicon substrates ot saphire is bad and it tends to cleave apart. The bottom line is that the inside of the chip is resistant to EM but that only covers you up to the chip, you can get noise ridding on the power to the chip, it is hard as I have already described in this post to avoid. Once more the last really resiliate chips I have seen were PowerPC 603e and 80486. I will grant you that was for the radiation of space which is defferent but they illistrate the story. They are old chips and expensive. If you want to use a normal embedded PC or similar just do what we are doing, use shielding and filter/suppress out noise.

If you are going to go the embedded PC route, I would suggest humbally that you use a RTOS (real time OS). I know there are quasi-real time linux distros but it isn't the same. I think Anaerin made a very good suggestion with the gumstick thing if you are dead set to go that route.

Anaerin - First off good call on the gumstick thing. I dislike the way they are used but it is the right time and place for it. Seriously good call.

Just because you have put a barrier up (Faraday Cage) does not mean there will not be EM issues. First off at this kind of power with these kinds frequencies I would not be surprised to have some unintended coupling between connections. Really you have to sub divide the inside of the box minimally in two. One side for low voltage one side for the power stage. Once more there is more to EM than just the large sinewaves in this case. Remember you are using PWM so there are smaller frequencies and harmnoics that left unblocked will propogate unplesantly. 

Crack open even the simplest cell phone and you will find that even though there should be only 1 or 2 metal cages there are typically more like 4 or 5 and a lot of choke coils. This is true of phones that should just have 1 transever because they need to block things like parasidic noise from switching regulators, noise from high speed digital and because the microwaves from the phone tend to find ways to leak out. This own't be an issue here because we are dealing with a totaly different scale and frequency range but you might find that filtering say the harmonics from the PWM will cause you to have to sheild the power section seperately, not couple the chassis to the ground, and use large ferrite choke coiles between the power regulator for low voltage, the low voltage inputs and I would add optical isolators between the low voltage area and the high voltage area. Now try to do your design. This is why everyone puts the electronics for AC motors so close to the motor, some industrial systems even mount it right on the motor.

Most of the DIY DC motor controlers I have seen never go threw FCC part 15 testing and in truth why should they. Unless you do something horrably wrong no one need ever worry about it. However, almost all of them that I have talked to have trouble with the car radio. Even if you use a seperate battery instead of DC to DC to power everything. I plan on building two DC to DC converters into the car in a seperate 3rd sheilded area of the box. The first one is to power the car's electronics, lights, radio, etc. The second one is to power the low voltage part of the inverter. This is the first sheilded zone. The second shielded zone is the low voltage electronics. The third zone is the power electronics for the inverter. I am doing two DC to DC converters so that if the cars power shorts out because of say someone screwing up the cigarret lighter adapter with a quater or what ever the car will still continue to run. Yes I know I could just do switches but an extra DC to DC is not that expensive and incase you have not noticed my shirt reads "I hart worst worst design theory." Ok that is a joke but it is very true.

Your comment about carrying around a web server is wrong here. All services in linux are optional. This includes things like keyboard, monitor, and mouse interrupt calls. You can compile the kernel with out any normal PC related stuff if you want and just burn it to a system ROM, over the BIOS. It is tricky if you are new to the concept but doable.


----------



## Anaerin (Feb 4, 2009)

Evan said:


> Anaerin - First off good call on the gumstick thing. I dislike the way they are used but it is the right time and place for it. Seriously good call.


Thanks. I think they're a great idea, and I've seen all kinds of crazy uses for them (Including a full VoIP PBX would you believe).


Evan said:


> Just because you have put a barrier up (Faraday Cage) does not mean there will not be EM issues. First off at this kind of power with these kinds frequencies I would not be surprised to have some unintended coupling between connections. Really you have to sub divide the inside of the box minimally in two. One side for low voltage one side for the power stage. Once more there is more to EM than just the large sinewaves in this case. Remember you are using PWM so there are smaller frequencies and harmnoics that left unblocked will propogate unplesantly.


To be honest, I was thinking of this as 2 boxes, one high voltage, one low voltage, each separate, grounded, sealed, and RF choked wherever possible. While this wouldn't kill the EMI beast entirely, it would drop it down into the "almost never" category.


Evan said:


> Crack open even the simplest cell phone and you will find that even though there should be only 1 or 2 metal cages there are typically more like 4 or 5 and a lot of choke coils. This is true of phones that should just have 1 transever because they need to block things like parasidic noise from switching regulators, noise from high speed digital and because the microwaves from the phone tend to find ways to leak out. This own't be an issue here because we are dealing with a totaly different scale and frequency range but you might find that filtering say the harmonics from the PWM will cause you to have to sheild the power section seperately, not couple the chassis to the ground, and use large ferrite choke coiles between the power regulator for low voltage, the low voltage inputs and I would add optical isolators between the low voltage area and the high voltage area. Now try to do your design. This is why everyone puts the electronics for AC motors so close to the motor, some industrial systems even mount it right on the motor.


Quite so. Sorry if I wasn't clearer about my thoughts on this earlier.


Evan said:


> Most of the DIY DC motor controlers I have seen never go threw FCC part 15 testing and in truth why should they. Unless you do something horrably wrong no one need ever worry about it. However, almost all of them that I have talked to have trouble with the car radio. Even if you use a seperate battery instead of DC to DC to power everything. I plan on building two DC to DC converters into the car in a seperate 3rd sheilded area of the box. The first one is to power the car's electronics, lights, radio, etc. The second one is to power the low voltage part of the inverter. This is the first sheilded zone. The second shielded zone is the low voltage electronics. The third zone is the power electronics for the inverter. I am doing two DC to DC converters so that if the cars power shorts out because of say someone screwing up the cigarret lighter adapter with a quater or what ever the car will still continue to run. Yes I know I could just do switches but an extra DC to DC is not that expensive and incase you have not noticed my shirt reads "I hart worst worst design theory." Ok that is a joke but it is very true.


If you build it as bulletproof and bombproof as you can, you're off to a good start, IMHO.


Evan said:


> Your comment about carrying around a web server is wrong here. All services in linux are optional. This includes things like keyboard, monitor, and mouse interrupt calls. You can compile the kernel with out any normal PC related stuff if you want and just burn it to a system ROM, over the BIOS. It is tricky if you are new to the concept but doable.


I know Linux is configurable like this. I was drawing my "Web server" comment as a reference to the design that Qer and Tesseract are making at the moment (http://www.diyelectriccar.com/forums/showthread.php/new-controller-prototype-29062p2.html), where part of the software for the microcontroller includes (alarmingly, IMO) a web server. My point was that in a system like the one I described, this could be taken off the realtime-running microcontroller, and put on the PC instead. I, for one, would certainly be a lot happier knowing my main motor controller is doing nothing but controlling my motor, rather than worrying about getting HTTP posts/gets working nicely for the notoriously standards-incompliant IE.


----------



## Evan (Feb 20, 2008)

Anaerin - Don't get me wrong the gumstick is a cute tool but it should not really be a part of any long term thing. It is just what it pretends to be, a rapid prototyping tool. You use it and then design something more optimized for the task. I have a funny conflict on it 90% (number pulled from air) of what is done with it is not so hot. However, that is schools fault. School created a population that outside of the PC doesn't teach enought. For a few different reasons I was in a normal school, then home schooled, then back to public school, now a private universities night program. I might go to a day school next if student loans look better than my job prospects. If you look at the stuff I have written it is really just the sum of a long series of odd personal experiances. The problem with the educational system we have is that it has not learned how to teach a coheasive ciriculum out of what we learn best from a personal journy threw something. 

Sorry about nixing your web server comment I was wrong. Don't get me wrong Tesseract can speek about a lot of this with more authority than I can but what the heck!! Ethernet!!! Is it really a web server or is it just a telnet session? Telnet is not unreasonable I guess. You could put the telnet and IP stuff in the user interface uP and have it upload things like settings and FW updates to the PWM uP. I guess that makes sense. Ethernet uses a differential pair of sorts to send data so I guess that works better than RS-232 with out sheilded cable. Then again ethernet with a sheilded cable would kick butt. He probably knows something I don't I guess.

How do we get rid of JHMiller01!!!!


----------



## Qer (May 7, 2008)

Evan said:


> GCC does work for 1 of the 8 bit uP (6800) and nothing else. You could in principal use normal GCC for programming a 32 bit uP like a 68000.


Um. Gcc exists for avr at least. Or rather, of the microcontrollers that seem populair today it exist for avr, period.



Evan said:


> Telnet is not unreasonable I guess.


I think you should avoid anything TCP/IP-based. Reason once more; latency. TCP/IP has a lot of interesting "features" to be able to guarantee that the data arrives safe, for example automatically decreasing transfer speed. That could completely ruin your latency.

My guess is that you really don't want that...


----------



## Qer (May 7, 2008)

Anaerin said:


> ´I was drawing my "Web server" comment as a reference to the design that Qer and Tesseract are making at the moment (http://www.diyelectriccar.com/forums/showthread.php/new-controller-prototype-29062p2.html), where part of the software for the microcontroller includes (alarmingly, IMO) a web server.


Why are you trying to spread FUD? We're not talking about an Apache or IIS here, and we're definitely not talking a general usually good enough schedule priority like in Linux or Windows, we're talking a hard coded real time environment with four priority levels where a higher priority *ALWAYS* win over a lower priority.

The longest the webserver can lock the CPU is less than 10 us, the most critical situation that can ever happen demands that the micro controller reacts within 25 us (because the hardware designed by Tesseract does the nanosecond stuff itself) so those 10 us are well on the safe side to avoid that the web server can ever cause any problems. And this is a worst case scenario (more or less demanding that you're doing a web access at the same time as someone throws a crow bar across the motor terminals), usually the margins will be more than 10 times better.

The web server runs on the CPU time leftovers, ie where the alternative would be that the micro controller would otherwise idle anyway. The web server IS, in fact, the idle loop and besides, I've already tested it and the micro controller doesn't have any problems with me "surfing" it while it runs everything else at the same time, such as PWM, ADC etc.

Do you still think it's alarming?

PS. http://en.wikipedia.org/wiki/Fear,_uncertainty_and_doubt


----------



## Tesseract (Sep 27, 2008)

Anaerin said:


> Got EM issues? Put it in a grounded metal box. The box then acts as a faraday cage, and isolates the circuitry inside from any and/or all outside EM.


Sort of... not really, in practice. Got any holes in the box for wires to pass through? They become "slot antennas". How do you decide what gets shielded and what doesn't? In truth, the only good solution to EMI is to not let occur in the first place, and there is one very simple rule to follow (the devil, of course, is in the details of implementing it): keep outgoing currents as close as possible to their returns.




Anaerin said:


> This means the µC doesn't have to worry about carrying around a big web server while it tries to calculate the required 3-phase sine curves needed, instead talking to the PC over i²c, or something simple and easy to implement on a µC. ....


FYI, no general purpose uC on the planet has enough raw computational power to control a motor in anything more sophisticated than "V/Hz" mode*, which btw is what banging sine waves at a 3 phase motor will get you. This control scheme uses a variable frequency PWM to make the stator voltage and frequency proportional, in the hopes that the rotor current will follow. The mark to space ratio of the PWM is varied so as to induce sinusoidal currents in the rotor (ie - produce smooth torque) while the frequency is varied to control the speed. Unfortunately, this control mode is only appropriate for fans, pumps and similar loads that need very little torque at low speeds - clearly, an EV does not meet this criteria - because the actual vector sum of the stator currents is not precisely locked to the corresponding induced currents in the rotor (this is an ac induction motor I am referring to; there are two different BLDC "flavors" that behave somewhat similarly, but differently enough that the hardware is not interchangeable). 

An easy way to visualize this is to use one magnet to repel another magnet down a track. The closer you try to force the magnets together the more strongly they repel each other. Well, in V/Hz, the stator "magnet" has no idea where the rotor "magnet" is at - it just blindly generates sine waves and the rotor eventually settles in to where it's magnets are position in the middle between the stator's.

In flux vector mode, however, the rotor position is known (either via an encoder or by sensing the back EMF in the "idle" stator winding). This makes it possible to produce much more torque at low rpms because it forces the two magnets closer together and keeps them a fixed distance apart, essentially. The kicker is that the computational cost is staggering. As the name implies, the magnetic flux (a product of current and permeability) in the rotor (ie - torque) is directly controlled via precisely calculating the current needed in each phase at each fraction of a degree of rotor rotation (the vector part). This is why there are specialized DSPs for ac motor control. 

(keeping in mind this explanation is necessarily simplified for clarity).

* - if the uC uses a lookup table of sine wave values, then it is controlling the motor in V/Hz mode. If it has an on-board DSP, it probably can do fl;ux vector mode, but then it is special purpose device.


----------



## Madmac (Mar 14, 2008)

> FYI, no general purpose uC on the planet has enough raw computational power to control a motor in anything more sophisticated than "V/Hz" mode*, which btw is what banging sine waves at a 3 phase motor will get you.



$8 microcontroller

http://www.luminarymicro.com/products/rdk_acim.html


----------



## Tesseract (Sep 27, 2008)

Madmac said:


> $8 microcontroller
> 
> http://www.luminarymicro.com/products/rdk_acim.html



Good find. Did you see the asterisk in my post, though? That's a special-purpose product made for controlling motors. I didn't say they didn't exist, I said that general purpose uC don't have the capability of controlling an induction motor in flux vector mode.

Next time read a post through before you decide to be an ass.


----------



## Madmac (Mar 14, 2008)

> Quote:
> Originally Posted by *Madmac*
> _$8 microcontroller
> 
> ...


 __________________


The Luminary parts are general purpose 32 bit micro controllers based on low end ARM architecture. They have an array of standard I/O including programmable timer counters that can generate a vast array of wave forms including phased PWM. They can also decode quadrature encoders.

If you consider these are specialised motor control items then I would agree with you. They are included in just about all 32 bit micro controllers these days (and many 8 and 16 bit devices).

Your comments may have been correct 3 or 4 years ago. As feature size goes down more gets included on a micro controller and speed goes up. I would suspect that the micro controller that Quer is using is an ARM based unit. ( power rail voltage goes down and interference intolerance goes up)

One thing that interests me on your controller project is manufacturing insurance for public liability. Here in Europe it is a designers responsibility to design a product that is safe. He is personally liable, not just the company he works for.... most companies insurance will cover his defence should he be taken to court. To gain the best priced insurance a risk assessment is presented so that the detailed risk can be assessed by the insurance company.

It would be interesting to present a risk assessment where the failure mode could result in deaths ( killing multiple kids on a crossing when the power device fails short for example). From your indicated selling price you will clear around $1500 dollars per unit, sales are likely to be between 50 and a 100 a year.

Seems to be a small amount of money to risk personal liability that could wipe out your life work. Unless of course you are planning a sell and run operation and avoid any legal responsibility.

Interesting that Curtis do not make a point of promoting their DC units for street vehicles. From third hand gossip, so may not be true, I have been told by an EV company in the UK that Zilla has not been able to find a company to take on manufacture because of this liability issue.


----------



## Tesseract (Sep 27, 2008)

Madmac said:


> The Luminary parts are general purpose 32 bit micro controllers based on low end ARM architecture. They have an array of standard I/O including programmable timer counters that can generate a vast array of wave forms including phased PWM. They can also decode quadrature encoders.
> 
> If you consider these are specialised motor control items then I would agree with you. They are included in just about all 32 bit micro controllers these days (and many 8 and 16 bit devices).


You know, we seem to be splitting semantic hairs here - something which is not very productive for the discussion at hand, but is quite a popular pastime on the internet.

Can you take an 8 bit AVR or PIC uC and do flux vector control of an ac motor with it? No. It simply does not have the capability. I mean, some of those uCs can't even do a division operation natively so how in the world can they do vector algebra?

Are there uCs that *can* do the required computations? Once again, yes. But they are marketed as special purpose devices. That's all I was arguing. Nothing more. Your response that consisted only of a link and a snarky comment that it only costs $8 was not only inappropriate, it was rude.

That said, it was a good find, and seems to be eminently suitable for what the folks in this thread are discussing. However....



Madmac said:


> One thing that interests me on your controller project is manufacturing insurance for public liability....


This is not relevant to the discussion at hand. Repost in the appropriate thread... or not. Suffice it to say that a real, incorporated company will be producing the controller Qer and I are developing (along with some other unsung persons doing the mechanical work). That is, it won't just be me building these things on my workbench at home.


----------



## Madmac (Mar 14, 2008)

> * - if the uC uses a lookup table of sine wave values, then it is controlling the motor in V/Hz mode. If it has an on-board DSP, it probably can do fl;ux vector mode, but then it is special purpose device.


To repost your asterix quote. If I read that correctly you are saying that at least an on board DSP is needed to do flux vector computations. 

You are now saying that any micro controller can do it but it becomes a special device !!!

My link was to show that any number of 32 bit micro controllers can easily handle this work load.

to quote from Luminaries web site



> The Stellaris Family of ARM® Cortex™-M3 microcontrollers features IP especially designed for meticulous motion control and typically found only on costly specialty devices, including up to eight full channels of control with dead-band generators providing shoot-through protection for applications such as 3-phase inverter bridges, fault-condition handling in hardware quickly providing low-latency shutdown, synchronization of timers enabling precise alignment of all edges, and hardware quadrature encoders enabling precise positioning sensing. Together with larger on-chip memories, enhanced power management, and expanded I/O and control capabilities, these Stellaris family members are optimized for industrial applications requiring reliable connectivity, including Motor and Motion Control, Remote Monitoring, Factory Automation, HVAC and Building Control, Gaming Equipment, Medical Instrumentation, Consumer Appliances, CCTV Monitoring, and Fire and Security.


Their motion control is a marketing term to cover the hardware peripherals for PWM and encoder interface. These are standard features in most 32 bit micro controller families and have nothing to do with the Flux vector computation.

I would suggest that before you post comments along the lines of



> Next time read a post through before you decide to be an ass.


You read the data sheets and understand how you code Flux vector firmware.


I will repost the insurance query in your controller thread.


----------



## Tesseract (Sep 27, 2008)

Madmac said:


> To repost your asterix quote. If I read that correctly you are saying that at least an on board DSP is needed to do flux vector computations.


Still splitting semantic hairs, just not very accurately at this point I see. Please read carefully. I said that *if a uC has a DSP built in then it probably can do flux vector control of an ac motor*. 




Madmac said:


> You are now saying that any micro controller can do it but it becomes a special device !!!


No, I said any uC with a DSP in it is a special purpose device. Seriously, are you not a native English speaker? Not trying to be rude at this particular moment (in contrast to other moments, that is), it's just that you've really screwed up interpreting what I wrote.




Madmac said:


> to quote from Luminaries web site
> 
> Their motion control is a marketing term to cover the hardware peripherals for PWM and encoder interface. These are standard features in most 32 bit micro controller families and have nothing to do with the Flux vector computation.


Indeed, all motor controllers require PWM; some, not all, require an encoder interface, and these are, indeed, standard features in most uC families and they do, indeed, have nothing to do with flux vector computation. No argument with any of that.

But you missed the part in their literature where it says the, "LM3S818 contains a peripheral set that is optimized for three-phase motor control...".

Indeed, had you gone to the trouble of actually looking at the uC used, you'll find that it does have some advanced math capabilities compared to its rather more mundane peers:

http://www.luminarymicro.com/products/lm3s818_microcontroller.html#Datasheet


So I will once again advice you that if you intend to write a jerky post, make sure you've read (and in your case, in particular, understood) the whole of the original post.


----------



## Madmac (Mar 14, 2008)

As someone always wanting to learn perhaps you could point out the advanced maths instructions that I must have missed over the last two years programming CortexM3 ARM devices.

Multiply and divide (no remainder so not even a full divide) on all Cortex devices I know about is hardware assisted. The bit instructions are expanded. Beyond that they are all standard Thumb instructions. Hopefully you will point out multiply accumulate instructions that would be ideal for digital filters or special array pointers that both I and my compiler tools have missed.



> But you missed the part in their literature where it says the, "LM3S818 contains a peripheral set that is optimized for three-phase motor control...".


Seem to be going round in circles here. That refers to peripherals not the ability to execute code. Most 32 bit devices cover all that is needed if not reduces the chip count by one and makes no difference to code execution. Maybe you would like to change the goal post again and say it has to be a single chip solution. 

You should stick with analogue design and get Qer to deal with microcontroller details. Get used to the fact in the digital world a decrease in device geometry means more active devices on a chip and more functionality at a rapid pace.


----------



## Anaerin (Feb 4, 2009)

Qer said:


> Why are you trying to spread FUD? We're not talking about an Apache or IIS here, and we're definitely not talking a general usually good enough schedule priority like in Linux or Windows, we're talking a hard coded real time environment with four priority levels where a higher priority *ALWAYS* win over a lower priority.


I'm not trying to spread FUD. I'm just expressing my personal concern that having non-essential tasks happening on the primary control system can lead to distractions, and added complexity where none should be. For instance, would you be happy if the autopilot on the airplane you're flying on also provided the entertainment system?


Qer said:


> The longest the webserver can lock the CPU is less than 10 us, the most critical situation that can ever happen demands that the micro controller reacts within 25 us (because the hardware designed by Tesseract does the nanosecond stuff itself) so those 10 us are well on the safe side to avoid that the web server can ever cause any problems. And this is a worst case scenario (more or less demanding that you're doing a web access at the same time as someone throws a crow bar across the motor terminals), usually the margins will be more than 10 times better.


So you have a full prioritised task scheduling system, with forced task abandonment, all on a microcontroller? That is an impressive feat. I know for a fact that even with a 68k-series processor, and a large development team, the best Commodore could come up with for the Amiga was a preemptive round-robin scheme, which could still hang the whole machine if/when it hit an unintended loop.


Qer said:


> The web server runs on the CPU time leftovers, ie where the alternative would be that the micro controller would otherwise idle anyway. The web server IS, in fact, the idle loop and besides, I've already tested it and the micro controller doesn't have any problems with me "surfing" it while it runs everything else at the same time, such as PWM, ADC etc.


That's an interesting approach, and certainly one I'd not thought of. I do hope, however, that you have some kind of watchdog system in effect, to forcibly boot the web server out of control when timing control is necessary.


Qer said:


> Do you still think it's alarming?


I do, though not as alarming as it appeared at first blush. I would still rather extra functionality like this was moved to a second processing unit, but provided there is no way at all any unintended loops or hangs in the web server can affect the control of the motor, I'm okay with it.


----------



## Tesseract (Sep 27, 2008)

Anaerin said:


> ...
> That's an interesting approach, and certainly one I'd not thought of. I do hope, however, that you have some kind of watchdog system in effect, to forcibly boot the web server out of control when timing control is necessary....


This should be moved over to the "new controller prototype" thread as well. 

But, in brief, no one sane that builds hardware 100% trusts software. There are multiple lines of defense in effect here but the weapon of last resort is desat detection of the IGBT. Assuming a worst case situation where the uC hangs with the motoring IGBT enabled and driven high the current through the motor will eventually exceed the desaturation threshold and gate drive will be terminated until power is cycled.

Also, FWIW, ethernet and the TCP/IP stack is implemented in a separate chip, taking quite a bit of workload off of the uC (but this is more Qer's province).


----------



## Qer (May 7, 2008)

Tesseract said:


> This should be moved over to the "new controller prototype" thread as well.


Oki. See my reply there (soon).


----------



## Evan (Feb 20, 2008)

Qer - Ok. I have never actually used full blown GCC for anything on the scale of an AVR. I was always told by a few parties that the way it optomized code was not as well suited for small stuff as SDCC. SDCC has some nice libraries though for this kind of work, do you know of similar ones for GCC on AVR or other small uP.

As for TCP/IP I wouldn't use it but if I did there would be a seperate user interface chip that just ran it and handeled things like the dashboard controles. Timing there is not as critical and the TCP/IP would only be used for diagnostics that would be done with the motor OFF hence no concern on timing. Yes I know you could code one for the idle loop but think about the memory you would have to add on top of what is already there. What is wrong with a kermit style session over RS-232? Heck why are we talking about all this when CAN bus was invented specifically for this purpose. Wouldn't it be the best tool for the job.


----------



## Evan (Feb 20, 2008)

Tesseract made a good point on the slot antennas. We should try to avoid generating EM issues but if this is an open source project I think we should consider that people will just tinker with it. Perhaps we should try to incorporate a 90 degree turn into the wiring between boxes. There will still be noise on the wires but it might limit the mess a little more. Maintaining smooth airflow for heat removal will be interesting though. The thing is when you design something in a company you are the only one who is going to tinker with it so you know exactly where the limits for things like noise are. This will not always be so for open source hardware projects. 

Technologic - Tesserect's comment made me realize something. How are you going to avoid generating excess harmonics. There are some PWM signals that your analog hardware might generate it's perfectly smooth duty cycle changes that might be noiser than others.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Technologic - Tesserect's comment made me realize something. How are you going to avoid generating excess harmonics. There are some PWM signals that your analog hardware might generate it's perfectly smooth duty cycle changes that might be noiser than others.


I think we have a different idea of harmonics... are you talking about audio noise from the signal intensity exciting the air (which it will do) or are you talking about placing identical phase/amplitude wires together (ie. running the multiple phases of outputs close to one another) which would generate "resonance"?

There's also the possibility you mean harmonic distortion, which isn't generally going to be an issue in the preamp stage itself (which is almost finished btw, but today was a bad day for me in general so won't finish it). Distortion from the opamps should be less than 0.1% from 20hz-20khz.

I basically stole the design directly out of a VFD oscillator used for music generation in a tone generator 

At any rate I was merely drawing up this circuit as an alternative to using a sound card since it would generate directly from the pot box resistance (ie. throttle).

I'm sure I'll be encountering a point soon when I'll be totally lost as to what to do next... namely I have no idea what the hell vector control is and why it's necessary... the papers I can find on controlling AC motors seem to suggest it's not amazingly dynamic (and that non-cap smoothed PWM can be used directly into each phase)... but there's almost no information about high amperage/voltage supplies.


----------



## Qer (May 7, 2008)

Evan said:


> Qer - Ok. I have never actually used full blown GCC for anything on the scale of an AVR. I was always told by a few parties that the way it optomized code was not as well suited for small stuff as SDCC. SDCC has some nice libraries though for this kind of work, do you know of similar ones for GCC on AVR or other small uP.


There's an avr-libc at http://www.nongnu.org/avr-libc/. It probably is included in winavr or some similar development environment, but I don't know what it takes or how to install it in Windows since I run Linux. In Fedora it's part of the distribution though, which is nice.

I have no experience of SDCC and can't tell how much better it is compared to GCC. GCC is good enough and since it's open source it means I can go in and fix the bugs, which has already saved the day once in our project. Hence I stick with it even if it's possible that there's a performance penalty...



Evan said:


> Yes I know you could code one for the idle loop but think about the memory you would have to add on top of what is already there.


Surprisingly low, actually. It uses about 100 bytes of RAM which isn't much. What's worse is that it's using pretty many kilobytes of Flash, but that's mainly because I have an 8 kbyte huge image as a test. That test image will be replaced by a logo later and since it's not a photo it shouldn't be even close to 8 kbyte.

On the other hand, the flash space is more or less free since it's much bigger than we need for the actual controller software. The controller we picked was decided upon because of other parameters than flash space, so the huge flash area is pretty much a bonus.



Evan said:


> What is wrong with a kermit style session over RS-232? Heck why are we talking about all this when CAN bus was invented specifically for this purpose. Wouldn't it be the best tool for the job.


Nothing wrong with CAN, except that very few computers/laptops come with CAN bus. That's actually one of the main reasons we went with Ethernet; RS-232 is getting less and less common on your general computer. Sure, there's USB to serial converters, but that's yet another thing to keep track of and that you won't find when you need it the most...


----------



## Evan (Feb 20, 2008)

I have a question for everyone. Since we are all going in different directions what plans do you all plan to use? Since I am asking here is mine.

0. Setup DAQ HW in Linux for model
1. Build a model
2. Get V/Hz working on model
3. Improve method for ballanced charging
4. Add Car like interface (dashboard) to model
5. Add Cruise Control
6. Improve SOC (State Of Charge) gauge on model
7. Flux Vector Mode using SVM (Space Vector Modulation)
8. Switch model from MOSFET to IGBT to check difference.
9. Go Full Scale
10. Design DC/DC converter(s)
11. Convert EV

Qer - Ok. I am not trying to promote SDCC. It is GPL'd since the source is adapted from GCC. Just though I should say it. 

Your embedded server is impressive. I think that is more than I could do currently in terms of programming an embedded uP. 

Technologic - Audio noise is not an issue. I was talking about the harmonics the PWM signal generates in the motor coils. Remember a sharp virtical edge like the ones the IGBT's will be amplifying contain an effectively infinate series of decreasing sinewaves of odd frequencies. There are ways to reduce the way these generate harmonics in the motor if you do it right. In the interest of honesty, while I have read this I still don't understand it. I understand the math & physics of where the harmonics come from but how they are avoided is over my head. So if anyone here does please explain how it could be made to work.


----------



## Qer (May 7, 2008)

Evan said:


> Qer - Ok. I am not trying to promote SDCC. It is GPL'd since the source is adapted from GCC. Just though I should say it.


Ah. I stand corrected then. Will check it out.



Evan said:


> Your embedded server is impressive.


Thank you.


----------



## JonasMeyer (Feb 28, 2009)

Evan said:


> I have a question for everyone. Since we are all going in different directions what plans do you all plan to use? Since I am asking here is mine.
> 
> 0. Setup DAQ HW in Linux for model
> 1. Build a model
> ...


To be honest, my intention in starting this thread was to get people thinking along these lines because I am not a hardware guy, and want a nice high powered AC controller I can buy or build from a well tested schematic (I can solder, at least). I'll help out any way I can, though. I've got to say, I'm happy so many people seem fired up about this topic. I guess it must have been on people's minds already. So my plan is:
1) Wait for someone to perfect design.
1a) Help out how I can along the way.
2) Buy finished product, or copy design and produce in garage.
2a) Pontificate a bunch about design goals along the way.

Evan, I think the best way to avoid the EM harmonics in the motor is high voltage low capacitance smoothing capacitors in parallel with the IGBTs or MOSFETs in the circuit. Take what I'm saying with a grain of salt here; it not being based upon any real world experience, but my reasoning is thus. As the voltage goes through the rising portion of the waveform, the capacitor will soak up some of the extra current, slowing the rise. As it falls, it will give off a little extra, slowing the fall. This will round the corners of the square waveform a bit, which will reduce some of the very high frequency nasty EM interference? Make sure the capacitance isn't too high, however, or it will smooth too much and make it difficult to do high frequency output.

Alternatively, perhaps you could pick an IGBT with a higher capacitance?


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> Take what I'm saying with a grain of salt here; it not being based upon any real world experience, but my reasoning is thus. As the voltage goes through the rising portion of the waveform, the capacitor will soak up some of the extra current, slowing the rise. As it falls, it will give off a little extra, slowing the fall. This will round the corners of the square waveform a bit, which will reduce some of the very high frequency nasty EM interference? Make sure the capacitance isn't too high, however, or it will smooth too much and make it difficult to do high frequency output.
> 
> Alternatively, perhaps you could pick an IGBT with a higher capacitance?


I'd take a higher capacitance cap for this task, otherwise you won't smooth it anywhere near enough (or soak up much of the dead harmonic areas)... likewise he's talking about noise generated outside of just the PWM signal if I'm not mistaken.

Since you can transmit multiple frequencies (often at higher and lower amplitudes), some generated from EMF, some generated from general resonances or audio noises, he's talking about these other signals and how to remove them.

A capacitor won't do that too effectively unless it's larger... though I'm not sure what you mean by large in the first place here. 
I mean if you stuck a 10,000uf cap in line with it seen here (obviously a higher voltage one):
http://www.weisd.com/store2/NTENEV10000M16HI-B.php

I'm not sure what damage it'd do to the PWM, and it would smooth (normalize) any stray clipping or signals that got into the line. However it wouldn't be enough to completely remove the harmonics (if any). 

*My solution:*
I'd suggest filtering the additional signals out with a simple active crossover network... if anyone's dealt with low pass and high pass filters they know what i mean.

This would be written in the software and should remove most if not all of the stray frequencies*

http://freecircuitdiagram.com/2008/...-split-the-audio-signal-before-amplification/

Here's a view of the schematic... you would take the low voltage signal through _THAT_ prior to the amplification of the PWM signal.

Obviously there are ways to do up to 96db/octave cheaply (in fact I've built/designed these before), but you'd need the crossover points to change... which is why the PWM signal generator would have to "send information" to that crossover if you were using it to shift the high and low passes to around whatever frequency you're generating.

This can probably be done in software? the opamps are fairly stupid afterall and will accept any change in voltage and turn it into a shift in points (ie. maybe another smaller processor is needed, but it shouldn't be obtrusive at all).

These are designed around a pot box being in line to shift the frequency points... so it seems like a fairly simple addition to whatever software...


----------



## Tesseract (Sep 27, 2008)

JonasMeyer, Technologic, et al. - you do not want to put a capacitor across the motor windings, IGBTs, etc., to clean up any harmonics. In fact, it's a bad idea. Here's why:

When a resistor is driven by a square wave voltage source, both the current waveform and the voltage waveform will look the same. When a motor is driven by the same source the voltage waveform will still be a square wave, but the current waveform will look triangular. By modulating the pulse width (i.e. - PWM) on a pulse-by-pulse basis, in a precise and mathematically calculable manner, you can make the current waveform approach a sine wave in shape - ideal for producing useful torque in an induction motor. Now, where distortion comes in is that only the fundamental sine wave produces pure, unidirectional torque - every harmonic produces some forward and some opposing torque. So, harmonic distortion in the current waveform may add to the production of torque, or subtract from it, but it always leads to increased heating of the windings, rotors, even the bearings and shaft, of a motor and so it is to be avoided. The best way to avoid harmonic heating, then, is to accurately generate the PWM for each phase. This is easy enough in principle but in practice it can be extremely difficult because the point in space where the torque vectors of each phase meet depends on how much the motor is loaded because the "field" in an induction motor is not fixed: it is a product of the currents induced in the rotor by the stator (hence the name, "induction motor").

A flux vector algorithm mathematically calculates the PWM signal needed for each phase based on stator current and rotor position. It's probably possible to do flux vector control with a purely analog control loop, but it would be hellacious to design and even worse to tune. A much better solution is to use a computer to solve the relevant equations with brute force - the more times per second, the better an approximation to a sine wave the motor current will be.

Anyway, this is why I said that simply driving an ac motor with a 3-phase audio oscillator and a big amplifier, even a Class D/G/H amp, will not get you any better results than the earliest VFDs.

Alright, carry on.


----------



## Technologic (Jul 20, 2008)

Tesseract said:


> A flux vector algorithm mathematically calculates the PWM signal needed for each phase based on stator current and rotor position. It's probably possible to do flux vector control with a purely analog control loop, but it would be hellacious to design and even worse to tune. A much better solution is to use a computer to solve the relevant equations with brute force - the more times per second, the better an approximation to a sine wave the motor current will be.
> 
> Anyway, this is why I said that simply driving an ac motor with a 3-phase audio oscillator and a big amplifier, even a Class D/G/H amp, will not get you any better results than the earliest VFDs.
> 
> Alright, carry on.


I don't think anyone was contemplating using a raw PWM signal and sending it into an amplifier stage without some kind of controls via processors of some kind... at any rate an active bandpass filter on the PWM generation is the ideal IMO, I can't think of anything that'd work better (at least so cheap and simple)


----------



## Tesseract (Sep 27, 2008)

Technologic said:


> I don't think anyone was contemplating using a raw PWM signal and sending it into an amplifier stage without some kind of controls via processors of some kind... at any rate an active bandpass filter on the PWM generation is the ideal IMO, I can't think of anything that'd work better


You can't think of anything that would work better, huh?

Hmmm.


----------



## Technologic (Jul 20, 2008)

Tesseract said:


> You can't think of anything that would work better, huh?
> 
> Hmmm.


Take that with a grain of salt considering I know very little about software designs 

But it certainly would work (and I'm sure doing it with some microcontroller of sorts would be more expensive).


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> I don't think anyone was contemplating using a raw PWM signal and sending it into an amplifier stage without some kind of controls via processors of some kind... at any rate an active bandpass filter on the PWM generation is the ideal IMO, I can't think of anything that'd work better (at least so cheap and simple)


I think Tesseract's point with a hardware based active bandpass is that we are dealing with a _variable_ frequency drive. So what frequencies you want to pass and what you want to block are going to vary wildy depending on speed. At 180 RPM, you want to block anything much over 3Hz, while at 6000 RPM, you want anything under 90 Hz and above 110 Hz or so (note that my exact numbers might be off, since I didn't sit down and do the calculations.) So you really need the PWM to be correctly modulated in the first place. It isn't something you clean up after the fact. Not to mention that cleaning up after the fact wastes power.

Really, we would rather generate nice sine waves and not use square waves, but we have to kludge around the fact that IGBTs aren't as efficient in the linear portion of their operating range. Are there reasonably priced IGBTs out there that switch fast enough (efficiently) such that we could push the modulation frequency up into the KHz range where it won't waste so much power? If we make our pulse widths short enough, then the natural characteristics of the wire itself will smooth out the pulses into a nice sine wave.


----------



## JonasMeyer (Feb 28, 2009)

JonasMeyer said:


> Are there reasonably priced IGBTs out there that switch fast enough (efficiently) such that we could push the modulation frequency up into the KHz range where it won't waste so much power? If we make our pulse widths short enough, then the natural characteristics of the wire itself will smooth out the pulses into a nice sine wave.


A little google searching shows that there are IGBTs out there that switch at high voltage (1200V) and high amperage (600A) at high speed (up to 100KHz). So this seems like the ideal solution. If we are switching at 90KHz or so, then we can have high power, very fine approximation of a sine wave, and any EM harmonics will be of so high a frequency as to generate very little current. Since they are generating small amounts of current, it will also be easier to shield against them with grounded cases. We might need a higher processing power pulse generator microprocessor, since it will need to be able to operate at that high frequency, but processing power is cheap these days.

I'd rather increase the cost a little bit and dodge a bunch of potential design issues that will make this easier on the diy guy.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> I think Tesseract's point with a hardware based active bandpass is that we are dealing with a _variable_ frequency drive. So what frequencies you want to pass and what you want to block are going to vary wildy depending on speed. At 180 RPM, you want to block anything much over 3Hz, while at 6000 RPM, you want anything under 90 Hz and above 110 Hz or so (note that my exact numbers might be off, since I didn't sit down and do the calculations.)


This is my point and what I said 2 posts ago... since bandpassing actively is generally fed by voltage into the opamps... all you'd need is a processor to selectively change the voltage into the filter thereby changing the frequency at which it is bandpassing...

how hard would that be? not hard at all... all the processor has to do is change the resistance. I'm sure there's some extremely basic equation here as well (probably 3-4 lines of code tops).

Also you could hard line a 96db/octave or higher filter after the highest frequency... ie. you could effectively shunt the power off at a certain frequency so people couldn't go over a set RPM and no frequencies over that amplitude would get through (again this would just be inherent in the design with no additional code needed for this).

Why is this such a bad idea exactly? it wouldn't waste any power because this is the SIGNAL generating portion not the amplification stage... you're talking about an entire oscillator running off 5v or so and maybe 0.1A

Clearly this isn't wasting power.



> Really, we would rather generate nice sine waves and not use square waves, but we have to kludge around the fact that IGBTs aren't as efficient in the linear portion of their operating range. Are there reasonably priced IGBTs out there that switch fast enough (efficiently) such that we could push the modulation frequency up into the KHz range where it won't waste so much power?


Yes... but there's few AC motors that run over 160Hz so you'd have to run the IGBTs and step down the raw power into lower frequencies for the motor side...

again a bad wasteful idea (I'm sure you'd end up with less efficiency this way no matter how you did it)


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> This is my point and what I said 2 posts ago... since bandpassing actively is generally fed by voltage into the opamps... all you'd need is a processor to selectively change the voltage into the filter thereby changing the frequency at which it is bandpassing...
> 
> how hard would that be? not hard at all... all the processor has to do is change the resistance. I'm sure there's some extremely basic equation here as well (probably 3-4 lines of code tops).
> 
> ...


Ahh I didn't realize it was on the signal side of things. That is a bad idea because you _want_ nice square waves going into the IGBT. The whole reason for using PWM is that IGBTs are horribly inefficient in the linear portion of their amplification range. We _need_ the square waves in the amplification circuit because they increase efficiency by a lot. We _don't want_ them in the motor because they create harmonics which decrease efficiency there.





Technologic said:


> Yes... but there's few AC motors that run over 160Hz so you'd have to run the IGBTs and step down the raw power into lower frequencies for the motor side...
> 
> again a bad wasteful idea (I'm sure you'd end up with less efficiency this way no matter how you did it)


You are misunderstanding me. Set our minimum pulse width to 1/90000th of a second. Generate that on the signal side of the circuit. Amplify it. Then we have very nice square pulses for the IGBT, which makes it efficient. However, we use those pulses to _simulate _the low frequency sine wave that the motor wants.

Now that I think about it, if the IGBT has a maximum switching speed of 100KHz, we probably want our pulse width to be in the 10KHz range, to minimize the amount of time the IGBT spends partially on, where it is wasting power to generate heat.

Anyway, just so it is clear what I am talking about, let's choose some numbers that are easier to work with. Pretend our motor wants a 1 Hz sine wave, and that the maximum amplitude of that wave should be 1V (it's a very slow very tiny motor). Now, because in our example we have to use IGBTs (so the example makes sense) and we want to minimize power lossage, we choose to simulate a 1Hz sine wave with a 100Hz PWM set of square waves. So what do we send?

Normal sine wave vs time, .125 second increments, instantaneous measurements
0, .5, 1, .5, 0, -.5, -1, -.5, 0

PWM signal that we send vs time, .01 second increments (signal is sent for entire duration of interval)
0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1,
0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0,
1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1,
0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,
0, -1, 0, 0, 0, -1, 0, 0, -1, 0, -1, 0, -1
0, -1, 0, -1, -1, 0, -1, -1, 0, -1, -1, -1, 0,
-1, -1, -1, 0 (you get the idea by this point)

Instead of using 1V, we obviously use more like 400, and instead of simulating a 1Hz wave with a 100Hz pulse frequency, we simulate a variable frequency (depending on motor RPM) with a 10KHz frequency. The higher the pulse frequency, the more accurate the simulation, but the more time the IGBT spends in the linear and shitty efficiency portion of the amplification range (for a given IGBT switching speed). However, the higher the pulse frequency, the lower the harmonic losses in the motor and the lower the currents produced by EM interference. So we want to pick an IGBT that allows for very high switching speeds so that we can pick a PWM frequency that is somewhat lower to minimize amplification losses while still being high enough to minimize harmonic losses.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> Ahh I didn't realize it was on the signal side of things. That is a bad idea because you _want_ nice square waves going into the IGBT. The whole reason for using PWM is that IGBTs are horribly inefficient in the linear portion of their amplification range. We _need_ the square waves in the amplification circuit because they increase efficiency by a lot. We _don't want_ them in the motor because they create harmonics which decrease efficiency there.


Well if you're pumping high efficiency PWM in the manner you're suggesting couldn't you just have a permanent bandpass on the signal side? Run that higher frequency PWM to the IGBTs (bandpasses can do this for squared waves if I'm not mistaken). Then use whatever software to pulse it in the manner you wish to simulate the lower frequency?

That way the frequency wouldn't change at all... only the pulse functions on the output?

I'm asking this because I can't imagine another way to remove the harmonics entering the motor, unless you're going with something very dynamic I have no experience with.

(only thing I can find on the subject is using passive bandpasses for smoothing... which of course makes sense but with active bandpasses this might not be the case)

Shit. It seems my idea (in some form) was patented:
http://www.freepatentsonline.com/3891946.html
Thankfully it seems to have been over 20 years.

Edit: Found such a circuit and lecture about it, seems possible to filter out the harmonics (at least up to the preamplification stage) and keep it a square wave:
www.ece.mcmaster.ca/faculty/li/EE3EJ4/Lecture_15.doc


> Instead of using 1V, we obviously use more like 400, and instead of simulating a 1Hz wave with a 100Hz pulse frequency, we simulate a variable frequency (depending on motor RPM) with a 10KHz frequency. The higher the pulse frequency, the more accurate the simulation, but the more time the IGBT spends in the linear and shitty efficiency portion of the amplification range (for a given IGBT switching speed). However, the higher the pulse frequency, the lower the harmonic losses in the motor and the lower the currents produced by EM interference. So we want to pick an IGBT that allows for very high switching speeds so that we can pick a PWM frequency that is somewhat lower to minimize amplification losses while still being high enough to minimize harmonic losses.


Well this in fact sounds like a perfectly fine idea, the problem is I'm not sure what coding would be needed... maybe you can shift the frequency out of the IGBT to control the amplifier's pulses of the signal... could be possible, but again... I have no idea how to do something like that

I still don't exactly understand how the pulses out of the IGBT will be simulated in the manner you describe... will a microcontroller be controlling this somehow? Also there's an issue of needing 3 such controllers, one for each phase channel since the graph should look like the one on this page:
http://www.kilowattclassroom.com/Archive/VFDarticle.pdf

How do you intend to control these pulses out of the IGBTs in the manner you describe? Maybe I'm just too unfamiliar with this to be any sort of help.

Edit:
After thinking about what you said I think I understand what you mean. You intend to pulse high frequency signals at 10khz but only send the signal so that the pulses are "many" (area under the AC curve) but with many "gaps" of 0v... sounds intriguing... and could even be done pre amplification as well. Smart idea, and not something I've seen discussed at all.


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> I still don't exactly understand how the pulses out of the IGBT will be simulated in the manner you describe... will a microcontroller be controlling this somehow? Also there's an issue of needing 3 such controllers, one for each phase channel since the graph should look like the one on this page:
> http://www.kilowattclassroom.com/Archive/VFDarticle.pdf
> 
> How do you intend to control these pulses out of the IGBTs in the manner you describe? Maybe I'm just too unfamiliar with this to be any sort of help.


I am in fact talking about doing exactly what is shown in the graph on the right 2/3rds down the page of that pdf. My major point is that if we make the minimum pulse width skinny enough, then harmonics become less of an issue because the current generated by those sharp right angles in the voltage waveform will be very slight. I am probably not using standard terminology at all, since basically all of my electronics knowledge is self taught.

PWM means that we are modulating pulses of various widths. I'm saying that let's think about that in a digital manner, since IGBTs like to be treated like switches (if we want maximum efficiency). So if it is digital, then it is 1s and 0s. We can therefore represent the various waveforms we want to generate as a series of 1s and 0s. The smaller the period of time that each 1 or 0 represents, the higher the "pulse frequency". I'm saying there is an inverse relationship between pulse frequency and harmonic losses, but a direct relationship between pulse frequency and IGBT losses. So we want IGBTs that can switch VERY fast to give us enough room to pick a good middle ground.

The 0s and 1s will of course be generated by a microprocessor. And we will of course need 3 sets of output. One set of output controls each phase. But logically, then we can divide the tasks needed into 3 parts.

1) Decide optimum frequency sine wave to drive motor for each phase.
2) "Digitize" sine wave into a very high pulse frequency set of square waves and send to IGBT.
3) Amplify signal and send to motor.

Nice thick wires like we will be using have a fair amount of capacitance, so if we set the pulse frequency high enough, the voltage being sent to the motor will be fairly smooth like it likes while still being square as it leaves the IGBTs (like THEY like). And we can put a capacitor in parallel with the IGBT that is sized to the pulse frequency to smooth out the very high (but constant) frequency noise that we generate there while leaving alone the lower frequency signals that the motor wants. A basic bandpass filter.


----------



## Anaerin (Feb 4, 2009)

I was thinking that this could be done with high-speed switching to make a low speed waveform, like how a soundcard running at 441.KHz can make a 20Hz waveform.

So, your wave goes...


1....11...111..1111.11111.1111..111...11....1.....!....!!...!!!..!!!!.!!!!!.!!!!..!!!...!!....!.....

(1 being a +tive pulse, ! being a -tive pulse).

When plotted and smoothed, this would appear to be a sine wave (I think, if I got my math head on straight), running at a frequency of 1/5th the switching frequency (there's 5 pulses in each "Group").

Using this system, I think we could reliably get frequencies up to 1/2 the switching frequency. And with adequate management, we could also make half-height sine waves using a similar system:

.....1....1..1..1.1..1..1....1.....

Well, that looks about right to me.

Let me know what you think...

[edit]...Or I could just read the PDF linked above.

Please ignore me, I'm an idiot.[/edit]


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> One set of output controls each phase. But logically, then we can divide the tasks needed into 3 parts.
> 
> 1) Decide optimum frequency sine wave to drive motor for each phase.
> 2) "Digitize" sine wave into a very high pulse frequency set of square waves and send to IGBT.
> 3) Amplify signal and send to motor.


So you will be smoothing after pulsing it into the first output prior to amplification?

not that I see any issue with this... just don't see why a full on bandpass can't be used prior to being sent to the first output stage.

splitting it off into 3 different signals and then amplifying each one shouldn't be terribly difficult.

Do you have any processor in mind for this task?


----------



## JonasMeyer (Feb 28, 2009)

I've been thinking about the basic fundamentals of controller design and IGBT losses, and I think we want to run the IGBTs at as high a voltage as is practical while still leaving a little bit of headroom for spikes. Since IGBTs come in breakdown voltages as high as 1800V while still being pretty common, I think we should aim for an input voltage of at least 1000V.

Since the voltage drop across the various IGBTs and diodes is constant, minimizing losses (and minimizing heat production, which is almost certainly our constraining factor here) means minimizing current. And minimizing current means maximizing voltage.

That said, 1000V in LiFePO4 batteries is like 300 of them. That's kind of outrageous. Do you think we can do a high efficiency DC-DC converter that can take, say 100V or something easy to work with and move it to 1000V with under a 1% loss? Or are we just moving heat production from one place to another?


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> That said, 1000V in LiFePO4 batteries is like 300 of them. That's kind of outrageous. Do you think we can do a high efficiency DC-DC converter that can take, say 100V or something easy to work with and move it to 1000V with under a 1% loss? Or are we just moving heat production from one place to another?


I think running the battery pack with small cells (3.2v x 10AH headways for instance) could be run up to w/e voltage you wanted for a minimal capacity. (you'd need about 300 of these to even get 9kwh... so the voltage isn't the issue)

Even prismatics come in 40AH or less sizes for similar prices with 3.2v.

The advantages to running a higher voltage is simply efficiency, cheaper design cost, cheaper PCBs (generally speaking) etc. plus far more motors are available.

The question I had was if you intended to have an output IGBT with this pulsing going on prior to amplification... if so you can do a feedback bandpass like described in that paper to keep the square waves in tact.
(not trying to push this continually, but these harmonics have to be taken out at some point).

At any rate I'll try to work up such a oscillator bandpass feeding into an IGBT to then be amplified sometime soon.
The few 3 phase schematics I can get ahold of seem to have such a system in place feeding into a microcontroller prior to the high voltage/amperage circuitry.

It's becoming more and more clear to me that you could design such a 3 phase AC controller as your PH.D project in EE at most universities... the crap they are working on by comparison is a joke.


----------



## Technologic (Jul 20, 2008)

After looking around I've decided on a few methodologies to start this...

I'm uncertain how to shove the gate drives -120 and -240 degrees out of phase (I've never had any reason to learn such a thing) but I'm certain it can be taken care of in a microcontroller

After looking around, for now I'm just going to go with a high voltage straight to IGBT output stage and see how it looks... for now.

I'd rather have something mocked up at this point and the design is far simplier (outside of this phasing issue) than I originally predicted.

There's probably some sensors that need to report to the microcontroller (such as stator position), but I really don't know what they are or care at this point...

I found ($1.25/each):
http://ww1.microchip.com/downloads/en/devicedoc/30498c.pdf

VFD microcontroller with 3 outputs... ideally you could just bandpass (if necessary) and then send them each to a gate drive then off to the IGBTs?

It's a very cool microcontroller taking straight DC-DC supply and outputing PWM in 3 different phases.

Could make the AC motor controller pennies to build.


----------



## Technologic (Jul 20, 2008)

http://ww1.microchip.com/downloads/en/AppNotes/00887a.pdf

Here's microchip's application notes for their 16-32 bit microcontrollers (many of which can not only provide the PWM but can provide current limitations, short circuit protection, shunting, some filtering (through feedback) and even rectification 

All for the low price of $4/ea 

The application notes for these things make this simple, just curious about the 32khz switching frequency.


----------



## Evan (Feb 20, 2008)

WoW I turned my back to do something else for a while and this thread exploded!

Everyone stop and read this for a second.
http://www.ab.com/drives/techpapers/PWMDrives01.pdf

If you want decent efficiency you have to understand it. As I understand it V/Hz mode will get you an efficency close to a DC motor but an aceleration significantly lower.

JonasMeyer - The breakdown voltage is where the semiconductor breaks down and can't switch any more. Voltage that level might as well just be arking across the terminals. There is a book by Forrest M. Mimms. called "Getting Started in Electronics" no offense but that should be your starting point from the hardware end.

The motor is a pile of connected and coupled inductors, when you turn the power on there are tramendous inrush currents threw the IGBT like wise when you turn it off there are voltage spikes. Your controllers are likely to see a lot of them and they can be quite high. You should use diodes to stop this. To size the diodes you need to create a rough spec for the motor. This is where you start not the other end. 

Once you know how much power the motor will take you find the IGBT and figure out how large it will have to be based on voltage, current and *power dissipation*. Just like any conventional transistor.

Technologic - That microcontroler is way to small as Tesseract tried to explain. It could do V/Hz but not anything past that. You don't need a bandpass. If you have seen anyone use them it was to filter out noise the power supply couln't. As for using one to prevent the harmonics I was talking about that is not possible. Consider the fourier analysis of the PWM signal. It wouldn't be the same if you put it threw say a high pass filter would it?


----------



## Evan (Feb 20, 2008)

Technologic - I have used PIC stuff in the past. As I mentioned earlier the PWM functions in them are really not suited to what you are trying to do. Qer and I talked about it for a minute. Look at the part of the microchip tech link you posted on Space Vector Modulation page 19. That kind of math would be, in my opinion impossible to do in anything smaller than a DsPIC which is meant to be a kind of DSP really.


----------



## Technologic (Jul 20, 2008)

Evan said:


> The motor is a pile of connected and coupled inductors, when you turn the power on there are tramendous inrush currents threw the IGBT like wise when you turn it off there are voltage spikes. Your controllers are likely to see a lot of them and they can be quite high. You should use diodes to stop this. To size the diodes you need to create a rough spec for the motor. This is where you start not the other end.


Every IGBT data sheet shows diagrams how to prevent short circuit damages (since any induction motor is basically a short circuit when not running) and preventing those spikes... gate resistor charts etc are all over the place and I've been storing the data for later.




> Technologic - That microcontroler is way to small as Tesseract tried to explain. It could do V/Hz but not anything past that. You don't need a bandpass. If you have seen anyone use them it was to filter out noise the power supply couln't. As for using one to prevent the harmonics I was talking about that is not possible. Consider the fourier analysis of the PWM signal. It wouldn't be the same if you put it threw say a high pass filter would it?


It's clear that 8-bit microcontroller was too little, but many of the other options could work.

similar to the 2nd one I posted.

Do you have a microcontroller in mind? I can't seem to find one that does EVERYTHING. I'll still need 3 gate drivers even with the 2nd mC I listed... and the rest of the components.

You keep discussing flux vector control and I can't seem to find anything that recommends it unless it is sensorless.

Alright I think I found the proper chip:
http://focus.tij.co.jp/jp/lit/an/spra345/spra345.pdf

Now I just need to find out what it costs
http://focus.ti.com/docs/prod/folders/print/tms320f2808.html
$13 
Even provide the algorithms for free for much of the motor controlling of AC motors.


----------



## Evan (Feb 20, 2008)

Technologic - It isn't the short circuit damage you should worry about it is the kick back from the motor. Then the issue is heat dissipation. 

No one makes a microcontroller for this because a microcontroller isn't really meant for this. They advertise them as usable in a VFD and that is true but to do better than V/Hz you need something more like a DSP. 16 or 32 bit and with math instructions past just add and subtract. Most of microchips stuff is derivative from the 8051 which was meant to do simple things like convert keyboard signals from the matrix of key switches to serial. Yes you can stretch it farther but when you are building a development system to learn and you don't really understand the requrements yet over build on the processing power. Your code should only be a 1K or two the RAM will be larger because you are doing floating point math but still. The chip you found was better suited to be the user interface. Frankly I find those are a pain to program in assembler, talk to Qer about using a HLL. Microcontrollers are meant to be limited they are by definition special purpose devices. You might find 1 with a VFD module but I have not seen any. I am just learning to use DSP right now. They are the way everyone else does it. That is the achitecture you want, fast math, low memory. The downside is the pricetag. 

Look I would like to help you guys more but I have my own work and projects to do.


----------



## Technologic (Jul 20, 2008)

Evan said:


> You might find 1 with a VFD module but I have not seen any. I am just learning to use DSP right now. They are the way everyone else does it. That is the achitecture you want, fast math, low memory. The downside is the pricetag.
> 
> Look I would like to help you guys more but I have my own work and projects to do.


I can't find too pricey of DSPs, at least nothing that will rival even 1 of the IGBT's.

At any rate I'll figure it out in one form or another... you can help (if you want) or not. I appreciate the guidance but in the end I'll have to learn as I go as well.

I don't expect to catch up in a week of searching, but considering as of last week the last time I'd looked at schematics was 2 years ago (and only op amp amplifiers) I think there's much more room to grow 

At any rate that DSP I listed seems very nice and specifically made for AC motors.

Granted I'm not much on this whole "let's make things more complicated for their own sake" attitudes, I think a good V/Hz model would function fine in the marketplace of ideas 

However the flux vector control gives higher low end torque, though not necessary for all applications, it still is more marketable (at a much steeper price).


----------



## Evan (Feb 20, 2008)

Technologic - To me that is pricey. If you look at my plan I am starting with V/Hz mode too. I will post stuff as I get around too it. It isn't that I don't want to help you guys it is that personally I have other stuff to take see to right now. 

Those chips are good. I have read that using Motorola's stuff is easier if you are learning. They also have code for SVM and V/Hz. The thing to realize about the code they provide is that if you use it the project isn't open source because they own the code. You are gust licencing it. That is a nice chip though. All you need are the tools to write code for those chips. That can be the hard part. Since JonasMeyer is eager to code something see if you two can't team up. Perhaps by finding a DSP that GCC supports. 


I am not leaving this totally I just have to take a break and take care of small unimportant things like finding a job.

I just did a quick check of compiler support and if you want to go GCC then the one those guys used in the circuit cellar article a while back used was good. Granted microchips altered form of GCC is fishy but it is still GCC. I don't know how microchip is calling it proprietary. Not that the tools change the licence on the source you are building but it is preffered when everything is as open as possible. There is a nice motorola chip here.
http://www.freescale.com/webapp/sps/site/overview.jsp?nodeId=02nQXGrrlPglzQMszY&tid=AMfa#apps
http://dsp56800.sourceforge.net/
They never quite finished the GCC port stuff though. It looks like you still need JTAG and stuff. I wonder if urJTAG supports this thing?
http://urjtag.org/

Really you need a chip and a complete tool chain. That can be hard to find with out going closed source.


----------



## Madmac (Mar 14, 2008)

Tesseract


> FYI, no general purpose uC on the planet has enough raw computational power to control a motor in anything more sophisticated than "V/Hz" mode*, which btw is what banging sine waves at a 3 phase motor will get you.


There seems to be a fundamental lack of knowledge of how to code control of AC motors. It is not can the processor execute the code but can it do it fast enough. A 4 bit micro controller with enough ram and program storage will do it.

The design needs to look at the major requirement.... how fast does the motor need to rotate. Then a decision needs to be taken of how many times are you going to update the drive signals per revolution. That will give a time in which you need to execute one loop of your control program. A sensor is needed to synchronise the software to the mechanical position of the rotor, either by a physical device or monitoring the undriven motor winding. It is worth pointing out that this time does not have to be related to the frequency of the PWM drive signals. That is decided by the drive requirements and motor characteristics. 

To give an example, if the max motor speed is 12,000 rpm or 200 per second and updating the drive 500 times per revolution require an update rate of 100,000 per second or 10micro seconds.

You now need to find a control device that will execute the required code in this time. This need not be one loop thru all code but an update of the position v drive section code. I have simplified this description so that all readers can follow the idea of what is needed. 

To prove to myself that an 8 bit micro controller can run SV control I ported the code in development to a C8051F122* a single chip device that runs at 100 MHz internal clock. I had to mess around with a bit of external logic to get a suitable 3 bridge drive signal as the internal counter array will not generate suitable signals. After a couple of attempts of hacking the code to deal with issues of values greater than 8 bits I can run a 1/2 horse power motor (my debug set up) up to a top speed of around 50RPM**. This is about correct as it is about 200 times slower than a suitable micro controller device.


There also seems to be confusion on filters. There are both analogue and digital filters at work in an AC motor control design. All control inputs (and power supplies) to the DSP are filtered in some analogue manner to remove noise and present a suitable signal for conversion into the digital domain. In the digital domain some of the sampled analogue signals are digitally filtered to give a more jitter free feedback signal. Other digital filters may run in any of the feedback loops implemented.



*
I agree that this device is at the top end of modern 8 bit controllers in terms of speed and size of program memory but it is an eight bit device and is not marketed for AC motor control.

**
I noticed that there does seem to be a minimum speed that you can drive an induction motor to start which I guess is related to coupling into the rotor being great enough to overcome friction losses.


----------



## Madmac (Mar 14, 2008)

As a quick update. I made a few changes to optimise the code as well as correct a silly error and can control the motor up to a speed of about 1000RPM. With further work I reckon a top speed of about 2000rpm could be reached before the motor load variations would fall outside the loop.


----------



## Tesseract (Sep 27, 2008)

Madmac said:


> ...
> To prove to myself that an 8 bit micro controller can run SV control I ported the code in development to a C8051F122* a single chip device that runs at 100 MHz internal clock. *I had to mess around with a bit of external logic to get a suitable 3 bridge drive signal as the internal counter array will not generate suitable signals*. After a couple of attempts of hacking the code to deal with issues of values greater than 8 bits I can run a 1/2 horse power motor (my debug set up) up to a top speed of around 50RPM**. This is about correct as it is about 200 times slower than a suitable micro controller device. ...


Hey - see that text in bold? If the internal counter array in the uC you chose is not capable of generating 3 phase PWM all on its own then how can you claim to have proved me wrong? Heck, it looks like you can't even bit-bang V/Hz PWM with the uC you chose...

Now, there may yet be a general purpose uC out there that can be coaxed into generating 3 phase SVM, and if I am wrong I am sure that you, madmac, will be the one to prove me so, but you haven't convinced me with this example.

Furthermore....



Madmac said:


> **
> I noticed that there does seem to be a minimum speed that you can drive an induction motor to start which I guess is related to coupling into the rotor being great enough to overcome friction losses.


The whole point to using SVM is that it allows you to control the induced flux in the induction motor's rotor so precisely you can then use such motors in _servodrives_. Yes, you can produce useful torque at very low rpm with SVM. Indeed, with at least one SVM variant called Direct Torque Control you can just about generate the breakdown torque of the motor at 0 rpm. That makes it possible to for a plain old induction motor to perform well in traction drive applications.

It's when driving an induction motor where the stator voltage is made a simple proportion of the frequency - V/Hz mode - that you have to resort to all sorts of ugly kludges to get any useful torque out of the motor below about 10% of its synchronous speed. Injecting DC into one or more stator windings (usually called "boost") was one favorite technique.

One last comment before I unsubsribe from this thread... you clearly have a not-so-hidden agenda here. The phrase in the first quoted paragraph, "I ported the code in development" implies you are working on a motor controller as well. I never, not even from my very first, made a secret of what I was up to; the same forthrightness and honesty, however, cannot be ascribed to you.


----------



## Madmac (Mar 14, 2008)

To quote you yet again


> FYI, no general purpose uC on the planet has enough raw computational power to control a motor in anything more sophisticated than "V/Hz" mode*, which btw is what banging sine waves at a 3 phase motor will get you.


 Makes no mention that it has to be a single chip solution. The gating I added would be in most designs to cut off drive in case of fault conditions. "Raw computational power" to me means the ability of the processor nothing to do with its I/O capacity..... but then I am taking the literal English meaning.





> One last comment before I unsubsribe from this thread... you clearly have a not-so-hidden agenda here. The phrase in the first quoted paragraph, "I ported the code in development" implies you are working on a motor controller as well. I never, not even from my very first, made a secret of what I was up to; the same forthrightness and honesty, however, cannot be ascribed to you.


If you look thru my past postings you will find that I have purchased a surplus Ford / Siemens motor for my conversion and am in the process of designing the electronics for both the BMS, which is almost finished, and the motor control, still in design. It will not be a commercial product, as a believer in open designs, and forums that encourage that end, I will post details to help others achieve the same. It is a great shame that some use these free forums to solicit business to save costs and give nothing in return.


----------



## JonasMeyer (Feb 28, 2009)

I'd like to not let this thread devolve into a flame war. Accusations aside, I think you and I should focus on getting the power electronics down, Technologic.

So let's throw out some top end specs and see if they are reasonable from a tech point of view. If they are, let's see if they are reasonable from an economic point of view.

Heat is the primary design constraint of the power electronics. Therefore, as high a voltage as possible is good. It is my understanding that AC motors will not produce nearly the same kind of voltage spikes as DC motors, and we will of course have diodes to think about to protect our IGBTs. So:

1) System Voltage - 1000V - We will probably need 6 IGBTs with breakdown voltages of 1800V or more to do this. Also we will need 6 similarly specced diodes.
2) RMS Peak System Amperage Per Phase - 74A - If we take something around the white zombie (300? Hp, or 223KW) as our absolute maximum peak performance, then we will need to be running 74KW through each phase. @ 1000V, that is 74A.
3) Peak Heat Dissipation - 450W - If we are running RMS 75A through each phase, and our diodes and IGBTs have a voltage drop of 6V (let's be conservative), then we will need to dissipate 450W peak.
4) Continuous Heat Dissipation - 225W - If we want to hit that peak for any significant period of time, we are talking continuous power that is half the peak power. This is firmly in the realm of liquid cooling, although very doable.

Given that liquid cooling adds a bunch of complexity to the project, let's get it back down to 150W cooling for our first version. We can modify the heat sinks later for an upgraded White Zombie killer. So...

1) System Voltage - 1000V - Stay the same.
2) RMS Peak System Amperage per phase - 36A - Half the amperage is half the heat.
3) Peak System Heat dissipation per phase - 225W
4) Continuous System Heat Dissipation per phase - 112W - This is less than my AMD 9850 Black Edition which I am typing this on. Now we can do off the shelf copper heat sinks with heat pipes and 120mm fans. We can order them off newegg even.

We'll need 1 diode and 1 IGBT for each phase for each current direction (regen), so 6 of each.

So we'll need 6 diodes that can do ~1800V x 300A each with under a 2V drop, 6 IGBTs that can do 1800V, 100KHz switching speed, and under a 4V drop. At the voltages we are running, finding an IGBT that can handle the amperage (spec it to 300A for overkill?) we are talking about should be pretty easy. We'll need 12 appropriately sized copper heat sinks, with 12 thermistor controlled 120mm fans. What are we talking price wise for just the power circuitry? Under $500? Under 1000? I'm having a difficult time finding IGBT prices. The fans and heat sinks will run us around US$30 each, so we're talking US$300 there.

Also (leaving aside the inevitable comments about how this controller is way overpowered and why would anyone want that much power [because we can]), anyone see any flaws in my logic? To run a 1000V will we need 1800V breakdown, or higher? Without brushes on the motor doing evil things to the voltage, how much headroom do we need?


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> So you will be smoothing after pulsing it into the first output prior to amplification?
> 
> not that I see any issue with this... just don't see why a full on bandpass can't be used prior to being sent to the first output stage.
> 
> ...


Technologic. I feel like you are missing a key piece of information. There is NO smoothing that goes on on the PWM waveform in the power circuitry. We WANT it to be square waves. Square waves are what the power circuitry LIKES!

However, low frequency square waves can do mean nasty things to our motor efficiency. So the solution to that is to crank up the pulse frequency.

Look, don't worry about it. Just know that our power circuitry is going to be running lots of VERY fast (like 10KHz) square waves at very high voltage, and spec it accordingly. Worry about the microcontroller later. It is a black box that takes input from the motor sensors and puts out square waves using software black magic.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> ] What are we talking price wise for just the power circuitry? Under $500? Under 1000? I'm having a difficult time finding IGBT prices. The fans and heat sinks will run us around US$30 each, so we're talking US$300 there.


There's no reason to think that the heatsinks/fans for it would cost over $20 in any decent (<100 piece) quantity.

As far as 1000v is concerned I don't have much interest in it:
But expect a price of $10-20 for each IGBT
http://www.alibaba.com/product-gs/200378455/IGBT_module.html

If you're really contemplating that this controller will cost $1500 just in heatsinks and IGBTs you really need to look into other sources.


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> There's no reason to think that the heatsinks/fans for it would cost over $20 in any decent (<100 piece) quantity.
> 
> As far as 1000v is concerned I don't have much interest in it:
> But expect a price of $10-20 for each IGBT
> ...



I'm not contemplating that kind of money for heatsinks and IGBTs, to be honest I am just totally uneducated about how much these things cost.

But why not 1000v? Increasing the system voltage is the easiest way to increase efficiency / power output without increasing heat.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> I'm not contemplating that kind of money for heatsinks and IGBTs, to be honest I am just totally uneducated about how much these things cost.
> 
> But why not 1000v? Increasing the system voltage is the easiest way to increase efficiency / power output without increasing heat.


Because 1000v is almost impossible to get in a car setting with any decent batteries.

I'd much rather see a 300v build or something instead... 1000v can also arc a lot more easily.


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> Because 1000v is almost impossible to get in a car setting with any decent batteries.
> 
> I'd much rather see a 300v build or something instead... 1000v can also arc a lot more easily.


Arcing is an objection I understand. That is an issue. But look at it this way. If we separate components properly and use high quality insulation, it ceases to be an issue.

On the other hand, at even 500v, you are talking about DOUBLE the heat production. At 250v, you are talking about 4 times the heat production.

Batteries is another objection I understand. 300 batteries is a lot. But as you said earlier in this thread, they don't have to be big ones. The only way that raises costs is in the BMS. And if we can build or buy an efficient (over 99%) DC-DC converter, then we can use fewer larger batteries instead of lots of tiny ones.

Also, higher voltages means smaller wires, and higher efficiency. We are going to have a constant voltage drop from the power circuitry no matter what voltage we choose. A 6v voltage drop is 2% of 300v. It is only 0.6% of 1000v.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> \
> Also, higher voltages means smaller wires, and higher efficiency. We are going to have a constant voltage drop from the power circuitry no matter what voltage we choose. A 6v voltage drop is 2% of 300v. It is only 0.6% of 1000v.


Voltage drop won't change just by raising voltage... that is based upon draw from the battery (and it's internal resistance).


----------



## Evan (Feb 20, 2008)

JonasMeyer - Did you not read my post. Look I am not trying to dictate the way you design but seriously look at it. 1000V is nuts, let Technologic or Tesseract show you how to do this. Why do you want such a high voltage any way? This isn't like a DC motor more voltage is not directly relational to more speed. If anything what you want is a higher frequency and more current at a lower voltage for that. Yes you could have a new kind of motor wound but trust me the insulation required on the wire in the windings would likely prohibit it from being practical. 

Madmac - You are mad give it up you lost the argument. It stopped being a debate and started to be an annoyance quite a while ago. If you have something that works here is an idea post the design. 

Technologic - You need to find something with a real data sheet to work off of. You need a lot more data than what that page lists. It doesn't for example list the thermal characteristics. Thermal resistances are important here. Look at what Etcher used and try to find 3 or 6 discrete modules that have better heat dissipation. You also need to know the input impedance. Basically since in some respects you seem as lost in some of this as I am try what I am doing a build a model. If you burn out those IGBTs or MOSFETs it will hurt the wallet less. Trust me this is likely. This is all a suggestion. 

I am trying to reduce my post size and to keep it to 1 a day.


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> Voltage drop won't change just by raising voltage... that is based upon draw from the battery (and it's internal resistance).


Again, I think I am using non standard terminology. What I mean is that the IGBTs and diodes have a constant voltage across them no matter what the voltage coming in from the batteries is.

An IGBT will dissipate between 2v and 4v as heat. How much heat depends on the amperage going through it. So if our system voltage is higher, then fewer amps are going through it, so waste less energy as heat, and it is easier to design our heatsinks, plus we get a bit higher efficiency.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Technologic - You need to find something with a real data sheet to work off of. You need a lot more data than what that page lists. It doesn't for example list the thermal characteristics. Thermal resistances are important here. Look at what Etcher used and try to find 3 or 6 discrete modules that have better heat dissipation. You also need to know the input impedance. Basically since in some respects you seem as lost in some of this as I am try what I am doing a build a model. If you burn out those IGBTs or MOSFETs it will hurt the wallet less. Trust me this is likely. This is all a suggestion.
> 
> I am trying to reduce my post size and to keep it to 1 a day.


I gave those as an example to illustrate price possiblities not as actual IGBT choices.

At any rate yeah I'm still somewhat lost on this... but since it's clear I'm unqualified to do any vector control designs (and I have zero interest in attempting to learn programming... for lots of reasons) I'm sticking with a V/Hz model that is very clear in my mind how it works.

I'm not sure I will even build this thing, it's not necessary for my build plans in my car... however I know this is a wonderful replacement to DC motor controllers and it promises to be fun.


----------



## JonasMeyer (Feb 28, 2009)

Evan said:


> JonasMeyer - Did you not read my post. Look I am not trying to dictate the way you design but seriously look at it. 1000V is nuts, let Technologic or Tesseract show you how to do this. Why do you want such a high voltage any way? This isn't like a DC motor more voltage is not directly relational to more speed. If anything what you want is a higher frequency and more current at a lower voltage for that. Yes you could have a new kind of motor wound but trust me the insulation required on the wire in the windings would likely prohibit it from being practical.


K. After looking up the insulative properties of Teflon, I agree that 1000v is a little high. We probably want 480v instead. Type EE insulated teflon wire is rated to 1000v, so we want a little headroom on that. Teflon wire is a little more expensive than the standard class-H stuff, but wire is hardly the major cost in a project like this.

480v is the highest common rating that motors come in anyway. Pity, now we will have twice the parasitic heat losses as at 1000v. And our heat sinks are going to have to be twice as big and bulky. All the people I have talked to in person about this stuff say that controller design is dominated by dealing with waste heat. I figure the easiest way to get rid of waste heat is not to produce it in the first place, and that means higher voltage.


----------



## Technologic (Jul 20, 2008)

*Jonas*

Since you're talking about the output stage and it's your main concern up till now I went ahead and drew up the output stage.

In general IGBTs need a voltage of between 15v and 20v to switch... this could be supplied without a gate driver... though it's fine if one is still needed.

10ohms for the gate resistor is fine... and will help the current and voltage switch without much losses (anything higher than this value and there will be decent voltage losses)

I originally was going to do Zeners for the gate voltage to prevent miller capacitance from charging the motor during shorts, but I'm not sure if they're needed.

I can dampen the oscillations by adding resistors off the wire coming from the output of the IGBTs, but I didn't include them since I have no clear basis what their values should be.

http://img21.imageshack.us/img21/5565/outputstage.png (click on the picture to get it large enough to examine)

Cheers

Edit: this is a pretty interesting self contained output stage... claiming up to 4000v and thousands of amps 
http://www.alibaba.com/product-gs/212753021/BSM15GD120DN2_Six_Phase_IGBT_transistor.html


----------



## JonasMeyer (Feb 28, 2009)

*Re: Jonas*



Technologic said:


> http://img21.imageshack.us/img21/5565/outputstage.png (click on the picture to get it large enough to examine)
> 
> Cheers
> 
> ...


I think we also need 6 diodes in series with each phase between the IGBT and the motor (in addition to the flyback diodes). IGBTs can't handle much voltage headed the other direction, so we need to protect them with diodes. Also, could you label the lines to the batteries? I'm a little confused.

Ok, I'm a lot confused. Forgive me if these seem like basic questions. Why do we want the resistors between the microprocessor and the gate on each IGBT? You say it will help current and voltage switch without much losses, but I'm confused as to why that is?

Also, that isn't a full 6 phase output stage. It is just 6 IGBTs in one package. At least that is what it looks like. And that is a bad idea because it concentrates all the heat production into one unit.


----------



## Technologic (Jul 20, 2008)

*Re: Jonas*



JonasMeyer said:


> I think we also need 6 diodes in series with each phase between the IGBT and the motor (in addition to the flyback diodes). IGBTs can't handle much voltage headed the other direction, so we need to protect them with diodes. Also, could you label the lines to the batteries? I'm a little confused.
> 
> Ok, I'm a lot confused. Forgive me if these seem like basic questions. Why do we want the resistors between the microprocessor and the gate on each IGBT? You say it will help current and voltage switch without much losses, but I'm confused as to why that is?
> 
> Also, that isn't a full 6 phase output stage. It is just 6 IGBTs in one package. At least that is what it looks like. And that is a bad idea because it concentrates all the heat production into one unit.


Here's why you need a gate resistor.

http://www.dynexsemi.com/assets/Application_Notes/DNX_AN4507_Jul02.pdf

Gate resistors are necessary to keep the roll off between switching from becoming too heavy. Often on inefficient AC controllers (where price matters more than efficiency) they put a large value there to avoid some of the capacitance from the Miller capacitance effect during switching. There are _always_ gate resistors

If you're talking about two zener diodes in the manner this text suggests I think it could help some, just not sure if it's necessary.

Here's sort of the "whole" output stage, feel free for anyone to make suggestions to it... parts I'm missing (this isn't including any gate drivers at all).

http://img21.imageshack.us/img21/2331/outputstageo.png


----------



## Technologic (Jul 20, 2008)

Gate driver and output stage:
http://img21.imageshack.us/img21/1006/outputstagef.png

This particular gate driver I chose works really well

There's two things I still don't know... firstly should there be a negative bias to assist in turn off (at least one that's larger than the -5v it should see no matter what) or will this gate driver do that for it? I hope so.

Secondly I'm uncertain what the polarized cap values should be... I really don't have any idea (the ones to the IGBT outputs). I'm not even sure I want them at all since they might smooth some of the pwm. (Edit: after thinking about it I see why they're there... forget what I said)

(pin placement is correct btw I just didn't want to draw out the markers for each pin on that thing)

Cheers.


----------



## Evan (Feb 20, 2008)

I have some quick thoughts.

1. That cap you have across the 500V source should be larger at least in terms of voltage. The uF rating for that cap and the value for the input resistor are questionable. Could I please see your math for those.
2. The IGBT output stage I find a little dubious because of the size of the power connections. I suspect pushing that much juice threw those little posts will melt them regardless of what the data sheet says. I don't like Etchers module because it was driven off logic levels directly but I did like the fact that it used screw terminals. Logic level drive for something that drives that much power is an issue because I worry about the output signal getting coupled to the input lines accidentally. (EM noise)
3. What method did you use to select the IGBT driver? It might just be me but it seems off.

If you use linux you might want to try drafting in gEDA. The output is much higher in quality than what you are using and it has a proper IGBT symbol.


----------



## Technologic (Jul 20, 2008)

Evan said:


> I have some quick thoughts.
> 
> 1. That cap you have across the 500V source should be larger at least in terms of voltage. The uF rating for that cap and the value for the input resistor are questionable. Could I please see your math for those.


Math for the gate resistor was done in the sheet I listed here previously... I lowered the uF rating to 200 which should be enough... again though I'm working the wrong way to calculate these values now. I believe the cap is just there for DC filtering, if so I can calculate that by hand if necessary for you... but I'm pulling this from multiple sources of motor controllers like this that generally place 1-2 100-200uF polarized caps on the input.

I'll be the first to admit my raw shortcomings when it comes to component value selection, especially in this setting where I know nothing about the drive motor and outputs of these component choices (never used them).

I'm trusting in actual gate resistor testing that was shown in the IGBT application notes . Of course there's a possibility of EM coming off...

I'm quite certain my design is full of faults... and any guidance from anyone (even about what to think of when imagining values for component sections) be my guest. I understand much about how that circuit works, but very little about what values yield the best outcomes. 

Once I have more time to really dig into this design I might be able to come up with solutions (and mathematical answers). Anyone interested in participating in this (and hopefully helping this self taught designer) needs to figure out what level we're really going to be going with here. If we're shooting for a 250kw motor controller (which I think we definitely should try) we'll need different values for everything.

Switching frequency will determine the gate resistor... if we do intend to go 10khz I will probably have to drop that value down to 1ohm or so.


> 2. The IGBT output stage I find a little dubious because of the size of the power connections. I suspect pushing that much juice threw those little posts will melt them regardless of what the data sheet says. I don't like Etchers module because it was driven off logic levels directly but I did like the fact that it used screw terminals. Logic level drive for something that drives that much power is an issue because I worry about the output signal getting coupled to the input lines accidentally. (EM noise)


I wasn't planning to use it, merely pointing it out. Output signal is grounded with a Kelvin connection (yet to be put in). Probably will be adding zener diodes as well to each IGBT, should probably put a fault resistor in there.



> 3. What method did you use to select the IGBT driver? It might just be me but it seems off.
> 
> If you use linux you might want to try drafting in gEDA. The output is much higher in quality than what you are using and it has a proper IGBT symbol.


The IGBT isn't a real IGBT symbol, but for my purposes it's fine. This is a mockup... something I can model quickly. I'll be moving it to autoCAD or Eplan later (something that can offer real feedback on component values)


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> Switching frequency will determine the gate resistor... if we do intend to go 10khz I will probably have to drop that value down to 1ohm or so.
> I wasn't planning to use it, merely pointing it out. Output signal is grounded with a Kelvin connection (yet to be put in). Probably will be adding zener diodes as well to each IGBT, should probably put a fault resistor in there.


10KHz was just a number I chose because it sounded good. We should actually do some math to model the effect of IGBT losses vs. motor harmonic losses. We may actually want something much higher (like 50KHz) or much lower.

If we choose an IGBT that is capable of 100KHz switching max (which was the maximum I could find), then switching it at 10KHz it will theoretically spend 10% of its time in the "partially on" state (although that number is probably higher since I doubt we will get the theoretical best case). How inefficient that particular IGBT is while in the linear portion of the amplification range has to be weighed against the induced current due to harmonics of the particular frequency we choose. And to be honest, I don't really know where to find the math that will help us tell how much parasitic current a particular frequency square wave will induce, all else being equal. But we need that equation.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> 10KHz was just a number I chose because it sounded good. We should actually do some math to model the effect of IGBT losses vs. motor harmonic losses. We may actually want something much higher (like 50KHz) or much lower.
> 
> If we choose an IGBT that is capable of 100KHz switching max (which was the maximum I could find), then switching it at 10KHz it will theoretically spend 10% of its time in the "partially on" state (although that number is probably higher since I doubt we will get the theoretical best case).


You or someone will have to go over how to make the IGBT "switch" without actually switching.

Namely because sending dead signals (0v) through the gate driver to be applied (ie. out of phase as well) won't yield any voltage to actually switch the IGBT. Not exactly sure what good if any it will do.

in contrast your every day run of the mill high voltage DC motor controller:
http://www.zev.dk/misc/diagram5.gif

Is simple.


----------



## Technologic (Jul 20, 2008)

http://www.dynexsemi.com/assets/IGBT_Modules/Datasheets/DNX_DIM300WHS12-A000.pdf

As you can see by this IGBT the losses are a function (somewhat) of the switching frequency.
At any rate the 20V or so needed to switch that on and off (and decently low current) 
Turn off delay can be as high as 1200ns at room temp (for some IGBTs)

The charts provide quite a bit of insight into what's going on and what needs to be considered.

Granted I still don't know how to calculate switching losses, since it's almost completely a function of gate resistors (and since I'm going to modify my schematic to have a Ron and Roff for the gate drive I don't know this yet).


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> You or someone will have to go over how to make the IGBT "switch" without actually switching.
> 
> Namely because sending dead signals (0v) through the gate driver to be applied (ie. out of phase as well) won't yield any voltage to actually switch the IGBT. Not exactly sure what good if any it will do.


I'm afraid you lost me here. I have no idea what you are talking about? Are you confused as to what I was talking about? I was talking about the pulse width. I was saying setting it to 1/10000th of a second may or may not be optimal, and I have no idea how to calculate that.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> I'm afraid you lost me here. I have no idea what you are talking about? Are you confused as to what I was talking about? I was talking about the pulse width. I was saying setting it to 1/10000th of a second may or may not be optimal, and I have no idea how to calculate that.


Sorry forget I said that, it was a foolish question and at the time I hadn't had my coffee  I see what you're saying, however I still don't understand how you expect to widen the pulse widths and keep the frequency the same. If you send 1v,0,0,0,0,1v,0,0,0,0 (1/1000th second sample) to emulate a frequency of 2khz it won't cause the IGBT to switch besides when voltage is sent. Can you please provide some sort of diagram of just 1 wave form showing the same amount of openings/closings of the IGBT but with less frequency?

I should have a fairly decent gate driver section finished today (ready to switch upwards of 1200v of actual motor side voltage per phase).

Currently the best IC for the task all in one (without using 6 gate drivers) is the IR2233. At a price of $9/ea per 1000 it's steeply priced, but worth it. Has overcurrent, overvoltage, undervoltage, fault, shut down signal, ground protections and bootstrapping. Likewise the only downside to it (has a very fast 70ns or less return off logic inputs) is it drives the outputs out of phase to the inputs.

http://www.irf.com/product-info/datasheets/data/ir2133.pdf 

For your information... I dropped the gate driver I had yesterday because it couldn't survive massively high voltages like this one can.

It's double the price though


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> And to be honest, I don't really know where to find the math that will help us tell how much parasitic current a particular frequency square wave will induce, all else being equal. But we need that equation.


Here's a paper about this subject:
http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=01199670

Seems to be somewhat straightforward but I'll read more when I have time.


----------



## Technologic (Jul 20, 2008)

http://img257.imageshack.us/img257/5565/outputstage.png

Here's the most recent attempt at a gate-drive and output schematic...

Added a 2 resistor/diode set up (though I'm not sure if I need this on the low side... I doubt it)

I'm going to move this over to another CAD, but I still need to figure out what IGBTs are best to use (or even something "normalized"). I found a formula to calculate the bootstrap cap value (though there's a lot of leeway with it).

However until PWM frequency is decided it's impossible to choose the bootstrap capacitor value.

That gate driver is an absolutely stellar component.

Article on DSP PWM generation:
http://electronicdesign.com/Articles/Index.cfm?AD=1&ArticleID=7633


----------



## Technologic (Jul 20, 2008)

Likewise I'm dead set on the TI-DSP I listed earlier, the TMS320F2808:
http://focus.ti.com/docs/prod/folders/print/tms320f2808.html#technicaldocuments

One of the cheapest and easiest to understand (to me anyway) DSPs out there for 6 channel high/low PWM (with multiple phases etc)... it even allows for 0-100% control of the duty cycles and programming for each (specific PWM control functions).

I'm going to be working on that stage now and hopefully get the DSP-gate done in the next few days... the rest will be easy by comparison.


----------



## Evan (Feb 20, 2008)

Technologic - It is ok I am not qualified to do SVM yet and doing power electronics is a little new to me too. School teaches small signal stuff very well but things like large signal amplifiers very badly. The first one I built for one of my robots burned up the moment I turned the power on. We are all facing a challenge to our learning curves here, this definetely includes me.

As for finding the bandwith requirements of the IGBT that is a tough. I have not joined the IEEE but I will look that up in my university library eventually (weeks). This is one of the reasons I was building a model.

One of the points of the model is to have something I can run on a workbench an measure the output of with out dimming the lights or haveing to bolt it to the floor. I suspect that the efficency of the electronics grows with the frequency more or less (harmonics) until you reach the point where you are doing so much switching that the power loss from running at that high a bandwidth brings the power output back down. This is likely do to IGBT heat dissipation at higher frequencies and internal capacitence. Higher bandwidth IGBT's are made using something called trench gate which as far as I can tell is just a new form of gate fabrication that yealds a better 3D geometry for fast saturation. I think it is industry wide now though so just go by the data sheet. To work out things like this I have looked at stuff like the IEEE papers but mostly I just try to reason it out on my own using things like the IGBT SPICE models. I found a really nice model for the electical properties of IGBT a year ago I will have to find it again and post a link here. The better data sheets (ex. Fairchild) include detailed models for the parts thermal properties too. I know simulating thermal properties in SPICE is not very efficent but it is nice to run 1 simulation and generate both simultaniously. 

Any how I was planning on just testing my model in V/Hz mode with different frequencies with the motor under some nominal load (flywheel with bicycle break). Then enter the IGBT temperature, frequency, current, RPM, and mechanical load data into GNUPlot. 

On the DSP thing have you found a tool you can use to program it yet? The last time I though about using a DSP from them it needed TI's special IDE suite that cost a lot.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Technologic - It is ok I am not qualified to do SVM yet and doing power electronics is a little new to me too. School teaches small signal stuff very well but things like large signal amplifiers very badly. The first one I built for one of my robots burned up the moment I turned the power on. We are all facing a challenge to our learning curves here, this definetely includes me.
> 
> As for finding the bandwith requirements of the IGBT that is a tough. I have not joined the IEEE but I will look that up in my university library eventually (weeks). This is one of the reasons I was building a model.


I can load it for you and save it ... since I'm on campus if you like. 
Also I agree, anything small scale (or DC) looks far easier to design than this is becoming. There is so much to worry about and monitor, just the slip factor is enough to make someone crazy.

I'd probably have an almost complete schematic of a DC controller by now 


> One of the points of the model is to have something I can run on a workbench an measure the output of with out dimming the lights or haveing to bolt it to the floor. I suspect that the efficency of the electronics grows with the frequency more or less (harmonics) until you reach the point where you are doing so much switching that the power loss from running at that high a bandwidth brings the power output back down. This is likely do to IGBT heat dissipation at higher frequencies and internal capacitence.


Who would have thought there's 3 different capacitances to worry about just at the IGBT side? I didn't till today... this is so much more dynamic than anything I've seen



> Higher bandwidth IGBT's are made using something called trench gate which as far as I can tell is just a new form of gate fabrication that yealds a better 3D geometry for fast saturation. I think it is industry wide now though so just go by the data sheet. To work out things like this I have looked at stuff like the IEEE papers but mostly I just try to reason it out on my own using things like the IGBT SPICE models. I found a really nice model for the electical properties of IGBT a year ago I will have to find it again and post a link here. The better data sheets (ex. Fairchild) include detailed models for the parts thermal properties too. I know simulating thermal properties in SPICE is not very efficent but it is nice to run 1 simulation and generate both simultaniously.


One thing that's great about TI, IR and Fairchild (I suppose you can include Dynex semi as well) is that they don't give you just a few graphs. They give you dozens, showing temp rise, how it effects gate charge, etc... very useful, even just to help conceptualize. 



> Any how I was planning on just testing my model in V/Hz mode with different frequencies with the motor under some nominal load (flywheel with bicycle break). Then enter the IGBT temperature, frequency, current, RPM, and mechanical load data into GNUPlot.
> 
> On the DSP thing have you found a tool you can use to program it yet? The last time I though about using a DSP from them it needed TI's special IDE suite that cost a lot.


I actually can't find another DSP that's this good. It's frustrating as I originally didn't want to use TI's either.

I am somewhat taken aback by how cheap this could be made for (even on a scale of 500pcs/year)... for something that has the potential to control motors up to 250kw continuous, I'm somewhat amazed there's going to be only about $80 in parts in this finished design (maybe a tad more).

That 1200v 3 phase driver for only $11 in volumes of 1 ($8 or so in 1000 pc volumes) is an amazing little thing.

Flux vector control will cost more "out of the box" and I'm still quite lost how it functions (and what additional parts are necessary).

I'm not entirely sure what to look for as far as other DSP (or DSC perhaps) microcontrollers, from microchip perhaps. I'll have to keep searching around.


----------



## Evan (Feb 20, 2008)

Ah Slip my old foe. Man the only electronics class I ever had trouble with was Energy Conversion. People say Microwave stuff is hard but that class was so much easier than all this motor stuff. Yes a DC motor is much easier to control though there are tricks that let you optimize it, using again complex math, that would complicate things. 

It isn't that IGBT's are all that complex it is that there are factors inside any semiconductor device that you normally just round off at smaller scales. When you see the designs for anything going into space the level of complication gets crazy because they account for everything you can think of and then some. Graphs are nice but a spice model has math you can if you want use backwards to design with. I mostly use graphs to tell how good a part really is relative to the competitors design in a given operating range. As for how to drive your IGBT since you are using it for basically it's ownly prescribed use the manufacture likely has an application note for interfacing it to a microprocessor or DSP. If they don't ask nicely and they will likely find you one companies like helping students in many ways they are nicer too us than our schools. I suspect you are making the whole IGBT thing more complex than it really is. This isn't like a class A amplifier you just want the thing all the way on or all the way off. So for the Dynex module it is 0V (off) or ~2.5V (on). You never want to bias it on, that will just generate heat.

I don't think this DSP will prove to be as good as you think it is. Flux Vector control only costs more in terms of sensors and an ADC both of which are relatively cheap. The problem is in writting the code. Why don't you check TI's AC Induction Machine Application note. That EDN story you linked too said the chip had a built in SVM calculator.


----------



## Technologic (Jul 20, 2008)

Evan said:


> I don't think this DSP will prove to be as good as you think it is. Flux Vector control only costs more in terms of sensors and an ADC both of which are relatively cheap. The problem is in writting the code. Why don't you check TI's AC Induction Machine Application note. That EDN story you linked too said the chip had a built in SVM calculator.


There's a lot about that TI chip to read, but it's the closest to a DSP that has a fully programmable (ie. controllable) PWM... and a fast enough speed to yield good results from sensors.

I've honestly looked around quite a lot. They do have some code examples and guidance on how to shift the ePWM to do full duty cycles (and code it so that you can control the phasing etc).

Sounds complicated enough even for a V/Hz model. Maybe there's DSPs out there I'm overlooking. 

Not sure if I've read that AC induction machine note or not, I'll take a look.

The thing that is frustrating is trying to find out the miller capacitance of the IGBTs so I can get a good idea what the bootstrap caps' rating should be (which is a relatively annoying formula)

When you say you never want to bias it on I'm uncertain what you mean... the gate drive voltage for most IGBTs is upwards of 20v for it to switch... but you don't want to open and close this? or do you want to send less than the 20v in order for it to not open completely?

Edit:
Found a DSP on TI's site that might work better:
http://focus.ti.com/docs/prod/folders/print/tms320c6410.html


----------



## Evan (Feb 20, 2008)

I was searching for things related to using a kind of "chain logic" design scheme on an FPGA and things like lookup tables in firmware when I found these.
http://www.irf.com/product-info/datasheets/data/irmck201.pdf
http://www.irf.com/technical-info/whitepaper/irmck201_203.pdf
I know this would be a kind of cheat considering we are trying to design it all our selves but if we are seriously looking for a cheap, fast and simple solution this might be it. My only real concern is efficency and can it do regen. It looks like you could trick the chip into doing regen if you don't connect the break signal to the IGBT module.


----------



## Technologic (Jul 20, 2008)

Evan said:


> I know this would be a kind of cheat considering we are trying to design it all our selves but if we are seriously looking for a cheap, fast and simple solution this might be it. My only real concern is efficency and can it do regen. It looks like you could trick the chip into doing regen if you don't connect the break signal to the IGBT module.


I'm personally looking for a cheap, fast and simple solution that is open source and readily available (ie. some PCBs for people/fully populated boards like for some of the other efforts, something cheap but readily useable for everyone)

The first chip looks nice, though I'm curious what auxiliary components will be needed. Clearly it's a full on flux vector control circuit, but can it run off 1200v like the one I was attempting to do?

I'll have to look over the notes in depth tomorrow and see what it really looks like as far as application. Good find though!

The damn boards they use to "test" it are always sooooo overpopulated with features, very annoying. I'm hoping that IC is really as good as they make it look.

Edit: very nifty find after some examination... not sure what that multi-axis host is for, but interesting nonetheless.
It appears that there is still no gate driver for the IGBT, just a very advanced sensing network for all of the auxillaries... pretty useful, though they never go into enough detail with the "normal application" information.

Why are you concerned about efficiency exactly? it doesn't appear to have a gate driver.


----------



## Evan (Feb 20, 2008)

Well this would mean that the hardware would be open source but the core of the thing is that chip and the tool that IRF provides to configure it. Both the chip and the configuration software are closed source. As I understand it the chip runs of conventional logic power but the IGBT's or whatever can use the voltage of your choice. As for that being 1200V that is just crazy as far as I can see. What good is 1.2KV? It isn't like basic algerbra just because a motor is rated at 12W doesn't mean that 2V*6A and 6V*2A are interchangable.

I think we should build the power hardware and make a small simple board around this chip now. That way we know we are using half of something that works when we create our own fully open source machine. Think shoe horn... I want to do something like this.
http://www.csgroup.tunet.tn/publications_equipe_c&s/kharat/icm2001/PM171.pdf
Screw using DSPs using an FPGA looks so much more eligant. This kind of thinking is the way forward. Let the user interface and other functions be done in a uC us an FPGA for the SVM.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Well this would mean that the hardware would be open source but the core of the thing is that chip and the tool that IRF provides to configure it. Both the chip and the configuration software are closed source. As I understand it the chip runs of conventional logic power but the IGBT's or whatever can use the voltage of your choice. As for that being 1200V that is just crazy as far as I can see. What good is 1.2KV? It isn't like basic algerbra just because a motor is rated at 12W doesn't mean that 2V*6A and 6V*2A are interchangable.


That I'm aware of, but I like the idea of not having really a "limit" to design so to speak. The gate driver can do it, so that's not an issue since this appears to still need one. (in fact after looking at it more closely I don't think it's an issue to go to 1200v if someone wanted to)

I'll have to keep reading that application notes and see what else... trying to figure out how the brake pin would keep it from regening but I haven't gotten so far in it yet.



> I think we should build the power hardware and make a small simple board around this chip now. That way we know we are using half of something that works when we create our own fully open source machine. Think shoe horn... I want to do something like this.
> http://www.csgroup.tunet.tn/publications_equipe_c&s/kharat/icm2001/PM171.pdf
> Screw using DSPs using an FPGA looks so much more eligant. This kind of thinking is the way forward. Let the user interface and other functions be done in a uC us an FPGA for the SVM.


Agreed... I'll work on power stages and do it the correct direction 
Seems there's somewhat of a user interface already in it...

the chip is $15 in 1 quantities... even more enticing as I read


----------



## Technologic (Jul 20, 2008)

I found a guy who's put together some information on all of the circuits needed for this chip:

http://www.cnczone.com/forums/showpost.php?p=118781&postcount=18

the PDF is useful... at least for some of the things I'm totally unfamiliar with.

Here is a PCB layout and Schematic they designed for this unit:
http://www.cnczone.com/forums/showpost.php?p=128128&postcount=80

Schematic is fairly simple (somewhat straightforward though I don't understand all of it) 3 phase AC servo.

Yeah it'll help me to not have to think so much


----------



## Evan (Feb 20, 2008)

Well that is not completely done and I want to design my own use for the chip. There are some things that in an EV need to be different. 

I can't seem to find a distributor for the chip.


----------



## Evan (Feb 20, 2008)

I though this might be good because it is obtainable...
http://www.freescale.com/files/microcontrollers/doc/data_sheet/MC3PHAC.pdf
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=MC3PHACVDWE-ND
quantity 1 @ $7.88
Programmable via RS-232 threw any simple VT-100 terminal. Sweet.

But it doesn't appear to do SVM.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Well that is not completely done and I want to design my own use for the chip. There are some things that in an EV need to be different.
> 
> I can't seem to find a distributor for the chip.


I was just shoving it out there as interesting (considering the guy almost finished it minus sensors and the output stage)

Digikey does have it in stock, but I'm not sure if you can buy it outside of high quantity.

I'll look around for samples.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Programmable via RS-232 threw any simple VT-100 terminal. Sweet.


Yeah I read that... pretty simple so you don't have to get the $2700 program to change the code 

At any rate that controller won't do SVM I don't think. But is a simple place to start if you want to go V/Hz for testing?

you aren't intending to link that to the IRMCK201 are you?


----------



## Evan (Feb 20, 2008)

No those two chips are incompatable in every sense. 
This chip 
http://www.irf.com/product-info/datasheets/data/irmck371.pdf
https://ec.irf.com/v6/en/US/adirect...e&domSendTo=byID&domProductQueryName=irmck371
claims to do SVM but it is mostly targeted at AC Permanent Magnet motors. 
"Support Induction motor sensorless FOC control"
What the heck is FOC control? http://en.wikipedia.org/wiki/Field-Oriented_Control
http://focus.ti.com/lit/an/bpra073/bpra073.pdf

On a tangential note... Still trying to grasp how SVM works...
http://www.youtube.com/watch?v=CTM7ve7hBJE
first 8 or 9 pages of this were really good.
http://www.eu.necel.com/_pdf/U16483EE1V0AN00.PDF


----------



## JonasMeyer (Feb 28, 2009)

Technologic, I am still really concerned that when we turn this thing on for the first time the massive voltage coming out of 3 of the IGBTs is going to overload the other 3 that are facing the other direction. Don't we need diodes to protect the IGBTs? They aren't designed to handle hundreds of volts of negative bias.

Also, I'm with Evan in that I still don't understand the reasoning behind negative bias on the gate to shut it off. Near as I can tell, those are useful in sound applications where we want nice round edges to our waveform, but we WANT the square waves.


----------



## Evan (Feb 20, 2008)

JonasMeyer - The IGBT's don't need to be protected from each other. Remember that reverse breakdown voltage? As long as your operating point is no where near that voltage the gate/transistor can have that much power across it with out burning out. The one thing we do need to keep in mind is the heat dissipation thing. If we get an IGBT that is best suited to the motor (not rated for the most voltage we can find) then the heat it generates will be enought to keep it running at the most efficenct temperature with only minimal cooling. Over rating the IGBT's means they run cold which is bad. 

The IGBT's do need diodes to prevent reverse voltage spikes from the motor. However, the IGBT's that Technologic has shown us the data sheets for so far all seem to include diodes from Emitter to Collector.

I was saying you don't want to bias the gate. However, the gate has some internal capacitance so you may need to bleed the voltage out of the gate (threw a high value resistor) to make it desaturated faster.


----------



## JonasMeyer (Feb 28, 2009)

Evan said:


> The IGBT's do need diodes to prevent reverse voltage spikes from the motor. However, the IGBT's that Technologic has shown us the data sheets for so far all seem to include diodes from Emitter to Collector.


Ahh. The diodes are built in. Cool. Nevermind. Let's just make sure to note that in whatever documentation we design as a how-to. Could be frustrating for someone who tries to build this and is like "WTF?! I have the same spec IGBT! Why does it keep blowing up?"


----------



## Evan (Feb 20, 2008)

The diode is in the spec for the part. Yes we keep omitting it when we talk about it but that is because it is not interesting. There really is not a whole lot of room for optimization there because the mfg found the ideal diode for the job and likely made the fabrication process for it create a junction ideally suited to protecting the gate. They are clever like that. Most IGBT modules at this point like the ones shown include the diode and it is listed in the spec for the part in the area usually titled "Absolute Maximum Ratings." If the person building this thing is replacing parts and can't be bothered to read that or the diagram of the part showing the diode on say the first page the saying is garbage in garbage out. Not to sound empathetic but getting it running is going to be the hard part not documenting it, that is just long. You can't protect ignorant people from them selves. 

Technologic - I found a paper that basically stated my hypothasis about switching speed. It turns out that their is a point where you start to get the sine smoother and it grows in efficency however, after that point the energy burned in making the sine excessively rounded lowers the efficency. So some noise is not bad from that stand point. I wonder how to ballance the two factors of noise and efficency though.


----------



## JonasMeyer (Feb 28, 2009)

Evan said:


> Technologic - I found a paper that basically stated my hypothasis about switching speed. It turns out that their is a point where you start to get the sine smoother and it grows in efficency however, after that point the energy burned in making the sine excessively rounded lowers the efficency. So some noise is not bad from that stand point. I wonder how to ballance the two factors of noise and efficency though.


We've been wondering that for several pages of thread now. Techologic found a paper he says is relevant, but I can't read anything but the abstract since I don't have the required memberships.

Actually though, I imagine the optimal switching speed varies depending on what motor the controller is paired with. Perhaps we should make this a software controllable value? If we get a chip that can do at least say, 50KHz (half the speed of the best IGBTs), then we could always crank it down if that was more efficient.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> Ahh. The diodes are built in. Cool. Nevermind. Let's just make sure to note that in whatever documentation we design as a how-to. Could be frustrating for someone who tries to build this and is like "WTF?! I have the same spec IGBT! Why does it keep blowing up?"


which diodes are you talking about? the high side output diodes? because those are definitely not supposed to be there... it should be allowed to bypass the IGBT on the reverse phasing (in only one direction).


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> Actually though, I imagine the optimal switching speed varies depending on what motor the controller is paired with. Perhaps we should make this a software controllable value? If we get a chip that can do at least say, 50KHz (half the speed of the best IGBTs), then we could always crank it down if that was more efficient.


It will be a fundamentally controllable value ie. from the R-232 MCU that is attached for interfacing to the larger controller module... this smaller MCU will interface and allow functional changes of the switching frequency etc.

However, I want to design the controller to work with 1 motor.... and offer just "general guidelines" for other motors.

There is only about 2 motors over 30kw that offer light weight for cars and SVM (or can be added on) ... 1 is from a Chinese company and is reasonably priced (about $900 in 1 volumes) another is from Seimens and is about $3500 in volume.


----------



## Technologic (Jul 20, 2008)

Evan said:


> J
> 
> I was saying you don't want to bias the gate. However, the gate has some internal capacitance so you may need to bleed the voltage out of the gate (threw a high value resistor) to make it desaturated faster.


There are several ways to do this, but generally the reverse gate resistor is optimal for this task (ie. the most recent output stage schematic) I can't find any information on bleeding it out that quickly... capacitance is fairly low (20-50nF for 1 IGBT) but the gate charge also encompasses the miller capacitance (collector to gate capacitance).

I've thought about putting some parallel bleeding resistors on the gate itself, but I don't have a lot of knowledge about what these values should be yet, as I have to wait and see what IGBTs are chosen and how much gate charge there is.


----------



## Evan (Feb 20, 2008)

Technologic - I was just trying to explain why I though those resistors were there. Yes there are more efficient methods, thus special gate driver chips. Most of the IGBT's on the market have such support components which they explain in detail in the IGBT application notes. 

As for motor choice there are others I am sure floating around out there. I suspect most of this machines users will be using surplus motors from industrial equipment and left overs from defunct EV programs (ex. Siemens/Ford Ranger motors). There are likely other motors out there. I think I will put the math for my models output state on the net in sagemath or octave.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Technologic - I was just trying to explain why I though those resistors were there. Yes there are more efficient methods, thus special gate driver chips. Most of the IGBT's on the market have such support components which they explain in detail in the IGBT application notes.


In my schematic or in the schematic made by that guy for the IR chip over at the other forum?

He has parallel resistors leading to a shunt capacitor which would cause the bleeding you suggested (and being 1k ohm they would do it better)

Likewise the gate resistors protect the IGBT from switching off too quickly and causing large swings in voltage across the gate (without any normalization). If you look at that graph I listed several pages ago it explains somewhat why the voltage is wasted and current is delayed after switching the larger you go on the resistor value... but you don't want NO gate resistor, if you did the IGBT would probably not have a very long life

For a lot of reasons you don't want to just drop this (or any) AC controller to work on the seimens surplus motor. 
I'd much rather have "kits" similar to thunderstruck EV available with a large format motor/controller already ready to go... Certainly profitablity wise there's a decent market share for this (and since there won't be any cars out till at least 2012-2013 that are all electric AC motor drives). Even though it's open source, your average person will still need some guidance/completed boards.


----------



## Evan (Feb 20, 2008)

Yours I didn't read the other too carefully. The smaller you make that resistor the more power you waste saturating the IGBT/MOSFET. 

As for your ideas on matching the controller to the motor I don't agree. Obviously it would be necessary for people used the correctly matched configuration. Other than the IGBT stuff we can just tune the SVM algorithm to the motor using a self calibration routine when it is setup.

As for a business around this I doubt it will happen unless we become the small scale distributor of some obscure part like the IRF thingy to the DIY community and I don't want to do that. The point of open source is that people alter it to fit their needs. If someone wants a kit preassembled or advice on a redesign then there is a business oportunity I guess.

Oh I think I understand SVM now.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Yours I didn't read the other too carefully. The smaller you make that resistor the more power you waste saturating the IGBT/MOSFET.


This is why the other 2 resistor method will likely prove to be better suited. You can have a decently high input resistor value (say 50 ohms which is quite high) and yet not have the severe wasted current and slow response from the - negative wave form. since the other resistor would be present.

At any rate I wasn't contemplating a business... I personally don't like that idea at all (of selling anything outside of populated boards perhaps), but people programming them the way you suggest, even with a very adaptable user interface, still seems somewhat iffy.

The best gate resistor values will be illuminated as I figure out the gate charge... ideally you want to choose a + resistor value that will not allow for much saturation above the total gate charge (for each cycle) and a - value so low that it discharges very quickly


----------



## Evan (Feb 20, 2008)

The output stage is the only part that really is truly fixed and still the only real issue is output bandwidth. The IGBT is not at a fixed frequency operating point with V/Hz it changes and since SVM is just a wrapper for V/Hz it also varies.

I don't see what would be so iffy about the motor auto calibration. I have designed things in the past that auto calibrated, yet another of doing programmable hardware. This does raise the cost of a unit a little but you can keep it low if you know what you are doing.


----------



## Technologic (Jul 20, 2008)

Evan said:


> The output stage is the only part that really is truly fixed and still the only real issue is output bandwidth. The IGBT is not at a fixed frequency operating point with V/Hz it changes and since SVM is just a wrapper for V/Hz it also varies.


If the frequency changes how do we intend to optimize the efficiency of the IGBT? I was under the impression we were going to try and make the PWM frequency the same, but modify the pulse size (ie. instead of lots of little or no switching for low frequencies at 10khz it outputs larger gate switching and lots of open sequences)

Jonas never really explained this to the point I understand... I was under the impression to get higher frequencies the pulse width much increase so that the current curve increases.



> I don't see what would be so iffy about the motor auto calibration. I have designed things in the past that auto calibrated, yet another of doing programmable hardware. This does raise the cost of a unit a little but you can keep it low if you know what you are doing.


How accurate would the auto calibration be? Would it be necessary to attach any sensors etc? would certain motors not work? (industrial ones made for straight V/Hz stuff?)


----------



## Evan (Feb 20, 2008)

The reality is that since the PWM signal used by V/Hz mode has components (not being a sin) to include different frequencies (Fourier Series). Yes it is most efficient at 1 particular carrier frequency but this is not as big a deal as you would think. Basically the faster the frequency response of the IGBT's the better. If you give some people a product that has unneeded bandwidth it won't matter much (provided the aditional cost is minimal). 

There are points where you don't want the gate drives on. By letting the voltage across a given phase drop on it's own you save power. Think about it this way, you have to put a little power in and then let it settle or give a pules of negative power to lower the phase voltage to match the sinewave shape.

Yes sensors would be needed, the same ones used by the SVM algorithm. All motors in a given range would work. Though I don't know yet how well all of them would work.


----------



## Technologic (Jul 20, 2008)

Evan said:


> There are points where you don't want the gate drives on. By letting the voltage across a given phase drop on it's own you save power. Think about it this way, you have to put a little power in and then let it settle or give a pules of negative power to lower the phase voltage to match the sinewave shape.
> 
> Yes sensors would be needed, the same ones used by the SVM algorithm. All motors in a given range would work. Though I don't know yet how well all of them would work.


I've read about this in depth and understand it quite well... most IGBTs have a rather large delay (especially delay to the point it's considered "fully saturated" when the collector to gate capacitance is charged).

The problem is what frequency range are we talking about? do we have any idea? Let's just say 10khz is efficient (1hz due to pulse size?)... do you go up to 20khz for the top end of 60hz?

Or are we going to attempt to keep a constant optimized frequency and change the pulse signal amplitude?
ie. for a 10khz signal to emulate a 1Hz signal it would have to send (roughly speaking in purse square waves here) a signal of +20v for 5000 cycles (with some spacing to emulate AC) and -20V (ie. low output) for another 5000 cycles right?


----------



## Evan (Feb 20, 2008)

Ok sorry for repeating your reading. It was not clear to me what part of the method you were stuck on. 

I was wrong earlier V/Hz does use a constant carrier frequency. The carrier frequency is defined as the frequency some signal or signals is modulated on top of. PWM is like AM, FM and all the other modulation schemes it uses a carrier frequency. 

I needed some parts from digikey so I ordered a few smaller IGBT's with them to test my hypothesis on. I have only used them in the past on things like Tesla coils and I didn't worry too much about efficency.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Ok sorry for repeating your reading. It was not clear to me what part of the method you were stuck on.
> 
> I needed some parts from digikey so I ordered a few smaller IGBT's with them to test my hypothesis on. I have only used them in the past on things like Tesla coils and I didn't worry too much about efficency.


Nothing at all to apologize for 

Let me know how those tests go... I'm quite interested to find out whatever you can about this subject.


----------



## JonasMeyer (Feb 28, 2009)

Evan said:


> I was wrong earlier V/Hz does use a constant carrier frequency. The carrier frequency is defined as the frequency some signal or signals is modulated on top of. PWM is like AM, FM and all the other modulation schemes it uses a carrier frequency.


Technologic. The scheme we use for PWM is the same one that a sound card in a computer uses to create notes. The computer encodes all tones as a series of 1s and 0s. Each set of 1s and 0s (called a sample) represents 1/44100th of a second. Therefore, the computer is using a pulse carrier frequency of 44.1KHz. Obviously, however, the sounds we hear are at a much lower frequency. That is because it uses that high 44.1KHz frequency to emulate a lower frequency. To see exactly how this works, I suggest you read up on digital analog convertors. You can also look at this link for a nice graph that shows digital sampling. http://computer.howstuffworks.com/sound-card2.htm

In our case, however, we don't care as much about the fidelity of the waveform, because that is less efficient to amplify. So instead of using an 8 bit sample (which would give us 65535 different output levels to choose from), we use a 1 bit sample, which gives us 2 output levels to choose from.

So there are really 2 things to think about here, and that might be what is confusing you.
1) Sample rate - The amount of time each sample represents.
2) Sample size - The number of different voltage levels we can choose from is 2^n where n is the sample size in bits.

We want a sample size of 1, because H-bridges are most efficient that way. Sample rate is much more difficult to choose from, however.

Evan is right in that we want an IGBT that can fully switch on and off as quickly as possible. That rate is specified in the part data sheet. The highest rate I could find was 100KHz. However, if we use an IGBT rated to 100KHz and use a sample rate of 100KHz, the IGBT will be spending (worst case) most of its time half on and half off, since we could be commanding to do alternating 1s and 0s. That would mean it was never allowed to settle out to a fully on or fully off state before it was on to chasing the next bit we were outputting. That is inefficient. So we want a sample rate that is below the maximum rating for the IGBT.

If we pick a sample rate of 25KHz on an IGBT rated to 100KHz, then it will (again worst case) be spending only 1/4 of the time half on. So that is better from the point of view of the IGBT. From the point of view of IGBT efficiency, a *lower sample rate is better*.

However, the lower the sample rate, the less our outputted waveform will represent the actual sine curve we want to send so that the motor is efficient. So from the point of view of the motor, a *higher sample rate is better*.

Since we obviously have to comprimise here, we have 2 choices. We could hard code a sample rate into our design, or we could make it a user adjustable parameter. I think a user adjustable parameter is better, because then each user could make that comprimise specifically for their particular motor. However, if you make a decision to pair with a specific motor, then a hard coded but easily changable rate is better, since we can optimize it once and leave it.


----------



## Evan (Feb 20, 2008)

JonasMeyer - No the sound card in a computer has much more too it than PWM. The one in mine has a multiplexed 14bit DAC with a few built in hardware codecs. Only the really crappy stuff from like 10 years ago uses just PWM. There is a PWM algorithem used with the DAC but it is a real DAC. I have reused sound cards for other functions so I know it couldn't just be PWM. Also 8 Bit would be 256. 65536 is 16 bit. 

You are right though about excess bandwidth. Normally you would want to tune the design to remove it but in this case it just means that our PWM signal will have sharper edges. The sharper the edge the less heat dissipated.

Edit: As for hard coded values keep in mind any firmware (C, ASM or VHDL) may be done using CORDIC.


----------



## Technologic (Jul 20, 2008)

Evan said:


> The sharper the edge the less heat dissipated.
> 
> Edit: As for hard coded values keep in mind any firmware (C, ASM or VHDL) may be done using CORDIC.


The gate resistors decide to a large degree what these edges of the wave will be and how sharp... 

At any rate I believe I understand what Jonas is suggesting but yeah... still somewhat shaky on what the waveform will actually be for emulation.


----------



## Evan (Feb 20, 2008)

Yes the resistors are a limiting factor but the bigest factor is the limitations of the IGBT it self.

As for the waveform in an ideal world it would be nice pure square edged signal. However, the IGBT's will cause some err unpleasantness.

I still don't have my motor so I am going to use some large inductors I have for now. My short term goal is to make a class D IGBT amplifier making a sine wave on an inductive load. The current involved is a little under 500mA but I plan to make very careful readings for my data.


----------



## david85 (Nov 12, 2007)

long read!

Just wondering if the system voltage, or at least voltage range has been nailed down yet. Are you still planning around 1200VAC?

I still feel something that can still operate down to 144V would make the controller more likely to be used by average DIY'ers.


----------



## JonasMeyer (Feb 28, 2009)

david85 said:


> long read!
> 
> Just wondering if the system voltage, or at least voltage range has been nailed down yet. Are you still planning around 1200VAC?
> 
> I still feel something that can still operate down to 144V would make the controller more likely to be used by average DIY'ers.


I think we've settled on 480v, because it is the highest common voltage for motors. It'll probably work with lesser voltage, and just be less powerful. I don't see any reason why it wouldn't work with a lower voltage, if you could find a motor to work at that frequency that has the right sensors on it. But we are WAY far away from a working controller. Like years away at this rate. In fact, waiting for Tesla roadsters to end up in the junkyard and then ripping out the controller and motor is probably a more practical plan than waiting for this controller. It might never work.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> I think we've settled on 480v, because it is the highest common voltage for motors. It'll probably work with lesser voltage, and just be less powerful. I don't see any reason why it wouldn't work with a lower voltage, if you could find a motor to work at that frequency that has the right sensors on it. But we are WAY far away from a working controller. Like years away at this rate. In fact, waiting for Tesla roadsters to end up in the junkyard and then ripping out the controller and motor is probably a more practical plan than waiting for this controller. It might never work.


Not sure why it would take even 1 year... but to each their cynical self 

Tesla roadsters appearing in junkyards is at least 6 years away... (and about $10-20k even then I'm sure).

I'll pass... and keep working in Eagle  Once I get this schematic nailed down in the next couple weeks you can decide for yourself what you want to do with it, if anything


----------



## david85 (Nov 12, 2007)

Ouch, I think I will give you guys slightly more credit then that. We're still waiting for a pruis to get wrecked let alone a tesla.

The only motor I know of that will run on that high a voltage (other than huge industrial motors) is the siemens motor that metric mind used to carry. Note I said used to. They were surplus motors that have all but sold out by now. Similar motors left over from the ford ranger/UPS mail truck EV program are still floating around though.

As long as it will still overlap with some of the more down to earth voltages (~150) of currently available motors, then it should be fine. Anything below 120V can already use mosfets fairly reliably, so I guess its pointless to aim for that with the IGBT based controller.

The nice thing about a wide operating voltage is that upgrades later on could be made without having to buy a new controller.


----------



## Technologic (Jul 20, 2008)

david85 said:


> Ouch, I think I will give you guys slightly more credit then that. We're still waiting for a pruis to get wrecked let alone a tesla.
> 
> The only motor I know of that will run on that high a voltage (other than huge industrial motors) is the siemens motor that metric mind used to carry. Note I said used to. They were surplus motors that have all but sold out by now. Similar motors left over from the ford ranger/UPS mail truck EV program are still floating around though.


That would be a max voltage for a motor figure david, not really related to what it could run... just what the components can safely run to... all that's needed for less power is minor programming changes (if any really) as the IGBTs function based upon pack voltage etc.



> A long as it will still overlap with some of the more down to earth voltages (~150) of currently available motors, then it should be fine. Anything below 120V can already use mosfets fairly reliably, so I guess its pointless to aim for that with the IGBT based controller.
> 
> The nice thing about a wide operating voltage is that upgrades later on could be made without having to buy a new controller.


I'm sure that'll be fine... at any rate I do have some faith in what I can figure out... just not going to be able to program the MCU interface


----------



## david85 (Nov 12, 2007)

Wish I could help, but my knowledge in electronics is very limited. Basic circuits are no problem, but solid state controls are far beyond my scope (for now).

I might have a car you could put the prototype in


----------



## Evan (Feb 20, 2008)

David85 - I have not seen many 3-Phase AC Induction Motors down at 144V or 150V. The higher the voltage you go the easier it is to get better range because of batteries I think. It is hard to get high AHr rated batteries at lower voltages than it is to get low AHr batteries rated at higher voltages. I don't believe that over rating the voltage up to 1.2KV is really sound but no one seems to agree so I am the lone decenter here.

Power MOSFETs and IGBT overlap in this area but the reality is that the IGBT will win out over both. There are some areas where SCR based designs will win but not in an EV.

Personally I am not going to do a wide voltage range. I am shooting for a more narrow voltage design and a wide current rating. I know this sounds odd but I am not a drag racer and using current to control torque/range is more interesting to me.


----------



## Technologic (Jul 20, 2008)

david85 said:


> Wish I could help, but my knowledge in electronics is very limited. Basic circuits are no problem, but solid state controls are far beyond my scope (for now).
> 
> I might have a car you could put the prototype in


Since if I prototype this and get it working, I don't intend to use it... I don't see any issues with that in theory 

I'll probably just play with it on a scope to figure the parts to give proper square waves and let someone else do all of the UI stuff... since I have no interest in learning programming, though learning more about circuit design is always fun.

In reality I see myself pulling the free code for the MCU off IR's site and using it just to get it running... someone else can mess with it after

And about the 1200v rating... it seems much easier to get IGBTs rated for 1200v and 400amps than to get 600v and 400 amp ones... and the price difference is minimal... so I say why not? My gate driver can do it and it's a cheap part even in 1 quantity


----------



## Evan (Feb 20, 2008)

David85 - You know you could help by doing a DC to DC converter for these guys. No one seems to be doing it. They are going to need something to convert about 500V-450V down to 12V (headlights&etc.) and likely 5V or 3.3V (controller internals). A linear regulator at that point would be out of the question and I have not seen many designs with that kind of rating. But you would have to talk to them about it.

edit : Technologic - You are going to have to do some serious testing with a mechanical dummy load before you just install this in a car. Unless of course David85 has a test track to use.


----------



## Technologic (Jul 20, 2008)

Evan said:


> David85 - You know you could help by doing a DC to DC converter for these guys. No one seems to be doing it. They are going to need something to convert about 500V-450V down to 12V (headlights&etc.) and likely 5V or 3.3V (controller internals). A linear regulator at that point would be out of the question and I have not seen many designs with that kind of rating. But you would have to talk to them about it.


As far as a DC-DC I know how to build one... and there's lots of readily available modules for it from 200v etc down to 12 and 5v. DC-DC in comparison to SVM is a joke, not intending to sound like a prick about it



> edit : Technologic - You are going to have to do some serious testing with a mechanical dummy load before you just install this in a car. Unless of course David85 has a test track to use.


I said this already  I have lots of dummy load resistors laying around from my amplifier days... and your idea of a fan etc sounds fine to me.


----------



## david85 (Nov 12, 2007)

Dummy loads are fine for battery testing, but I'm not sure how much you can really test with a motor controller.


----------



## Technologic (Jul 20, 2008)

david85 said:


> Dummy loads are fine for battery testing, but I'm not sure how much you can really test with a motor controller.


Large resistors on the output allow you to measure wide ranges of outputs from the tester.... and see how the signal changes.


----------



## Evan (Feb 20, 2008)

Actually a guy I know built a test setup for something like this using a box with a water wheel and some plastic tubing. The idea was that the motor would turn the water wheel pumping the water threw the hose and heating it up. This loaded down the motor. So all you had to do was find the heat of the water and volume per unit time to find how much work the motor was doing. At least I think that was how it worked. Clever and dead simple. Many have argued that I make a good dummy load. This is another reason why I am doing a model. Testing is as I mentioned way way back easier and safer. 100HP of water or car moving around is still dangerous. 

You can't use an audio dummy load for testing. It does not have the odd inductive properties that a real motor has under a varying load. I said in the post mechanical dummy load. My model has a flywheel and a hand break from an old bicycle. Since you guys are dead set on starting at 1:1 scale...... Good call David85.

I was just suggesting because David85 wanted to contribute something and it is a shame to waste anyone's time on just waiting to be a tester when they have skills. Honestly before you guys came along I was just doing this a couple days a month for a lark. Now I have people to bounce ideas around with it is displacing my other projects time more.


----------



## golf junkie (Mar 28, 2009)

Technologic said:


> And about the 1200v rating... it seems much easier to get IGBTs rated for 1200v and 400amps than to get 600v and 400 amp ones... and the price difference is minimal... so I say why not? My gate driver can do it and it's a cheap part even in 1 quantity


FWIW, I was reading an App note today that said for a 480v motor you have to use 1200v IGBTs and for 240v motor use 600v IGBTs.


----------



## Evan (Feb 20, 2008)

golf junkie - Yes that is because this is a large signal amplifier. Small signal stuff is rated differently. When you run a part at this scale the heat, shoot threw and things like inductive kick cause the component to break down unless it is massively over rated. 

Please read some of the earlier posts.


----------



## david85 (Nov 12, 2007)

What about powering the controller? My battery can in theory dump 144 KW (144V, 1000 amps) for 15 seconds according to the specs. Constant, it could provide 200 amps. But I guess it depends on what you are designing your controller for (how powerful). With some imagination you could slap a bank of starting batteries together though.

Evan - thanks, but I'm really not sure if I can contribute much in the way of hardware yet. If work picks up again that would have to take priority. Truth is a DC/DC converter is probably a topic for another thread. Agree about the discussion though, this is more satisfying than political threads.


----------



## Technologic (Jul 20, 2008)

Evan said:


> \
> 
> You can't use an audio dummy load for testing. It does not have the odd inductive properties that a real motor has under a varying load. I said in the post mechanical dummy load. My model has a flywheel and a hand break from an old bicycle. Since you guys are dead set on starting at 1:1 scale...... Good call David85.
> 
> I was just suggesting because David85 wanted to contribute something and it is a shame to waste anyone's time on just waiting to be a tester when they have skills. Honestly before you guys came along I was just doing this a couple days a month for a lark. Now I have people to bounce ideas around with it is displacing my other projects time more.


Sorry for being rubber too much 

At any rate a mechanical load is just as fine, it doesn't make a large difference to me... I'm more concerned getting a working schematic down.

David is free to help (of course), however, he said he didn't know much about it ... linear regulators (all you need for such low amperages) should be ok for the job.... few dozen watts of heat doesn't matter much.

480v or 240v ... you still will need to have some DC-DC converter included... and it's easier just to include one for car accessories too I suppose... though I don't know what the average 12v car supply generally draws with everything on.


----------



## Evan (Feb 20, 2008)

Why do I suspect that finding a linear regulator will be hard with that kind of input voltage. For the automotive stuff a DC to DC is a must as it will save power so why not do two?


----------



## Technologic (Jul 20, 2008)

Evan said:


> Why do I suspect that finding a linear regulator will be hard with that kind of input voltage. For the automotive stuff a DC to DC is a must as it will save power so why not do two?


Actually designing such a regulator for the soft controller parts is very very simple (since they only draw about 500mA tops).

They DO make 100-400v to 12v DC-DC converters... metric mind has one

http://www.metricmind.com/data/mes_dcdc.pdf

I don't want to even guess how overpriced he has it for... but w/e

I'm not that concerned about it... you're talking about $10 in parts for something like that (and maybe 8-10 schematic parts)...

Buck converters would be more annoying...


----------



## Evan (Feb 20, 2008)

My point remains we need to design a DC to DC. I did not say higher voltage dc to dc converters did not exist, just really uncommon. Uncommon usually also means expensive.


----------



## aeroscott (Jan 5, 2008)

don't forget 480 volts takes 670 volt battery and 240 volts needs 320 volt battery ( rms thing )


----------



## Evan (Feb 20, 2008)

Dude we are talking about things like IGBT gate input capacitance and you think we haven't considered that motors are rated RMS and the controllers internals and battery are all rated peek to peek? Come on.


----------



## aeroscott (Jan 5, 2008)

in all in posts on voltage it was not mentioned . you guys are coming along very fast . but some reading this either forgot or didn't know . keep up the great work . on standard voltages the next highest I've run across is 575 volt common in Canada . battery needs to be 320 v. for 240 volt output for us lesser enlightened .


----------



## Evan (Feb 20, 2008)

It was assumed that we were dealing with RMS. The output stage calculations are best done in RMS because of the amount of actual heating they involved. I believe I mentioned this in an earlier post. Thanks for weighing in any event.


----------



## aeroscott (Jan 5, 2008)

you are working threw great stuff here . my vote is trod maximum flexibility . as a metal worker,ev'er , solar power enthusiast , boat man , pilot , etc . A flexible power supply is my life long dream . you know as hard as times are , we are living a great dream .


----------



## Evan (Feb 20, 2008)

Well I am currently job hunting so I am currently just building the dream. It will be quite a while before I can actually live it. Yet another reason for my building a model.


----------



## Technologic (Jul 20, 2008)

Okie dokie:

It's taken me a bit to get a working eagle 5.4 downloaded... and I could never get a Pspice that wasn't garbage or a virus so I just am going to use Eagle... it's an intuitive program and quite simple.

I had to hand "draw" and make the PCB pins for these... but you'll be happy to know the PCB layout will be nearly instantaneous to make at this point (just moving wires around)... the rest is taken care of... it's good to do it as you go I reckon... 

http://img25.imageshack.us/img25/7746/part1x.png

By Thursday or so I should have a nearly populated schematic (basically ready for parts selection)... that's all I could draw/make in about 3 hours (the PCB parts are with it).

I'm going to attach the library (for the gate driver and MCK201) for everyone if they need it for PCB layouts. Save yourself about 2 hours.
I'm lucky I can type numbers upwards of 12,000 keys per hour ... otherwise assigning those pins would have taken forever(and doing CAD coordinates for the PCB holes).


----------



## JonasMeyer (Feb 28, 2009)

Technologic said:


> I had to hand "draw" and make the PCB pins for these... but you'll be happy to know the PCB layout will be nearly instantaneous to make at this point (just moving wires around)... the rest is taken care of... it's good to do it as you go I reckon...


This is great! Make sure when you do the actual PCB layout that you space each IGBT well apart from each other so it is easy to attach LARGE heat sinks.

Also, I would vote that each post for DC in and each phase out be at least 12 inches from each other. That will minimize the possibility that someone could drop a screwdriver and kill themselves (or trigger protection).

I would vote that DC in be on the opposite side of the case from AC out, and use different size posts (slightly smaller or larger), which will minimize the chance that someone will be a fool and hook it up wrong.

Lastly, are we going to stick a circuit breaker or fuse in for overcurrent protection? I vote yes.


----------



## Technologic (Jul 20, 2008)

JonasMeyer said:


> This is great! Make sure when you do the actual PCB layout that you space each IGBT well apart from each other so it is easy to attach LARGE heat sinks.


IGBTs are going to be on a totally separate board... the controller board will have hookups and only be the control portion.



> Also, I would vote that each post for DC in and each phase out be at least 12 inches from each other. That will minimize the possibility that someone could drop a screwdriver and kill themselves (or trigger protection).
> 
> I would vote that DC in be on the opposite side of the case from AC out, and use different size posts (slightly smaller or larger), which will minimize the chance that someone will be a fool and hook it up wrong.
> 
> Lastly, are we going to stick a circuit breaker or fuse in for overcurrent protection? I vote yes.


AC out's will assuredly be on the opposite side... I'm not even sure how I'd make them on the same side in the first place.

There will be a fuse in line... actually there will also be fault resistors placed on each IGBT as well, but for now I'm just more concerned with it working.


----------



## Atarijedi (Apr 1, 2009)

Hello all,

I am new to the forums, and I found this thread while searching for ways to run multiple wheel motors.

Anyways, I didn't read ALL of the comments, but I figured I would throw in my 2 cents anyways. I tried to see how you guys were going to generate the sine wave, and I assumed you are just going to make a PWM with a uC and smooth it out with filters. 

2 years ago for one of my classes in college, we learned about DDS', which are direct digital synthesis devices, essentially they are small programmable waveform generators, and are extremely accurate, as much as 0.004Hz, and cheap to boot, only $4!

Analog has one, the AD9833, it goes up to 25MHz and uses 3-wire SPI, so if you wanted multiple channels, it would be easy. Best of all, you can set it at a frequency and it will run on its own as long as it has power, a sort of "cruise control".

I dont think it would be that difficult to set up multiple ones to have multiple phases either.

Just a thought!


----------



## Technologic (Jul 20, 2008)

I'm trying to decide to use an inverting output gate driver (the IR2233S) safely useable to 1200v on the collector, or use 3 seperate high-low output gate drivers such as the IR2213 http://www.irf.com/product-info/datasheets/data/ir2213.pdf

The IR2213 is $8/each in 1 quantity and about $4.50/each in 1000 qtys. It's outputs are in phase with the inputs. How big of a deal is inverting the outputs of the MCK201? I'd imagine such a thing would be right in the code you have to change to make it give the proper frequencies correct?

Another major advantage of the IR2213 is the switching speed and smaller dead time... and it's almost enough for me to write off the much cheaper (and all in 1) IR2233S 3 phase driver.

the IR2233S is a sexy IC though


----------



## Evan (Feb 20, 2008)

AtariJedi - Well we are glad to have another knowledgeable person here. Controlling an induction motor is more than just making a sinewave of a given frequency. The sinewave has to be alatered first to match the motors characteristics and second it has to be dynamically altered to match the motors slip. I don't know that chip might be usefull though if I can get the Space Vector part of SVM running on another chip to go with it.


----------



## Technologic (Jul 20, 2008)

After my classes today I was able to replace the initial inverting gate driver with the same thing but in 3's... there's a few reasons why I chose to do this (namely switching speed is increased as well as the ability to keep leads shorter to the IGBTs... to cut down on inductance).

Each of these gate drivers are $8 in 1 qty on digikey  but samples are readily available from IR:

As far as power supply is concerned I'm not sure yet... seemingly I should make it so at least 240v AC motors can run off it... so people can use lots and lots of different types.

The bootstrap caps and diode information can be found here Evan:
http://www.irf.com/technical-info/designtp/dt98-2.pdf if you need to decide on your own values. It's not exactly an easy thing to perfect, but there's LOTS of leeway in their values... 

Updated schematic:
http://img7.imageshack.us/img7/9178/part1h.png

I should have something more later today, though I'm still amiss as to what the current feedback part of the schematic is doing (the schematic designed for this chip already).

Using the optoisolators suggested by IR I get, but I don't think the guy ever chose resistor values for the current sensing resistors?

At any rate if that's all it is it's fairly simple... I need to get more information what the gatekill pin on the MCK201 actually does...


----------



## Evan (Feb 20, 2008)

I would guess gatekill turns the gates off.


----------



## Technologic (Jul 20, 2008)

Evan said:


> I would guess gatekill turns the gates off.


Well I was originally going to send the gatekill to the Shutdown inputs on the gate drivers (since a gate kill signal would shut down the gate drivers etc) but that's not where the other schematic sends it.

Sends it to the optoisolators he's using as current sensors, which makes no sense to me.

Much of the circuit is simple, but that entire current sensor thing has me stumped at the moment.

At any rate, I emailed IR just to confirm that it does output a signal to shut down the gates etc.

Edit: Once I get the schematic done/mostly done in the next 2-3 days it'll probably be best to move it to another thread.


----------



## Evan (Feb 20, 2008)

Ok I was wrong about gate kill. It was just a guess. I read the data sheet.
"Fault
Input, upon assertion, this negates all six PWM signals, programmable
logic sense"
So if there is a failure of one of the IGBT this signal turns off the buffer between the PWM outputs of the chip and the IGBTs.

You can use optical sensors to measure current. It is a good way to prevent noise prorogation into the low voltage circuits area. 

New thread title suggestions : DIY AC IM Controller 1


----------



## Technologic (Jul 20, 2008)

Evan said:


> Ok I was wrong about gate kill. It was just a guess. I read the data sheet.
> "Fault
> Input, upon assertion, this negates all six PWM signals, programmable
> logic sense"
> ...


I see... makes sense.

At any rate what's your opinion of the CHGO and LPVSS (low pass connections) on the MCK201 DSP. The reason I ask is if we're going to be running 10khz it might be prudent to make a 11khz 18/db octave buttersworth filter on that instead of the simple 6/db octave one used in the other schematic...

At any rate I put in a 6db/octave at 11khz for now.


----------



## Technologic (Jul 20, 2008)

Probably my last update on this today:
http://img5.imageshack.us/img5/2958/part1z.png

Basically everything as far as the ouput stage is concerned is done... likewise with most of the side stuff for the inputs into the DSP.

The encoders, current sensors, ADC and PSU is all that's left...

Which might sound like much, but it's not... I suspect I'll be able to do it in a few hours tomorrow and/or friday

For right now I'm not calculating a lot of the parts since they might change values quite a bit depending on what else changes... Some of them won't change though, which is why there are part values for many of the things that attach to the DSP directly.

I don't like the idea of placing resistors from the VCC to the outputs of the isolators in parallel... seems like any sag will lead to it drawing power through those resistors which is a bad idea I imagine (and probably not a uniform thing, and uniformity across those outputs is ideal).


----------



## aeroscott (Jan 5, 2008)

Evan said:


> AtariJedi - Well we are glad to have another knowledgeable person here. Controlling an induction motor is more than just making a sinewave of a given frequency. The sinewave has to be alatered first to match the motors characteristics and second it has to be dynamically altered to match the motors slip. I don't know that chip might be usefull though if I can get the Space Vector part of SVM running on another chip to go with it.


Evan , mcchip or micro chip makes a svm chip and they have app notes . this is from that contest circut celler mag about 1.5 year ago .


----------



## Technologic (Jul 20, 2008)

Evan/Jonas

I want to clarify something if you are indeed still working on something yourself.
Current sensors... the value of the resistor should be Vt/Ip
Where Vt = the threshold sensing voltage and Ip = the peak current.

So for a 1v of sensing voltage being needed for whatever IC you choose you will need a 0.0016ohm resistor for a peak current of 600A.

Ie. a power dissipation something over 300w of heat... (at least if P= I*I*R is how you calculate that, I assume so). Though since it's AC this could be incorrect (haven't bothered to think about it yet). 

Likewise getting that threshold voltage down is an issue... the sensors will need to be mounted as close as possible to the gate resistor if you want to have a chance. And the threshold voltage needs to be the highest value you can make it over most of the range... however... since we're sending 10khz signal (or something close). You need those current resistors matched to 0.1% or 0.01% if possible... at least it sure will help things. I need to mess with this some more to calc the best values.

You can also boost the sensor voltage being read, but that in itself is another issue... you're talking about scaling up a 1200v max line voltage 

I have solutions for this... but I'm waiting for IR to get back to me about the IR22771 current sensor.

Now onto parts costs.

It is clear to me now even more how absurd it is to see DC controllers over $400 
Firstly the components needed for one price wise is anywhere between 5 and 10 times less than this AC motor controller.

Just the ICs, IGBTs, etc for a 1200v x 600A 3 phase controller are going to run about $300-400 in 1 quantity (that's with cheaper IGBT prices). 2/3rds of that cost can be reduced if making 100 pcs.

Vs. a DC motor controller you could shed maybe the same 2/3s.. but the component cost would be something like 15% as expensive.

The gate driver IC's and such being used to accept and monitor 1200v and current sensors to monitor up to 1200v etc all cost 8-10 times over what the MCU in your average DC controller would cost.

What a freaking joke  Maybe this AC controller is worth $18,000? I think not. Well maybe it is *rolleyes* afterall it could easily power an electric tractor trailer


----------



## Evan (Feb 20, 2008)

airoscott - The microchip parts are not designed specifically for SVM they just have the ability to run microchips SVM code. If we that code we are not really creating something open source because we will be dependant on microchips intillectual property. If we create our own SVM code then it is a different story. Hence why I am trying to work out how to do SVM. The CAN interface was also proprietary. Sadly this means very little of the project was actually open source because the IGBT stuff was just predone modules from some vendor. This actually brings up a good point. If you follow an application note like Technologic is doing where it basically gives you a packaged solution are you the owner of the IP for what you get at the end? If you just want an AC IM controller and you don't care about being open source by all means just build what they outlined it isn't that hard. The only real changes the thing required were proper housing (metal box), DC/DC converter, and proper wireing of the IGBTs. It also needed an optical encoder or something for speed sensing but I think they solved that after the magazine went to print.

Yes the current path Technologic is following will mean our using a chip exclusively from International Rectifier but it would mean that the rest of the machine was known to work. Since we are all working in new terratory the rule is always work with something that is known to half work. So he is working with a known good SVM processor and building an unknown IGBT system. I am working with a known IGBT system (sort of) and an unknown SVM processor. The result is that at some point our stuff will work and we will likely exchange notes at that mid point so we can have two slightly different designs.

Technologic - I read this...
"At any rate what's your opinion of the CHGO and LPVSS (low pass connections) on the MCK201 DSP. The reason I ask is if we're going to be running 10khz it might be prudent to make a 11khz 18/db octave buttersworth filter on that instead of the simple 6/db octave one used in the other schematic..."
Where and in which document are you reading. Sorry but I am not really looking at that chip any more. I got a nice CPLD and am trying to make my own SVM processor now. I am also learning VHDL as I go so this should be interesting (translation: take a long time). 

Thanks for the note about current sensors. I have worked with them before but not at anything near this scale so it is good to know that the math scales.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Where and in which document are you reading. Sorry but I am not really looking at that chip any more.
> 
> I got a nice CPLD and am trying to make my own SVM processor now. I am also learning VHDL as I go so this should be interesting (translation: take a long time).
> 
> Thanks for the note about current sensors. I have worked with them before but not at anything near this scale so it is good to know that the math scales.


http://www.irf.com/product-info/datasheets/data/irmck201.pdf

Those pins the LPVSS and CHGO are the pins for a low pass filter to keep stray signals from getting into the PWM signals.

And your version will probably be cheaper... this isn't the only schematic I'm planning though... I want to go way cheaper than this... this is just the "golden ticket" so to speak... the controller that will hopefully outperform the ACP in every regard


----------



## Evan (Feb 20, 2008)

It will take a while to figure out what the real requirements of the filter are but my first instinct is to follow what IRF says. They know more about how the chip actually functions than we do. 

As for outperforming ACP I doubt ether of us will get that good with our first or second designs. ACP has had over 20 years of this unless I am mistaken.


----------



## Technologic (Jul 20, 2008)

Evan said:


> As for outperforming ACP I doubt ether of us will get that good with our first or second designs. ACP has had over 20 years of this unless I am mistaken.


There are many gauges for performance... I just want it to handle more power 

At any rate I did go with what IR said for now... (well I calced the correct 1st order filter myself based upon their suggestion)


----------



## Technologic (Jul 20, 2008)

Update 4/2:
Here's the new schematic.

This can and will accept voltages up to 1200v on all channels still...

Monitoring phase V and W (named B and C by me) respectively

Interface is through a TI 262 interface chip to allow for serial port connections (just followed the suggested connections for that more or less)... 

In case you are wondering the IR22771 is the only IC for current sensing that can accept upwards of 1200v (at least that I could locate)... The chip takes a sync input, monitors it and outputs it against what voltage it's reading from V- and V+... this is (more or less) the recommended setup for the MCK201 chip.

http://img530.imageshack.us/img530/206/part1.png

Cheers

Just the IC part costs are up to around $70 at this point... (I removed the inverting isolators)

Edit:
Quick note, the Gate drivers and all connected parts to the IGBTs will be on a seperate board... it's also likely that the current sensors will be on the IGBT board as well.


----------



## Evan (Feb 20, 2008)

If I could beat ACP at anything it would be efficency not power. They way I see it who cares about doing better than them at HP I just want more range. The thing is we are limited in that they have custom wound motors. Granted we could wind our own or have them wound but I was never that good at energy conversion to try it.


----------



## Evan (Feb 20, 2008)

I know you have used the MAX232 before but just for kicks if you ever need a 15V refrence those caps are for the chips internal 15V DC/DC converter. It is a little noisy but good.

Edit: I really would have left the isolators in.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Edit: I really would have left the isolators in.


I plan to go back and add them again (ie. they were inverting... I need to source non-inverting isolators).

I've thought of a few ways to cheapen the output stage slightly (going back the original 3 phase gate driver + inverting isolaters since the gate driver was inverting in the first place) without damaging performance, maybe.

But atm I pulled them out... I saved them in it so I can just go and copy/paste them back in (though I can't use them with those gate drivers unless the MCK201's outputs are inverting to begin with).

Likewise I want an isolator that reinverts prior to output... and I wasn't able to find one last night so I just scraped them and will probably redo the output stage with the 3 phase single chip and those isolators (saves about $30 in parts). There are advantages to going with the 3 gate drivers instead of 1... namely lead length to the IGBTs can be much shorter.

I'm OCD about keeping things "tidy" so for now I'm going to be working on getting the encoders/Halls in before reexamining things.


----------



## aeroscott (Jan 5, 2008)

Evan said:


> airoscott - The microchip parts are not designed specifically for SVM they just have the ability to run microchips SVM code. If we that code we are not really creating something open source because we will be dependant on microchips intillectual property. If we create our own SVM code then it is a different story. Hence why I am trying to work out how to do SVM. The CAN interface was also proprietary. Sadly this means very little of the project was actually open source because the IGBT stuff was just predone modules from some vendor. This actually brings up a good point. If you follow an application note like Technologic is doing where it basically gives you a packaged solution are you the owner of the IP for what you get at the end? If you just want an AC IM controller and you don't care about being open source by all means just build what they outlined it isn't that hard. The only real changes the thing required were proper housing (metal box), DC/DC converter, and proper wireing of the IGBTs. It also needed an optical encoder or something for speed sensing but I think they solved that after the magazine went to print.
> 
> Yes the current path Technologic is following will mean our using a chip exclusively from International Rectifier but it would mean that the rest of the machine was known to work. Since we are all working in new terratory the rule is always work with something that is known to half work. So he is working with a known good SVM processor and building an unknown IGBT system. I am working with a known IGBT system (sort of) and an unknown SVM processor. The result is that at some point our stuff will work and we will likely exchange notes at that mid point so we can have two slightly different designs.
> 
> ...


Evan , thanks for your explanation


----------



## Technologic (Jul 20, 2008)

Evan said:


> If we that code we are not really creating something open source because we will be dependant on microchips intillectual property. If we create our own SVM code then it is a different story. Hence why I am trying to work out how to do SVM. The CAN interface was also proprietary. Sadly this means very little of the project was actually open source because the IGBT stuff was just predone modules from some vendor. This actually brings up a good point. If you follow an application note like Technologic is doing where it basically gives you a packaged solution are you the owner of the IP for what you get at the end?


Yes you will be... for lots of reasons, but such cases have gone to court many times.

Because my circuit is following "general" guidelines (ie. component values are calculated by me as is the total layout, safety additions, gate resistor layout etc) it is my intellectual property and I have sole rights to it.

However, what is in datasheets is already unlicensed from my understanding. You are, through purchase of the MCK201, licensing the code from them that's already programmed into it. I'd be highly surprised (and legally doubtful) if they claimed they still owned whatever you put that into. Can TI in application notes show a 2 gate resistor and diode setup and claim no one else can use it? Absolutely not... it's basic theory.

There's numerous reasons why that's not the case... not to mention I don't worry about it. Firstly simply through registry updates you are changing the original code (a must to even get it to work) and secondly as someone who's in law school in the real world, I don't feel particularly threatened by people coming after me in such scare tactics .

At any rate if someone claimed that my schematic was their's... no matter what company, they'd have an impossible time proving that.

Almost nothing in that circuit is pulled from app notes, besides the 33mhz clock... and I'll be happy to swap some values around to bypass their copyrights, if any, they have on that information.

Likewise the final schematic can't be split into parts and people claiming "that was their idea" because in reality everything has been done before. The only copyrightable things are the dynamics of the technique (ie. new methods to achieve some goal) or the schematic itself not to be reproduced. Using a companies IC in the perscribed (or designed) fashion isn't copyrightable. Certainly not towards their customers that's for sure.

This is why companies like TI don't patent every chip they produce, just new techniques used in chips...


----------



## Technologic (Jul 20, 2008)

Oh Evan.

The IR2233S has a current sensor built into the 3 phase gate driver (driving up to 20v as well) for the low price of $12 and readily available.

Here:
http://www.irf.com/product-info/datasheets/data/ir2133.pdf

It's not going to be used in my design (the current sensor), but it certainly is a nice feature if you have 3 sensor inputs (one per phase).


----------



## david85 (Nov 12, 2007)

The low cost of parts is one of the things that really frustrated me once I found out how cheap they are to make. 3 Phase AC motors are also very simple and with copper prices in the pits, not expensive to make......if you knew how or some one that does. I still like BLDC motors, but its hard to beat an AC motor in cost. Performance can be just as good.


----------



## Evan (Feb 20, 2008)

david85 - There are some differences in the efficency of IM verses PM. The thing that gets me is that the weight of the magnets and their increasing rarity.

Keep in mind when UQM started the electronics to drive any AC motor were a very new thing. When ACP started the electronics to drive AC motors had just gotten a lot cheaper but the SVM methods which I suspect were out of question in the 1970's were very expensive to use. I can't help but wonder if the higher cost of these machines is do to legacy desgin expenses.

edit: This is all a lot easier for us than it was for them because they already did it.


----------



## Technologic (Jul 20, 2008)

Last update for the day(edit):
http://img511.imageshack.us/img511/206/part1.png

I swapped in the inverting 3 phase output stage and the inverting optoisolators.

I finally figured out what those resistors were for on the outputs... they didn't have a voltage pull up resistor (usually internal) on the outputs... there's one on the inputs but not on the output.

So after looking at the charts and seeing graphs showing current etc I decided to use the 1k they recommend.

I'll probably be paralleling a lot of additional caps wherever I can fit them near the PSUs... there's good reason to have seemingly no voltage drop long inputs... these are just placeholders for now (and not even the note values... but better)

350ohm gives better distortion results etc... so I might swap it out if I feel comfortable about the input current levels.


----------



## Technologic (Jul 20, 2008)

One last question for tonight and probably most of the day tomorrow: 

Below is the current sensing circuit... as you can see it allows for "roughly" 30mA to pass through to the voltage sensing inputs, I might lower this even more, just not sure really ... all new to me *blushes*

2ndly... the threshold voltage is giving me a slight issue visualizing (this was the thing I was least familiar with several days ago, and my mind always hated KCL etc for lots of reasons), but what is the threshold voltage here?

Say you stuck a 0.001ohm resistor in line with that (which would dissipate something like 250watts of heat at 600A (484Arms) ), what would the threshold sensing voltages be at 1200v... and would they be enough resolution to sense?


----------



## Wirecutter (Jul 26, 2007)

JonasMeyer said:


> I can't tell if you are serious, but the idea is not that one hooks one's stereo to the motor. It would be a dedicated audio signal generator based upon inputs from the accelerator, etc. Anyone have any idea if regeneration could be controlled this way?


Interesting thread. If you implemented "regen" in audio amplification, wouldn't that be like *active noise reduction?* (i.e. my Bose noise cancelling headphones) Of course, it's very location specific, but the ramifications are interesting, especially if you scale it way up. How about a multi-kilowatt sound system next to the train tracks to cancel out all that noise?  

-M


----------



## Evan (Feb 20, 2008)

No active noise reduction actually increases the amount of power used. The idea is to sample the ambient sound wave and electronically invert it and then add it too the audio comming out of the headphones. The idea is that if this can be done fast enougth that it is relative to the speed of sound is instantanious the sound will be canceled.

Edit you know we changed threads this controller design conversation has moved.


----------



## coulombKid (Jan 10, 2009)

JonasMeyer said:


> What is the most expensive part? The IGBT's? The custom one-off engineering? I assume the custom one-off engineering. Thus the open source. Let's all develop it together. Or even better, someone smarter than me develop it and sell them for competitive with DC and we'll all buy them.
> 
> As for the IGBT's, and this is going to reveal the true extent of my ignorance here, it doesn't seem like they are TOO expensive. I found one rated to 400A and 1200V for $131 on google in 30 seconds. I understand they need to be way over-rated to compensate for transient voltage and current spikes, but surely that would do for one channel, right?
> 
> ...


The true audio amp idea is defeated by a electronics principle known as the maximum power transfer theorum. In short, maximum power is transfered when the resistance of the load equals the resistance of the source. Mosfets, IGBTs and so on want to be all on, low resistance, or cut off, infinite resistance. That way their RMS resistance is correct to control the motor while avoiding that very innefficient (heat wise) active forward conducting amplifier state of true analog amplifiers. As long as the PWM sitching frequencies are above 20 Khz we would never know the difference of the source when driving audio devices. Driver current for our power switching devices will be roughly proportional to the drive switching frequency. We need to look for the ideal PWM frequency that minimizes the total waste heat generated in the motor and the drive. The ideal AC drive will monitor the heat in both parts and optimize the frequency accordingly. For a short sprint its no big deal but here in AZ total power output would have to be limited when the ambient hits 120 F.


----------



## Evan (Feb 20, 2008)

This discussion moved to the new thread. Please stop bumping this one.


----------



## Madmac (Mar 14, 2008)

Evan



> Madmac - You are mad give it up you lost the argument. It stopped being a debate and started to be an annoyance quite a while ago. If you have something that works here is an idea post the design.


 Would have responded to your comment earlier, been away on Easter holiday and then a couple of trade shows…business comes first. I much prefer to work away on a project until complete and then post a finished design into the open-source community.

Why not select one of the following assemblies below that I am working on with two collaborators (one doing the mains charging / regen DSP code and the other converting an industrial ACIM to EV use by removing winding lamination assembly from cast iron case and replacing with steel and aluminium water jacket and bearing ends) and I will post some further details, just to keep you happy.

BMS
Second version of BMS (original used ISL9208 for 7 cells per pack) using LTC6802 for 12 serial string (each pack then falls just under the Low Voltage Directive allowing for no special voltage handling requirements, each full assembly is designed to comply) battery monitor and control PCB with charge bypass equalisation, full voltage and temperature monitoring (PCB plus 5 in pack), 20 Watt boost charger for balancing one cell at a time in each pack of 12 (can be used during charging, standby or discharge). In and out connectors for looping BMS bus to next pack. Designed to get maximum life out of battery pack, also works with coulomb counter on High_power_PCB to track charge in and out of batteries for accurate state of charge indication. Intended for Li-ion but can be used with any chemistry where the cell voltage is less than 5 volts. Typical ACIM system would use 8 (8 x 12 x 3.6 = 345 Volts) or 9 (9 x 12 x 3.2 = 345 Volts) packs depending on battery technology. Max of 14 BMS boards in a system.
STATUS 
circuit – complete 
PCB layout – complete (prototype errors / mods need correcting)
firmware – complete
hardware – complete and working (with couple of small mods)


Non Isolated 3KW charger
Have initial design to work with house keeping CPU and BMS. May be needed for testing system before built in 6KW charger DSP code is ready. Will try and avoid having to build.
STATUS 
circuit – complete (not tested)
PCB layout – 
firmware – 
hardware - 



High_Power_PCB
Interfaces to IGBT pack (mounts on it) and carries current and voltage sensors, coulomb counter, high voltage power supply, reconfigures IGBT pack to act as 6KW charger, charging interface, precharge relay and contactor, brake resistor and driver, all interfaces isolated to control PCB (could easily be increased to 15KW charger)
STATUS 
circuit – 100% waiting to confirm design of charger section
PCB layout – yet to do
firmware – na (not applicable)
hardware – charger section built to test with firmware



Control PCB
Controls the whole system with a 8051 derivative device (C8051F022), BMS Bus interface, high_power_PCB interface, DSPic motor control (based on Microchip App Note), safety (check throttle before powering up, check stationary before reverse, limit max reverse speed etc), low volt power supplies, real time clock (to schedule charging or heating before use in winter), USB interface to PC, Accelerometer for accident shut down / performance monitor, can power up PC to connect on WiFi or cell modem to report problems (or tracking if vehicle stolen). All control electronics isolated from traction pack voltage
STATUS 
circuit – several areas still to do, mainly charger control and lockout
PCB layout – yet to do
firmware – RTOS /BMS / USB/PC interface/ boot loader complete running on CPU evaluation PCB
hardware – prototype PCB for DSP to work on 6KW charger firmware complete and working


DC to DC PCB
Runs off traction pack and provides 13.8 volts at 70 Amps for running car electrics. Part of commercial product, needs external control and isolated power supply (on High_power_PCB). All interface connections worked out. PCB can be bought as a spare part.
STATUS 
circuit – complete
PCB – bought in
firmware – na
hardware – complete and working


LED Stop Light / Message PCB
LED matrix display that interfaces to BMS bus and during driving acts as high level brake light and during charging displays status. For example charging away from home will flash if power is removed before charging complete to allow monitoring from distance.
STATUS 
circuit – complete
PCB – prototype layout errors need correcting
firmware – complete
hardware – prototype complete and working


PC System
Low power ( target of 30 watts) PC system with freeware Road Runner software to provide graphical interface for battery monitoring as well as MP3 and video playback, GPS, ability to remotely monitor / control charging, heating / aircon control, etc. With addition of cell phone modem can send SMS messages of car status, for example if car is disconnected midway thru charging. Do a search, posted a photo of software interfaced to first version of BMS last year. I use a slightly modified DigitalFx skin, see http://www.mp3car.com/vbulletin/rr-skins/117143-digitalfx-4-0-released-07-25-08-a.html many thanks to Gino (RoadRunner) and JohnWPB (DigitalFx) for all their hard work and support of open-source software for PERSONAL use.
STATUS 
circuit – na
PCB – commercial products
software – VB plug in for BMS working, other software to finish
hardware – already run similar systems in current IC cars


----------



## Madmac (Mar 14, 2008)

After posting details of the control electronics for my conversion I thought there may be some interest in the cost of the various assemblies. The following is current price of system components excluding batteries, cases, cables, heat sinks, motor etc

$880 ......8 off 12 battery BMS PCB’s, Including connectors etc. $110 each
$700* ....IGBT / Contactor / Precharge/ High volt PSU / Coulomb counter PCB
$58 .......current shunt
$150* ....Control PCB with PC PSU / Housekeeping CPU / DSP / USB to PC / etc
$134 .... Added components for mains input charger, filter connector interlock etc
$120 .....DC to DC 13.8 Volt at 70 Amps, part of commercial product bought as spare
$43 ......12V mains switch mode, powers system electronics during mains charging
$86 ......LED stop light / message display
$93 ......Intel Atom MiniATX 1.6Ghz PC motherboard
$180 ....7” Touch LCD monitor 
$53 .....160Gb 2.5 inch hard drive
$19 .....Memory SIM
$2516 Total

* These items may change slightly as the design is finalised.


Note this is small quantity component pricing, includes cost of PCB’s but does not include cost of assembly, if you do it yourself then there is no cost. All PCB’s designed to be hand assembled, they use no parts smaller than 0805 passives. Soldering some IC’s used in this project does require a bit of skill and practice.


----------



## Bingo Sun Noon (Mar 13, 2009)

Hi Everyone
I watch these posts and wonder what is going on. While it is no easy task to build a controller, and I've built quite a number of them, some issues seem to be on everyone's mind. 
Number one is how to build a "cheap controller". Yes it is possible to build a controller for fifty dollars in parts. I often get asked to build controllers for club members who are too cheap to buy one.
I quote a price that includes a small portion of what I paid in tuition at Arizona State. Naturally, the price is too high. If you can't look at a scope and puzzle out what needs to be done, then just accept the fact that you will buy a device from someone like me. It is no trivial task to build a switcher to control a motor that delivers any substantial power. 
The original idea of using a sound card to control a motor is really stupid. If you want to learn controllers, then start with wheelchairs. Linear pots controlling PM motors is as easy as it gets.
Bingo


----------



## Evan (Feb 20, 2008)

Two things to both you and madmac. 

1. This discussion has moved to a new thread.
2. While input is appreciated we are going our own way.

Bingo Sun Moon - Yes a sound card is a bad idea.

Madmac - Quit trying to grab the last word from people.


----------



## Technologic (Jul 20, 2008)

Please include all new information in the other thread... I almost have my PSU designed, so pay attention in the next week as I'll be basically ready to build after that (and a linear ramp for throttle)


----------



## Madmac (Mar 14, 2008)

Bingo



> I watch these posts and wonder what is going on


You are looking at the posts the wrong way. The latter part of this thread and the spin off provide great amusement.


Evan

Prior to the last 5 years I spent 17 working as a free lance designer contracted by over 50 companies, multinational to small, in that time specialising in trouble shooting designs. 

The most common reason for projects running late and over budget was management hiring a bunch of graduates to save money and expecting them then to understand the details of complex designs. The second reason was poor engineers thumbing thru catalogues and buying the most expensive or high spec parts thinking that will make everything work, then sticking it in an over designed box.

Technologic has trained in another field and is beginning to have an understanding of what he is learning and can be excused lacking knowledge in some areas of electronics.


----------



## Evan (Feb 20, 2008)

madmac - 1. Dude OTHER TREAD. 2. When did I ever critisize Technologic?


----------



## Madmac (Mar 14, 2008)

> madmac - 1. Dude OTHER TREAD. 2. When did I ever critisize Technologic?



Your spelling is as good as your understanding. You are the one who has supposedly done an engineering course.


----------



## Evan (Feb 20, 2008)

Yes I miss typed but for the third time please POST TO THE NEW THREAD.
I may only have a BS but atleast I am not full of it.


----------



## Technologic (Jul 20, 2008)

Evan said:


> Yes I miss typed but for the third time please POST TO THE NEW THREAD.


I don't even know what's going on in here


----------



## brdriver (May 26, 2009)

your idea is very good,but it is not easy be implement.bacause its costly of material is over $3000.you can calculate its power control of AC driver.it is a low-rise voltage machine and frequency change machine.another its feature panel is a center control of MCU,at least possess 32bitKB,and have a large memory to store data of running.hehe..
you can calculate what is its component.
don't think the solution of control EV,it is suit to a toy with less than $1000.ok?
hope you know Bangrong technology's product.maybe you will have new find on EVenterprise.hehe

best regards!



JonasMeyer said:


> So it sounds like you could do it, but you'd need to utilize microphone inputs and shunts to get feedback back from the motor for regen.
> 
> So the basic idea is this. Signal generator is an open source piece of software running on a ruggedized laptop permanently mounted in the car. It takes input from the driver, probably through the form of a set of USB pedals used in video games.
> 
> ...


----------



## brdriver (May 26, 2009)

hehe...
let me learn from you!
your solutiuon is a bldc controller on direct driving two wheel,if so,you would think its speed is differience on swerving.if you let it continuous last speed to run,it will meet risk of to turn over.understand?
please think it again!

if you can know Bangrong technology's product,maybe you will know more EV control methods.ok?

Best regards!



Bingo Sun Noon said:


> Hi
> I built a BLDC controller for a 2 phase hub motor I built for a motorcycle. It is no trivial task. What is your skills level as an electronic tech? Can you use an oscilloscope? It took me many months to get mine to work and I work in the industry as an engineer. Be careful about making this sound too easy. 100 watts pretty easy, 10,000 watts, watch out.


----------



## brdriver (May 26, 2009)

let me tell all:
controller is the most of expense on diy EV.because all solution is transfer battery power to drive mechanical power,althoungh the motor is use more metal material,but it is not valuable.only the controller is possess 30% cost of all base on its IGBT and heat sink piece.engineering is only a little.
anthone,recent year, USA army's vehicle use a new solution,all people almost know it.that is new type BLDC control system.the kind controller and its complete solution component costly is lower than AC control system on general application .
and Bnagrong technology enterprise have early created out the solution on personal application,you can look at its web through search for it.

best regards!



JonasMeyer said:


> What is the most expensive part? The IGBT's? The custom one-off engineering? I assume the custom one-off engineering. Thus the open source. Let's all develop it together. Or even better, someone smarter than me develop it and sell them for competitive with DC and we'll all buy them.
> 
> As for the IGBT's, and this is going to reveal the true extent of my ignorance here, it doesn't seem like they are TOO expensive. I found one rated to 400A and 1200V for $131 on google in 30 seconds. I understand they need to be way over-rated to compensate for transient voltage and current spikes, but surely that would do for one channel, right?
> 
> ...


----------



## brdriver (May 26, 2009)

dear brother:
you can give up the AC drive solution,please land the www.brdriver.cn, then you will know more solution.at moment many EV factory have applied BLDC system,and its costly is lowe,fixing is simply, and suit personal application.

successfully to you!
best regards! 



Technologic said:


> No it wouldn't... not 400A... at least not for your average 2500lb EV.
> Of course you can find them for a lot cheaper than $131 each.
> 
> Realistically something like a 600A 600v IGBT for each channel (in this case one channeL) will be fine... Since you're doing a AC drive motor (again I don't know enough about AC motors to help on what they need outside of just straight AC power).
> ...


----------

