Go Back   EcoModder Forum > EcoModding > Fossil Fuel Free > Open ReVolt: open source DC motor controller
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 06-07-2009, 01:46 AM   #1601 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,368
Thanked 1,202 Times in 765 Posts
Hey squiggles! You little Devil ('s advocate!) hehe. I am really really grateful for your analysis. You are right about the while loops. They have all been eliminated. Everything is done with interrupts now. We need to upload a newer version of the software to the wiki..

I'll pass along your suggestion about the layout possibly diminishing the isolation to the engineer that's doing the testing of the control section in the lab. Thank you for raising that concern!

timer1 is initialized in the function InitPWM();

The NAND gate circuit is responsible for automatic overcurrent shutdown. It's a little tricky, but here it goes!

First, here's the overcurrent protection circuit, taken out of the main circuit:


I'm calling high signals 1 and low signals 0. This is the sequence of events -

I. IF CURRENT OVERFLOW SUDDENLY HAPPENS
1) R_BAR: 1 ---> 0
2) S_BAR: 1 ---> 1
3) Q: ??? ---> 0
4) Q_BAR: ??? ---> 1
5) PWM output to gate driver: ??? ---> 0

Because the TRIP_STATE (which is Q_BAR) is now 1, the microcontroller now knows that the mosfet driver has been disabled. I can re-enable the driver at my leisure.

II. IF YOU CLEAR S_BAR (TRIP_RESET)
1) S_BAR: 1 ---> 0
2) Q_BAR: 1 ---> 0
3) Q: 0 ---> 1
4) R_BAR: 1 // if R_BAR is back to 1, all is well, so let's pretend that.
5) PWM output to gate driver is still 0!

III. IF YOU THEN SET S_BAR (TRIP_RESET)
1) S_BAR: 0 ---> 1
2) R_BAR: 1 // LET'S PRETEND
3) PWM output to gate driver is now 1! Hurray, finally we have power!
///////////////////////////////////////////////////////////////////////////////////
Delay(uSecond) would be way better. I agree.

BY THE WAY, THE OVERCURRENT CIRCUIT HAS BEEN MODIFIED SINCE THE MOSFET DRIVER IS NOW THE INVERTING TYPE. That circuit above was for the original controller (version 1).

__________________
kits and boards

Last edited by MPaulHolmes; 06-07-2009 at 03:46 PM..
  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 06-07-2009, 03:03 AM   #1602 (permalink)
EcoModding Apprentice
 
Join Date: May 2009
Location: Australia
Posts: 109
Thanks: 0
Thanked 2 Times in 2 Posts
Gate circuit drawn and described like that make sense.
Funny but I would not of thought of including it, would have done it all with the micro. It occurs to me that you have added another level of security as this will work even with a hung processor. Very nice.

Hmm, just had another thought, the over current protection will be a bit instant. Maybe a good thing, can't think of any real downside. Is it self resetting...no. Is there a circumstance where a short time over-current condition is acceptable ... I guess not better to be safe than sorry. All good.
  Reply With Quote
Old 06-07-2009, 03:59 AM   #1603 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,368
Thanked 1,202 Times in 765 Posts
Yes, the hardware overcurrent shutdown happens in maybe 3 or 4 uS. In theory, with a well tuned PI loop, the overcurrent shutdown may never have to come on, but it's there as a last line of defense. Also, it lets you tune the pi loop without worrying about destroying the mosfets.
__________________
kits and boards
  Reply With Quote
Old 06-07-2009, 02:42 PM   #1604 (permalink)
EcoModding Apprentice
 
Join Date: Feb 2009
Location: UK
Posts: 162
Thanks: 2
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by MPaulHolmes View Post
Yes. I used it to run my electric bike hub motor. Well, with 200v components, you don't want to go much over 144v, since when the pack is full, it's quite a bit higher than 144v. You do need a 12v auxiliary battery for the controller though. The control section uses less than 5 watts, so you could even use the last battery (connected to ground) in your series string to power it, and it's such a puny power requirement that I don't think it would get too out of balance, but I don't know.
...
That. Is. Awesome.

For my idea, id need the 12v auxiliary anyway..
  Reply With Quote
Old 06-07-2009, 03:18 PM   #1605 (permalink)
EcoModding Lurker
 
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Great work by everybody so far, especially Paul! Very inspirational.
Looking at the schematics, it looks like the unused IO pins on the microcontroller don't go anywhere. If that is true, would it be possible to have those unused pins going to a pad? I think that would make it easier for people to extend the controller in the future by adding their own features (the beauty of open source!). One idea I had for an extension was an anti-theft feature. Maybe different features could be enabled by jumpering some of the unused pins high, which the end user could easily do if the pins were available on the controller board.

On the topic of USB devices to replace your hobbled oscilloscope, check out this DAQ:
NI USB-6008 - Products and Services - National Instruments
I could probably get a discount (~10%) on it if you are interested.
  Reply With Quote
The Following User Says Thank You to bdrehmer For This Useful Post:
mpgmike (01-12-2022)
Old 06-07-2009, 04:18 PM   #1606 (permalink)
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,368
Thanked 1,202 Times in 765 Posts
Hey bdrhemer! Thank you for the encouraging words! I've never seen something like that before. It looks like a very helpful tool. I should definitely get one eventually. I may have to wait for something like that until the fall, though.

Back to ways it can fail! This is fun!

If someone hooks it up such that they basically bypass the motor completely, (like hooking both motor cables to the same post post of the motor) there would be almost no inductance to slow the current rise, which I believe would destroy the mosfets. The hardware current shutdown time of 3 or 4 uSeconds would be too slow I believe, but someone should try it just to see what happens! hahaha!
__________________
kits and boards
  Reply With Quote
Old 06-07-2009, 06:41 PM   #1607 (permalink)
EcoModding Lurker
 
Join Date: May 2009
Location: canada
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by dcb View Post
Build a few and try all those scenarios and get back to us.
I have gathered most parts now for my conversion... All that is missing is, batteries, controller, charger + desulfater... I would like to build Paul's controller right away, I think there is no point in buying a 1500$ curtis... Are the files on the wiki are the latest ?!?

What about the POWER Board ?!?

Where to get the aluminium plate for heat ?!?

On the BOM, the cristal is not listed... what is the part number ?!?

Paul said somewhere that R16 needed to be more than 1k... what value R16 needs to be !?

Quote:
Originally Posted by MPaulHolmes View Post
...You are right about the while loops. They have all been eliminated. Everything is done with interrupts now. We need to upload a newer version of the software to the wiki..
Can you please update wiki with all latest file...

Maybe a few more beta tester will build their own if the files are available... Atleast I will
Quote:
Originally Posted by MPaulHolmes View Post
By the way, somebody out there keeps hogging all the good mosfets from Digikey! They got their supply of them replenished less than a month ago! Maybe Curtis is stockpiling them? hehe. Now they won't ship until June 22! makes me mad!
A few years ago I was into console modchips, I made a few of those ( the latest i made was the xbox 8164 solderless adapter)... I still have a few contacts with chinese pcb boards manufacturer and I sent them your fab files for prices... Chinese manufacturers have their own parts suppliers witch are very very cheap... I will let you know if I have something better than june 22nd...

Thanks again for this awesome work and pls forgive my english
  Reply With Quote
Old 06-07-2009, 08:31 PM   #1608 (permalink)
EcoModding Apprentice
 
Join Date: May 2009
Location: Australia
Posts: 109
Thanks: 0
Thanked 2 Times in 2 Posts
Being picky again, and I am sure I am stating something that has been said before. However in my opinion this

PORTB &= (128 + 64 + 32 + 16 + 8 + 4 + 1); // this sets PB1 (the pwm output) to 0 at startup. Notice '2' is missing!


Is better written as
PORTB &= 0xFD; // this clears PB1 (the pwm output) at startup.

I appreciate that hexadecimal may be unfamiliar at first, believe me if you are going to be programming regularly it is highly advisable to become familiar with HEX.
Also in programming speak you don't "set" something to "0".
  Reply With Quote
Old 06-07-2009, 08:39 PM   #1609 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location: ÿ
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 269 Times in 212 Posts
too picky
__________________
WINDMILLS DO NOT WORK THAT WAY!!!
  Reply With Quote
Old 06-07-2009, 09:01 PM   #1610 (permalink)
EcoModding Apprentice
 
Join Date: May 2009
Location: Australia
Posts: 109
Thanks: 0
Thanked 2 Times in 2 Posts
I know, I know, but it is all about readability. In two years time when you have all worked on dozens of other programs and you pick this one up to make some changes you will realise the difference

  Reply With Quote
Reply  Post New Thread


Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paul and Sabrina's Cheap 3 Phase Inverter (AC Controller) with Field Oriented Control MPaulHolmes Fossil Fuel Free 3480 05-04-2022 05:43 PM
Paul & Sabrina's Cheap EV Conversion MPaulHolmes Fossil Fuel Free 542 11-12-2016 09:09 PM
Three Dirt Cheap DIY Electric Cars - Part 5 SVOboy EcoModder Blog Discussion 0 12-12-2008 04:10 PM



Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com