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 12-12-2010, 09:10 AM   #4111 (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,119 Times in 734 Posts
Awesome Jack! How come the rpm is half of what it seems like it would be? Like 200 Hz <---> 6000rpm instead of 200 cycles/sec*60sec/min --- 12000 cycles/min

__________________
kits and boards
  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 12-12-2010, 09:39 AM   #4112 (permalink)
EcoModding Apprentice
 
Join Date: Oct 2009
Location: Jyvaskyla, Finland
Posts: 143

Golfwagen - '89 Volkswagen Golf mk2
90 day: 107.14 mpg (US)
Thanks: 47
Thanked 35 Times in 28 Posts
I guess regular 4 cylinder ICE ignition provides tachosignal like that. 2 pulses for each full rotation. That's why 100Hz signal is 3000rpm. Tachometers in 4 cylinder cars want 2 pulses per revolution too. 8 cylinder ones give 4 pulses per revolution. Legacy of ICE world.
  Reply With Quote
Old 12-12-2010, 10:38 AM   #4113 (permalink)
Master EcoModder
 
jackbauer's Avatar
 
Join Date: Sep 2009
Location: Ireland
Posts: 734
Thanks: 26
Thanked 296 Times in 168 Posts
Yeh we just hard coded it to a 4 cyl tach signal cos thats what i have. We will have it programmable for any type of sender. Right now we have the rpm reading very accurately. 100.6hz produced 3004rpm reading. the issue with duty cycle was my fault. the sig gen varied the frequency as well as the duty. Tested now with 50/50 and all the way to 25/75 duty with no error.

in the short term i'm aiming for motor overspeed protection and rpm readout via rtd. Hopefully get a cruise control and idle function for an automatic in the future. Any other ideas??
__________________
Now, Cole, when you shift the gear and that little needle on the ammeter goes into the red and reads 2000 Amps, that's bad.
www.evbmw.com
  Reply With Quote
Old 12-16-2010, 07:26 PM   #4114 (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,119 Times in 734 Posts
I've added voltage monitoring and converted the control board to surface mount, and converted the power board to be professionally etched with solder mask and stuff. I took off about 1.5" from the power board so it's 4.55"x8" instead of the old 6x8, so the voltage spikes from inductance should be smaller. Also, you can have the polypro caps right at the mosfet legs now, which is better at snubbing spikes. So, it's like for a very brief time that the capacitor/diode/mosfet loop is practically zero.

The voltage monitoring has already been tested by the guy that actually made the original control board. So, lots of safety features can be added with knowledge of the voltage. hurray! I'm going to add the voltage monitoring to the AC control board, so things don't get out of control with the regen. I need to get that working!
__________________
kits and boards
  Reply With Quote
Old 12-16-2010, 07:31 PM   #4115 (permalink)
Master EcoModder
 
Join Date: Apr 2009
Location: Charlton MA, USA
Posts: 463

EVVette - '71 Chevy Corvette Coupe
Thanks: 31
Thanked 172 Times in 92 Posts
Quote:
Originally Posted by MPaulHolmes View Post
I've added voltage monitoring and converted the control board to surface mount, and converted the power board to be professionally etched with solder mask and stuff. I took off about 1.5" from the power board so it's 4.55"x8" instead of the old 6x8, so the voltage spikes from inductance should be smaller. Also, you can have the polypro caps right at the mosfet legs now, which is better at snubbing spikes. So, it's like for a very brief time that the capacitor/diode/mosfet loop is practically zero.

The voltage monitoring has already been tested by the guy that actually made the original control board. So, lots of safety features can be added with knowledge of the voltage. hurray! I'm going to add the voltage monitoring to the AC control board, so things don't get out of control with the regen. I need to get that working!
Paul,

Didn't you also convert this to dsPIC as well?

-Adam
__________________
www.EVVette.com - 1971 Corvette Coupe Conversion to all Electric!
www.AdamBrunette.com - Machining, CNC, Robotics and Electronics.

You can download RTD Explorer for the Cougar controllers at www.EVVette.com
  Reply With Quote
Old 12-16-2010, 07:36 PM   #4116 (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,119 Times in 734 Posts
Well, ya, but I was thinking of doing another one that still uses the atmega. The only reason I was using the dspic was because I wanted it to have CAN, so it can talk with the bms and charger while driving. I really want to get a plug-in hybrid working.
__________________
kits and boards
  Reply With Quote
Old 12-16-2010, 08:08 PM   #4117 (permalink)
AC-DC enthusiast
 
mrbigh's Avatar
 
Join Date: Nov 2009
Location: Long Island, NY
Posts: 282

Dual-PWR PHEV - '04 Toyota Prius

Kopper - '79 Bradley Bradley GT-II
Thanks: 122
Thanked 52 Times in 36 Posts
Quote:
Originally Posted by MPaulHolmes View Post
Well, ya, but I was thinking of doing another one that still uses the atmega. The only reason I was using the dspic was because I wanted it to have CAN, so it can talk with the bms and charger while driving. I really want to get a plug-in hybrid working.
PAUL
Well, I do not want to jump in to conclussions but, SurfaceMountedComponents will be a little hard to many DIY builders to work with and will be a real task to place a SMD dsPIC on the board in the right way.
Having in consideration how often the microprocessor get blown by any circumstances, the replacing will be difficult if this are NOT socketed.
Or, Are you planning to provide the control PCBs with the passive components already installed?
__________________
. .. .. . .......
Prius Absolutum Dominium . ..........KOPPER
PHEV conversion since Dec 2006.. . .... .Future EV
. . . . . . . .CALCars # 27. . . . . . . . . . ..on the works now !!
. . . . . . . . . . . . . . . . .. . ........
  Reply With Quote
Old 12-16-2010, 09:12 PM   #4118 (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,119 Times in 734 Posts
Ya, 99% of the problems with kits are soldering issues with the control boards. I was going to just have them placed by a machine and reflow soldered. It costs like $25-$30 per board I think from Advanced Circuits in Colorado. Given that it takes me 5 hours to solder one of those boards, that's like paying someone $6 per hour to do a better job than I ever could. I was going to use a very thick pcb (0.1") so that flexing wouldn't be much of an issue. It will be interesting to see what the reliability is.

I guess if a surface mount microcontroller didn't last very long, there would be lots of dead people in the world, and lots of law suits, so I hope that Microchip did their homework on it. But you are right, if one of those things breaks, it is not very practical at all removing one of those tiny little buggers, and the control board is basically junk then. But it's not being run very hard, so it should stay pretty cool, and have a long life, or I'm going to punch microchip right in the head!
__________________
kits and boards

Last edited by MPaulHolmes; 12-16-2010 at 09:34 PM..
  Reply With Quote
Old 12-17-2010, 01:33 AM   #4119 (permalink)
EcoModding Apprentice
 
Join Date: Nov 2010
Location: Annapolis
Posts: 159
Thanks: 0
Thanked 29 Times in 24 Posts
It's not very difficult to have an AVR use a Microchip MCP2515 CAN controller over SPI. And the chip is very inexpensive -- Avnet has them $1.72 in a DIP, with the MCP2551 transceiver costing only $1.12 (or even less for other brands, if you don't plan on using sleep mode).

Well, actually it was a bit of a PITA to get it working, but once working it seemed that it should have been easy. I ended writing the code for the MCP3008 SPI A/D converter to convince myself that I was using the SPI interface correctly. Of course that part worked the first time.

The problem turned out to be my clock, combined with the reset start-up time. The CAN controller needs a fast clock that is stable for a bit before you start using it. I didn't want the extra parts for an independent crystal, so I was clocking from an AVR timer output. The working configuration was setting the timer output at the maximum rate, going off and doing some other initialization, sending a reset command, do something else, then come back and set up the configuration registers. If you poll waiting for the reset to finish, make certain that you turn off or feed the watchdog, else you'll get bitten.

For the SPI interface you need the three SPI pins (MOSI/MISO/SCK) which can be shared with other SPI devices, and a dedicated chip select per SPI device (any free output will do, it doesn't need to be SS). The CAN controller also uses a timer output pin for its clock, and optionally an input for raising interrupts.

I'm currently just polling the status in the main loop and not using the interrupt, but I'll need it when I get around to implementing sleep mode.

The MCP2515 has five pins that can be used as general purpose inputs and outputs, so you can make up for losing the I/O pins on the AVR if you are running short.

The following is the clock setup for the Mega 1280 board that we are using for our motor controller.


/* Timer 4 is used to clock the CAN controller.
* It needs a 50% duty cycle clock that's at least 10x (preferably 16x)
* the max bit rate, which may be 250K, 500K or 1000Kbps.
* To get a 8MHz out from a 16MHz sys clock we must use mode 4 or 12.
* We set to mode 4: clear timer on compare w/ OCR4A.
*/
#define TIMER4_MODE 4
TIMSK4 = 0; /* Clear the interrupt flags. */
TCCR4B = 0; /* Stop the counter to load with zero. */
TCNT4 = 0;
OCR4A = 0; /* Max count is 1, divide by 2. */
/* Toggle OC4A on match, implicit divide by two. */
TCCR4A = (1 << COM4A0) | ((TIMER4_MODE & 0x3) << WGM40);
/* Bypass pre-scaler to use 16MHz clock, set upper mode bits. */
TCCR4B = (1 << CS40) | ((TIMER4_MODE & 0xC) << (WGM42 - 2));
/* OC4A output is on PH3.
* PH4/PWM7/OC4B is the tach opto input -- pull-up active.
* PH5/PWM8 drives the tach LED.
* PWM9/PH6/OC2B is pulled high as an alternate input
* Enable the pins as outputs. */
PORTH = 0x70;
DDRH = 0x28;

Last edited by DJBecker; 12-17-2010 at 08:18 AM..
  Reply With Quote
The Following User Says Thank You to DJBecker For This Useful Post:
MPaulHolmes (12-17-2010)
Old 12-17-2010, 03:37 AM   #4120 (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,119 Times in 734 Posts
I cant wait for all the awesome safety features from knowing voltage. Don't allow closing contactor if not precharging. Um... If precharging past max voltage, then open relay for the precharge. I'm not having a relay for that though. haha. But I could add it. There's room on the board. What else? Dead battery monitoring? Limp home mode if sagging too far? I actually didn't want to say anything in this post. I just wanted to post this video, since it's absolutely hilarious. It helps to watch it like 10 times though.

__________________
kits and boards
  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 3477 05-24-2021 03:28 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 - 2021, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com