View Single Post
Old 05-23-2011, 04:47 PM   #247 (permalink)
Freyguy
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
Ok guys more problems! Installed a standard old fashioned resistive fuel gauge in a pod on the dash today. Very simple gauge. 12v=full , 2v=empty. Wired it all up and switched on with 100% soc in the module. Gauge goes to 3/4 with a 2khz whine. Enter setup mode and gauge drops to empty. Ran the 5k pot up and down the track. No change. Key off , key on. Back at 3/4 and whining. Decided to do a little spin. Hadn't driven 100 yards when the whine stopped and needle jumped to full. Also when in normal mode and using the button to change screen , the needle jumps to full when pressed then back to normal reading when released. I presume this is to do with the interrupt driven key handling.Running v1.2 code. Any thoughts much appreciated.

Everything else works fine just cant seem to get this fuel guage problem sorted.
Jackbauer,
I think I know what this is. I should have known when Alvin mentioned needing to drive a bit before the needle moved to full. The PWM frequency is too high and the meter coil's inductance limits the current (and whines about it,ha-ha). With limited current, the coil can't move the needle or in Alvin's case needs a little vibration from driving to unstick it. I knew not being able to test this on my own setup would come back to bite me
We can easily cut the PWM frequency from 2Kz to 500hz by changing the prescaler. I think I loaded T2CON with a 0x05. Changing it to 0x06 will make frequency 500hz. See what that does.
I'm not sure why the pot doesn't change PWM. I confirmed it works for me, but I have a 2420. Will look at code tonight.

-Chris
  Reply With Quote