![]() |
Paul & Sabrina's cheap DIY 144v motor controller
(ADMIN NOTE:
This thread is very long, but LOADED with all sorts of great information. To skip straight to some of the end results of all the hard work of Paul and others, please visit the WIKI on this project, located at: http://ecomodder.com/wiki/index.php/ReVolt ) There are 3 basic parts to an electric car: Motor Controller Batteries Motor Freeway capable EVs are more expensive than slow EVs because you need more batteries (sometimes: could use buddy pairs at lower voltage) and a high voltage controller. The same motor can often still be used, just by advancing the brushes, and maybe adding a blower to keep it cool. So, it seems to me that the best place to focus efforts to making freeway capable EVs more affordable (under $1500?), is to focus on the controller. About $1200 or so can be shaved off the cost of a new controller. So, here's my plan: First, I'll make a smaller controller. I plan on it being 72v 40amp. Then, I'll try to scale it up. I'll test the smaller controller on my ebike, which has a brushed dc motor. Today, I ordered most of the components and tools needed to make the bike controller. As they come, I'll take pictures of the things and the process. I'll try to get the bike controller done before school starts in January. Some of the more important parts I ordered include: 50 MHz two channel oscilloscope Ten IRFB4110 mosfets IXDD414PI mosfet gate driver Five STTH6002CW freewheel diodes Atmel STK500 ATMega8 microcontroller 7.5 to 76V in, 5V out DC-DC 7.5 to 76v in, 12v out DC-DC Twelve TS-ED 200v 470uF Panasonic Capacitors |
So, how do you make a controller?
The microcontroller (ATMega8 in my case) can generate pulse width modulation (PWM) signals. So, it listens to the throttle, and then sends a PWM signal to the mosfets' gate driver. The gate driver amplifies it a bit. The gate driver's job is to turn the mosfets on and off according to the PWM signal. Then, the mosfets massively amplify the PWM signal. That signal is sent to the motor, and you drive down the road. That's it! The microcontroller can also monitor things like battery pack voltage, temperature, or whatever you want! |
Very interesting! I'm all ears on this one.
|
I think for the car's version, the controller will be powered by the auxiliary 12v battery, or by some other 12v source, rather than by the full pack voltage. However, the pack voltage ground will still not share a ground with the 12v battery, unlike in Kelly Controllers (aahh!).
The cost of components is about the same, but there are several advantages: First, have you noticed that controllers say things like 48v-72v, 84v-120v, etc... That's because inside the controller is a DC-DC converter to step down the voltage, and it has a limited input range. So instead, my controller will have an available pack voltage input of 12v to 156v or something like that. As long as it stays clear of 200v, it will be fine, since I'll be using 200v mosfets. Second, you can have the controller take care of pre-charging it's own resistors, rather than having that be something external. Third, the high voltage input dc-dc converter has quite a few extra external components needed to make sure it will function properly. The 12v-12v option doesn't have any, so it's much simpler. This represents 6 hours of Saturday research. My eyes hurt. good bye! |
Quote:
|
Some Thoughts...
Wow. You're really gonna make this happen, aren't you?!?!
Some thoughts on all this: 1) Can you say "Patent"? You should learn to, if you can't... This sounds a whole lot more interesting that trying to explain "2x=6" to a bunch of smart-mouths who don't care! 2) I'm more than all ears on this one. I'll be all eyes on the emails for replies to this thread, too. 3) This looks to end up being a controller and pack voltage indicator in one. Way Cool! :cool: 4) Will you be selling your version 1.0 controllers cheap when you get to 2.0??? :D |
First draft schematic
1 Attachment(s)
Hey, Intrigued, if only teachers could whoop students as if they were a red-headed step child, I would teach for free. If you are going to be excited about each post, I'll have to really make sure I actually have something interesting to report!
This is a modified version of Ian's "speedy" controller. His was for a 24v trolley. This version is 72v, and powers the mosfets and the micro-controller with the 12v auxiliary battery (that powers the lights and blinkers and other stuff). It doesn't share a common ground with the battery pack. Notice that the PWM output from the ATMega8 is the PWM input into the gate driver. The driver amplifies the PWM signal, and then opens the floodgates of all the mosfets at the same time! By the way, if you have ever wondered why a pre-charge resistor is important, it's because there are TONS of huge capacitors inside the controller! They don't like to be short circuited! OOH, so we need just a little more stuff inside that schematic to have it pre-charge when the 12v battery power is applied. |
Quote:
Quote:
Whew! <wipes forehead...> I finally got a decent handle on EV range vs. battery technology, and now I understand "flux capacitors"!!! (That's from somewhere in Darin's thread, I think...;)) Now it's on to the rest of the pieces parts. Maybe in 20 years or so I'll have everything figured out in my "gotta-understand-it-thoroughly-or-too-chicken-to-try" brain, and I can do it all by my lonesome!!! :D (Thanks, MPaul!) |
Some things came today!
5 Attachment(s)
So far, the big capacitors, mosfet drivers, little itty bitty MLCC (multi-layer ceramic chip) capacitors, and the awesome mosfets came today. The oscilloscope is in the mail. I also got some sheet metal and wrist strap to make a static free workbench in the garage. Great news! I get to solder those MLCC's!!!! What the heck?
|
What are you using for current limiting? I too am working on a controller but won't get to it until classes are over. I am using a PIC controller, hall effect current sensor and 100 volt MOSFETs for my prototypes. I am working on a modular controller that will be limited to 60 AMPs, but be able to connected in parallel for more juice.
|
Quote:
|
hall effect sensor
Quote:
For the car, I'm going to use an off the shelf hall effect sensor. It's like $16 I think. It can read up to 600 amps. Possible Choice for Hall Effect Current Sensor That sounds like an awesome project you are doing! I hope you keep me updated. I like the idea of having modules that can attach to increase the max amps. That sounds very interesting! |
4 Attachment(s)
Quote:
The table is grounded through a 1 megaOhm resistor to the ground pin of an outlet. |
3 Attachment(s)
Today was pretty productive. First, it snowed a whole bunch! It doesn't snow that much around here, so it's been really cool. It's late now, and the sky is bright pink. Weird!
The EVTech list has been really, really helpful. For the car's version of the controller, 4 ounce copper pcb is required. That stuff is sort of hard to come by at your local radio shack. What it means is that every square foot of the pcb (printed circuit board) has 4 ounces of pure copper on it. That's a lot! Someone on the EVTech list is sending my wife and me 2 pcb's of 5 OUNCE copper for free!!! That's thick! The bike version of the controller will be able to handle around 40 amps. So, there has to be a copper bus on which all the current flows. Each mosfet will contribute about 8 - 10 amps to the bus. Such a high current requires pretty heavy copper. I'm thinking of using 10 gauge wire for the bus. So, here's the rub. How do you solder a lead (leed) from a mosfet to such a heavy wire that will be about 6 or 7 inches long? Try it! Take a soldering iron and try it! It's tough. The dang wire won't heat up enough. So, 2 days and many EVTech.org conversations and reading and trying several things that don't work led to an awesome solution! But that's for another update... I just heard the doorbell ring... HOLD EVERYTHING!!! WHO COULD BE VISITING IN THIS SNOW STORM? ONLY THE UPS MAN!!!!!!!!! That's right! The programmer and 2 microcontrollers (atmega8) just arrived! heck ya dude! This is where things get interesting... Oh no! It's a static sensitive device? I need a static free workstation! Hmm... What to do? hahaha! |
Quote:
...or am I missing something here... :confused: |
You're not missing anything! Want to know something funny? Lee Hart, the Godfather of Electric vehicles on the EVDL and the EV Tech list suggested something close to what you just said. You know what, I think your idea is maybe better than what I was going to do. There are a few things to deal with, like the bolt heads hitting the pcb underneath the copper bars, but that's not so bad. It can be worked around I think!
Edit: Well, maybe I'll save that way for the car, because I don't need that much copper for the bike version. hmm... Sometimes you get going in one direction, and you need someone to come along and throw in a little common sense! Thanks, Intrigued! |
You're welcome! :thumbup:
Although I'm not so sure about the common sense part... I just took 4 times to log in, because I had my stupid "Caps Lock" on... :D |
STK500 operational!
5 Attachment(s)
programmed the micro-controller (after some difficulty getting everything plugged in right! ANGER!) with a program that lets you see some LED's so I could actually tell that it worked. It worked! Unfortunately, the program needed to run a motor controller doesn't really make it easy to see that it's working. I need a dang throttle, and a bunch of electrical components, and just build the left half of the motor controller itself (most of the low power side in the schematic above) just to test the stupid program!
So, I programmed the ATMEGA8 with the motor controller program, on faith, trusting that it's all good. Now I need to build a prototype of the low power half of the controller. No mosfets on this version. Basically, I'm going to be "driving" an LED (baby motor! hehe). Now, this LED will get brighter and dimmer through PWM. I guess I'm making 3 motor controllers, a WEENIE BABY LED 5v 0.01amp "motor controller", a medium 72v 40amp bike controller, and a monstrous 144v 400amp (500? 600???) car motor controller! Hold me back, hold me back! I have to go to Sylvan really soon, and it's super stormy and snowy! Man, I wish I had more time! The pictures show the STK500 with the ATMega8 micro-controller plugged in (ready to receive it's motor control program), and various screen shots, including showing that it has been successfully programmed! Hurray! "Time is the fire in which we burn!" (some guy on like Star Trek 8 or something, when Captain Kirk got stuck in the Nexus with Whoopi Goldberg and Captain Picard) |
ooooooOOOOOOoooohhh! (Like that bunch of alien toys on Toy Story)
I see a possible sideline for MPaul Enterprises, here... not only building controllers, but tweaking the programming on all of your buddies' computers in their cars, so that they get even better gas mileage!!! <You have saved us from the evil Fuel Lord. We are forever in your debt!> (us) :D (you) :eek: |
Great work Paul!!! Looking forward to more updates.
|
I don't even have an EV and I find this facinating :D. I would think that you could mass produce these for a bunch of people on this forum ;).
Just kidding, though the instructions are in depth enough that once this is working, you may have something that goes mainstream! Good luck! |
1 Attachment(s)
Thanks! I've been thinking that a highly modularized kit (not lots of skill needed to assemble, maybe just time) might be good. Once a program is written and works well for the controller, the ATMega8 chips are only about $1 each, and the STK500 programmer takes less than a second to program the chip, and software is free, but don't tell Microsoft that. Maybe if I assembled a bunch of logic boards (the low power half), and cut the bus bars (the heavy copper B-, B+, and M-) for the controller, and etched the heavy 4 ounce (per square foot) copper PCB that will be bolted to those bars, and maybe soldered the mosfets and capacitors to the heavy board, the rest would be maybe a couple hours of work assembling that someone without a lot of tools could do?
Update: Some anger! I programmed the chip, built the low power half of the circuit, and the dang LED didn't come on! It's hard to use a $2.99 volt meter to measure voltages that are going from 0 to 5 volts thousands of times a second. My oscilloscope will probably be here really soon, since the probes and power cord came yesterday! I need that thing to see what's going on! Update 2: I found a mistake in the assembly of the circuit. I hope this fixes the problem. |
Baby motor controller (5v 0.01amp) completed!
4 Attachment(s)
There were more than a few mistakes in both the circuit AND the program! It took HOURS to fix them all. ANGER! My beautiful oscilloscope came today. No plug that fit, but I had a spare computer plug that fit. With it, I could enter the world that I had been blind to until now.
So, I hooked up a throttle, and could control my pwm signal. Next, I need to send the pwm signal to a driver to amplify it, and then use the driver to turn on a few mosfets. Next step, 72v 40amp bike controller! Hold me back! Hold me back! The picture of the oscilloscope with the green lines shows the pwm. It was about 80% of full throttle. I think I'll install this version in my car and see what sort of acceleration I get. I'm guessing about the same as the forkenswift. :turtle: |
Ouch! Someone who lives close to Darin go over and pull that knife out of his back. I could feel that all the way from here... :D
|
I'm sensing an EcoModder Open Source Car Project™ coming on here.....
Paul, maybe you wanted to keep around the "baby PWM driver". You could put it on your dashboard so that as you spin the engine up and down, the LEDs get brighter to indicate your power. Might be a cool motor indicator! |
Anger! (So much anger in this thread...)
No, no, that's OK. You guys can have your copious extravagant power. And your acceleration. And your breaking of things from said power. Nya, nya. |
Quote:
Soon, we'll all be saying it: "You have saved us from the Evil Fuel Lords. We are forever in your debt!" :turtle: |
Us 72V electric cars are pretty furious!
Whatever I brake, I just have to rebuild stronger! http://gallery.me.com/benhdvideoguy/...C_0321/web.jpg |
Re-build the parts until they stop breaking for a month. Then mass produce the sucker. That's how the Big 3 does it... oh yeah... never mind :D.
|
Program with step by step instructions
1 Attachment(s)
Hello! OK, so I have carefully tested the small controller, and watched the results on the oscilloscope. Finally, the software appears to be without any errors, and is much simpler and easier to read now. I think I'll run the bike controller at 4kHz. It may irritate dogs in the neighborhood, but it will keep switching losses down, and it's just a first draft. Well, second draft if you count the 5v 0.01amp one.
To compile this program, download the FREE Atmel AVR Studio! Atmel AVR Studio To compile the program, change the file name to end with .c instead of .txt It wouldn't let me upload it here unless it was in ".txt" format. There are a lot of page references in PWMAndInputTest.txt. They refer to the PDF of the documentation for the ATMega8. It can be found HERE! Also, the code assumes you are using the PDIP version of the chip (28 pin version). |
// GOOD Programmer! Good Boy!
// Leaves lots of notes, if for no other reason, to remind himself // ...of what the heck that all was... // 2 years later when have forgotten... :D |
LOL intrigued... I learned a long time ago, to leave plenty of notes, even in HTML... if nothing else, it helps other people using your de-compiled stuff to learn.
MPaulHolmes - Subscribed - Better late than never? LOL. I'm quite interested to see where this goes as I lean more and more toward converting my CR-X to an EV. |
I just had a peak at your schematic and read up on the IXDD414. I would like to HIGHLY recommend that you have some sort of fail-safe switch attached to the enable line instead of tieing it high. You could put it on the dash as the "start" switch.
Also, i don't know if you've done this because i didn't read the code... I would highly recommend that you use a watchdog timer that will put the chip into a reset state where the pwm line is driving the mosfets off. I'm a computer engineer... i write embedded code for a living and i spend a lot of time dealing with the hardware for which i write code (i've got a pile of boards on my desk right now that i'm testing). I will definately follow your thread and see what you're up to and make little inputs where i can. Be sure to post anything that is puzzling you or any little ideas that you'd like expanded. Cheers, and good luck. |
Quote:
Since the Sudden Stop at the bottom of that fall that put me in this cursed wheeled conveyance, I have been going through my "second college-hood." Guess what one of the first things was I studied? COBOL! Even 9 years ago nearly a third of what was coming out in the business world was in COBOL for use in AS-400s and other midrange-to-mainframe computing-type contraptions. Now that I'm close to my Bachelor's degree (Business) there's not much use for it anymore, but if I can figure out how to live until Y2.1K, I could sure help in reprogramming all of the old-timers - again! :eek: EDIT: Wait a minute... ARPANET IN '69, TCP/IP first written in '74. Maybe it wasn't before he invented the internet... |
Quote:
I think I was just going to add a thermistor right next to the mosfets, and monitor that in the software. The idea was that their case temperature would not be allowed to get above a pre-determined safe amount. As it got closer to that max temp, I'll ramp down the duty cycle all the way to 0. Since the input pin is wired to ground through a resistor, the mosfets would be shut off that way instead. My Analog to digital converter is going at about 125,000 samples per second, so I thought that would be quick enough for monitoring temperature increases. This brings up a question I have. The maximum sample rate of the A/D Converter is like 4 MHz, but the ATMega8 documentation says the conversions are the most accurate with no more than 200,000 sample/sec. It doesn't say how inaccurate it gets the faster it goes, so I've limited mine. Quote:
Quote:
|
Hehe... don't confuse "educated and working" with "expert" :D
I will be proud to help this project in any way i can. You have accomplished an amazing amount without any embedded systems/electrical engineering background. Good work! Quite frankly, you don't need to sample the A/D converter that fast... 100Hz would be fine. Watchdog timer was an obscure concept when i started this stuff. It is actually quite simple. You enable it, then it counts down till it expires and resets the chip. The idea is that your code will regularly reset the timer so that the chip doesn't reset. If ever your program hangs due to an unforseen bug (it happens to the best!) your system resets and you carry on with life. Ideally, a watchdog reset would be followed by an immediate shutdown of the motors. In my reading, the big risk with DC motors is the ability to run away at full throttle if your control goofs up. I'd do as much as possible to ensure that this doesn't happen... just keep it in mind, don't hang up your project on it. |
video!
Our first video of the motor controller
Oh ya! We have thermal shutdown (until it cools) now as a feature. |
Nice video.
I almost did a spit-take when you pulled out the hair dryer to test the thermal shutdown. I think that's the exact same thing I would have done! |
1 Attachment(s)
That hair dryer was right out of the Ben Nelson playbook. Remember the coffee can brakes? hehe!
I attached the (once again) revised version of the program, with the thermal shutdown included. EDIT: I ordered a hall effect current sensor. I wasn't going to, because I don't think we need one in this case. However, current limiting is critical with EV controllers, so maybe we'll do it for practice. |
Yay! The hair dryer saved the Muppets! Or something.
|
All times are GMT -4. The time now is 01:38 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com