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 05-24-2011, 05:45 AM   #251 (permalink)
EV Builder
 
Freyguy's Avatar
 
Join Date: Nov 2010
Location: Macungie, PA
Posts: 157
Thanks: 15
Thanked 64 Times in 40 Posts
Well, the fuel gauge works with a variable voltage input which we fake out using PWM of +12V. The tach input expects to see a variable frequency from 0 to 600hz. Slowest freq I can output on the PWM pin is 488hz (using PWM block). Unless the pin is used as standard digital I/O and it is toggled based on another timer under interrupt. A bit of code involved...

  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 05-24-2011, 09:09 AM   #252 (permalink)
Master EcoModder
 
jackbauer's Avatar
 
Join Date: Sep 2009
Location: Ireland
Posts: 734
Thanks: 26
Thanked 304 Times in 171 Posts
Well guess what? programmed up a 2420 , dropped it in. Works perfectly. Was able to adjust the gauge up and down with the 5k pot etc. Changed to 488hz did help the noise quite a bit. Might add a cap. Assuming that there are no bugs in the 2480 code and given that the 2420 working removes a hardware issue that only leaves the devices themselves. Bad batch? static damage? Gremlins? Anyway main thing is i have a fuel gauge. I still doubt it would work on the bmw gauge due to the software filtering. At best it would be woefully inaccurate.
__________________
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
The Following 2 Users Say Thank You to jackbauer For This Useful Post:
LouMan (05-24-2011), mrbigh (05-24-2011)
Old 05-24-2011, 09:25 AM   #253 (permalink)
Master EcoModder
 
jackbauer's Avatar
 
Join Date: Sep 2009
Location: Ireland
Posts: 734
Thanks: 26
Thanked 304 Times in 171 Posts
It gets better. Decided for the hell of it to connect the beemer gauge in parallel. The damn thing works. Full at 100%soc. Empty at 20%. Time will tell if it actually works as it should. The only mods here being the pwm freq and i changed the full pwm from FF to FA.
__________________
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 05-24-2011, 01:09 PM   #254 (permalink)
EV Builder
 
Freyguy's Avatar
 
Join Date: Nov 2010
Location: Macungie, PA
Posts: 157
Thanks: 15
Thanked 64 Times in 40 Posts
Quote:
Originally Posted by jackbauer View Post
It gets better. Decided for the hell of it to connect the beemer gauge in parallel. The damn thing works. Full at 100%soc. Empty at 20%. Time will tell if it actually works as it should. The only mods here being the pwm freq and i changed the full pwm from FF to FA.
Awesome Jackbauer!
The ONLY difference between the 2480 & 2420 code is 1 configuration bit and the ADC channel # used for pin 23 (pot VR2). Since it worked for apowers, I'd have to assume device damage. Only way to know for sure is if you had a second 2480 to pop in.
Would have liked to take PWM down to 100Hz or so, but 488 is as low as it will go with 8Mhz crystal. Is it inaudible or is there a faint buzz? A cap should help. It will discharge thru R20 and charge through the meter's coil. Don't know how well it will filter, but even turning the square wave to triangle should eliminate residual buzz.
  Reply With Quote
Old 05-24-2011, 02:09 PM   #255 (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
Replaced LCD, no change to behaviour. Upper row full of blocks. I was able to read and write PIC fine but it made no difference. Did check voltages again like described in assembly instructions and everything was fine. Guess it is time to replace PIC with new one.
  Reply With Quote
Old 05-24-2011, 04:48 PM   #256 (permalink)
EcoModder
 
Join Date: Mar 2010
Location: New Zealand
Posts: 181
Thanks: 0
Thanked 33 Times in 20 Posts
Quote:
Originally Posted by Freyguy View Post
Well, the fuel gauge works with a variable voltage input which we fake out using PWM of +12V. The tach input expects to see a variable frequency from 0 to 600hz. Slowest freq I can output on the PWM pin is 488hz (using PWM block). Unless the pin is used as standard digital I/O and it is toggled based on another timer under interrupt. A bit of code involved...
I've just had a quick look at the toothed wheel that drives the magnetic sensor. Its hard to get at as it is fitted to the car and buried under lots of stuff, but best guess is about 60 teeth on a disc of about 20 cms dia. so tooth width is about .5 cm (with a .5 cm gap). This means the frequency at an idle of say 600 rpm is going to be about 600 Hz rising to say 6 KHz at 6000 rpm.
I'll hook my square wave generator to it and measure it that way, it'll be easier than fiddling about with the magnetic sensor etc.
So we need a square wave ouput that runs from - ideally 0, but in practice maybe your 488 Hz - up to 6 KHz and proportional to the current.
That would mean the minimum current reading would be 81A. Might not be so good. Any thoughts?
__________________
Sometimes I sits and thinks and sometimes I just sits.

Last edited by harlequin2; 05-24-2011 at 05:01 PM..
  Reply With Quote
Old 05-25-2011, 03:42 AM   #257 (permalink)
Master EcoModder
 
jackbauer's Avatar
 
Join Date: Sep 2009
Location: Ireland
Posts: 734
Thanks: 26
Thanked 304 Times in 171 Posts
harlequin2 what car do you have? It won't output the direct pulse train to the dash tach. The high pulse count is for crank position. The ecu in my bwm had one of these but still outputted a 12v 2 pulse per rev signal to the tach. Hence i could use an industrail prox sensor to drive it directly.
__________________
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 05-25-2011, 04:08 AM   #258 (permalink)
EcoModder
 
Join Date: Mar 2010
Location: New Zealand
Posts: 181
Thanks: 0
Thanked 33 Times in 20 Posts
Mr Bauer, I bow to your greater experience (and you may have a .45 in your hand!) and accept what you say. I'll have to go and measur e the damn thing, but its an E30 model. If the tacho requires 2 pulses per rev, that actually makes the s/w to drive it a lot simpler using an o/p port and somethi ng that produces 33.3 pulses per 100A. I think!
I m ight just go and have another glass of wine now .........
__________________
Sometimes I sits and thinks and sometimes I just sits.
  Reply With Quote
Old 05-25-2011, 05:58 AM   #259 (permalink)
VW Polo EV
 
Join Date: Aug 2009
Location: Port Macquarie
Posts: 69
Thanks: 1
Thanked 10 Times in 9 Posts
Tach signal

Jackbauer,
Would you elaborate more on how you got your tacho to play ball.
I am in a similar position. I retained the original reluctor ring & sensor (multiple pulses) + the ECU expecting that it would keep putting out the usual 12V 2 pulse per rev signal to the tacho.
The ECU is not being very co-operative at the moment & the simpler solution is to drive the tacho directly but I don't know how.
__________________
Electric VW Polo
  Reply With Quote
Old 05-25-2011, 12:18 PM   #260 (permalink)
EV Builder
 
Freyguy's Avatar
 
Join Date: Nov 2010
Location: Macungie, PA
Posts: 157
Thanks: 15
Thanked 64 Times in 40 Posts
Quote:
Originally Posted by harlequin2 View Post
If the tacho requires 2 pulses per rev, that actually makes the s/w to drive it a lot simpler using an o/p port and somethi ng that produces 33.3 pulses per 100A. I think!
I m ight just go and have another glass of wine now .........
2 pulses per rev sounds realistic. My 83 VW’s tach uses that as well.
So assuming that, frequencies of 0 to 200hz (@6000rpm) need to be produced.
I’d use the PWM pin in digital I/O mode and bit toggle it based on timer interrupt. Timer 1 is unused in the PIC. It's 16-bit which when used with max prescaler of 8 allows generation of frequencies down to 1.9hz (9.5A on a 1000A scale). Resolution would be about 625 steps over the 200hz range.

If one chose to keep the fuel gage interface, this new tach interface could alternately use the alarm output. You’d loose alarm, but the overtemp Led still blinks at the alarm threshold. In either case you’d need a pullup resistor to +12V. I used a 1K on my tach input (from open collector hall switch) and it worked fine.

wine is fine, but liquor is quicker

-Chris

  Reply With Quote
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