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 03-31-2011, 03:02 PM   #151 (permalink)
Master EcoModder
 
jackbauer's Avatar
 
Join Date: Sep 2009
Location: Ireland
Posts: 734
Thanks: 26
Thanked 304 Times in 171 Posts
Today i reset soc to 100% after a charge and drove 10 miles. Fuel gauge dropped to 3/4 from full. Went for another drive later and gauge restarted at full despite my not charging or resetting the soc. Hmmmm. That bmw fuel gauge is weird. I'm sure i'll be spending plenty of time getting it working properly but at least it kinda works now which i'm happy with. I had considered one of the evworks zeva gauge drivers but from watching Jack Rickard having weeks of fun getting it setup i decided to pass. Glad i did.

Mrbigh , that block is the one specified by Chris on the bom. I believe its 5mm pitch. I did replace the little molex connector for the 12v and gnd with a 2.5mm pitch phoenix screw terminal i had left over from the bms. Which , by the way , is working great sitting on the shelf above the computer here

__________________
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
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 03-31-2011, 06:47 PM   #152 (permalink)
EV Builder
 
Freyguy's Avatar
 
Join Date: Nov 2010
Location: Macungie, PA
Posts: 157
Thanks: 15
Thanked 64 Times in 40 Posts
Jackbauer,
Did you try setting the SOC to 20% with SW2? Then you could turn VR2 and instantly see the correlation between PWM duty cycle and the fuel gage's range. At 20% SOC VR2 will change PWM over a 0-99% range. Attached is a spreadsheet I used to play around with values during development. Enter VR2 8-bit value in the yellow cell and you can see what PMW duty will be for each SOC value. You could also change PWM_Max if 100% duty is too high for the gage's range.
Attached Files
File Type: xls Fuel Gage PWM calculations.xls (31.5 KB, 35 views)
  Reply With Quote
Old 04-01-2011, 02:38 PM   #153 (permalink)
Master EcoModder
 
jackbauer's Avatar
 
Join Date: Sep 2009
Location: Ireland
Posts: 734
Thanks: 26
Thanked 304 Times in 171 Posts
I tried it today. Gauge stayed stubbornly on full so i hooked up a scope. Its an agilent handheld which seems to have some problems displaying certain pwm waveforms so i don't entirely trust it. I'm not a huge believer in digital scopes in general and lcd based ones in particular but thats another story. That said the waveform didnt seem to change when in cal mode or when at 99% soc. The vr2 pot made no diference to the wave either so i'm guessing a software bug may exist. I'll try and verify that with a normal scope over the weekend.
__________________
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 04-01-2011, 03:01 PM   #154 (permalink)
EV Builder
 
Freyguy's Avatar
 
Join Date: Nov 2010
Location: Macungie, PA
Posts: 157
Thanks: 15
Thanked 64 Times in 40 Posts
OK thanks for the info. So it sounds like there is a PWM waveform of some? duty cycle, but it doesn't change with SOC 20% or 99%. I know the 2480 uses a different ADC channel than the 2420 to read in VR2. Same pin of course, but different channel needed to be specified in code. I had made the change, but without a 2480 to test I could only assume it would work. Also, I tested it on the 2420 only with earlier versions of code, not the release. So it could potentially be a problem all around. I will check it out tomorrow and get back to you.
  Reply With Quote
Old 04-01-2011, 03:19 PM   #155 (permalink)
EcoModding Apprentice
 
apowers's Avatar
 
Join Date: Aug 2009
Location: Tn
Posts: 126
Thanks: 14
Thanked 19 Times in 16 Posts
I got my LCD mounted in the dash today. It is working now. Thank You Chris.
It seems like it was an "ancient version of firmware in the controller". Thank You Adam. Her are some pics.

  Reply With Quote
Old 04-01-2011, 03:26 PM   #156 (permalink)
Master EcoModder
 
jackbauer's Avatar
 
Join Date: Sep 2009
Location: Ireland
Posts: 734
Thanks: 26
Thanked 304 Times in 171 Posts
Yeh there was a pwm of 1.96khz. I had 99% soc at the time. The change to 20% in setup mode made no difference that i could see. I'll have a look at the code myself but it's taking a while to catch up That said it did work yesterday as i mentioned but then reset itself to full. I do suspect the fuel gauge computer in the dash is partially to blame. I'm looking out on ebay for an old "smiths" type fuel gauge that i could mount in a dash pod and use for testing. Sadly , they command a high price nowadays due to popularity in kit cars.
__________________
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 04-01-2011, 11:29 PM   #157 (permalink)
EV Builder
 
Freyguy's Avatar
 
Join Date: Nov 2010
Location: Macungie, PA
Posts: 157
Thanks: 15
Thanked 64 Times in 40 Posts
OK guys, found the fuel gage PWM bug. It exists in both 2420 and 2480 versions of the code.
Open the asm file and remove or comment out line 1622
;MOVWF RES2

That line serves no purpose and somehow got inserted way back in my january code. Probably right after the last time I checked this function..........go figure
VR2 will then work to adjust PWM at 20% SOC.

Jackbauer, I still think you need an inverted PWM for your setup, but play with VR2 and see what impact it has on the gage needle.

-Chris
  Reply With Quote
Old 04-02-2011, 09:26 AM   #158 (permalink)
EV Builder
 
Freyguy's Avatar
 
Join Date: Nov 2010
Location: Macungie, PA
Posts: 157
Thanks: 15
Thanked 64 Times in 40 Posts
Build error using PIC18F2420

Any of you using the PIC18F2420 will encounter this build error if using MPLAB 8.66
************************************************** **
CONFIG Directive Error: (value "PORTBEHalting build on first failure as
> requested.
************************************************** **
For some reason it sees PORTBE as an illegal config for CCP2MX even though it is listed as valid in the PIC18F2420.INC file. I don't see this on my laptop since I am using MPLAB ver 8.56. Turns out that versions of MPLAB up to and including 8.60 will compile fine (thank you Ian!) Older versions are available for download via a link on MicroChip's MPLAB page.

If you alternately set CCP2MX to PORTC (or delete this config option from the asm file) it will compile, but the PWM2 function will be muxed with our "MODE' LED. Can't say which will take priority as the datasheet is vague here. I would just use MPLAB 8.60!
  Reply With Quote
Old 04-02-2011, 09:29 AM   #159 (permalink)
Master EcoModder
 
jackbauer's Avatar
 
Join Date: Sep 2009
Location: Ireland
Posts: 734
Thanks: 26
Thanked 304 Times in 171 Posts
I'm using 8.4 for the simple reason it supports the picstart plus. They removed support for this programmer from later versions. A ridiculous decision.
__________________
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 04-02-2011, 09:34 AM   #160 (permalink)
EcoModding Apprentice
 
apowers's Avatar
 
Join Date: Aug 2009
Location: Tn
Posts: 126
Thanks: 14
Thanked 19 Times in 16 Posts
Hi Chris

I reprogrammed and now I can adjust fuel gauge down to empty. But...
when I reset SOC the gauge only goes to 3/8.

Alvin

Edit Forget what I just said. I took it for a test drive and by the time I got to the end of the driveway the gauge showed full. I went around the block that is 5 miles exactly. The LCD showed I had gone 5 miles and the gauge was at 3/4. Thank You


Last edited by apowers; 04-02-2011 at 10:27 AM..
  Reply With Quote
The Following 2 Users Say Thank You to apowers For This Useful Post:
Freyguy (04-02-2011), MPaulHolmes (04-02-2011)
Reply  Post New Thread






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