Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWM outputs #96

Open
collin80 opened this issue Dec 16, 2015 · 4 comments
Open

PWM outputs #96

collin80 opened this issue Dec 16, 2015 · 4 comments

Comments

@collin80
Copy link
Owner

GEVCU5 boards are capable of PWM on the outputs but there is currently no support for this functionality in software. It would be nice if it were possible to set up a PWM map on the GUI interface that allows the end user to calibrate the PWM output to how their gauge works.

@jrickard
Copy link
Contributor

The PWM output has a problem I think. Maybe I'm wrong. Get me
straightened out. With this low side switching isn't ON off and OFF is on
and so forth? So no output is a solid 12v and as we increase the pulse
width the PWM output would go DOWN instead of up. This is a little
counterintuitive.

Jack Rickard

On Tue, Dec 15, 2015 at 8:44 PM, Collin Kidder [email protected]
wrote:

GEVCU5 boards are capable of PWM on the outputs but there is currently no
support for this functionality in software It would be nice if it were
possible to set up a PWM map on the GUI interface that allows the end user
to calibrate the PWM output to how their gauge works


Reply to this email directly or view it on GitHub
#96.

http://www.EVTV.me http://EVTV.me

Electric Vehicle Television - KickinGas - One Car at a Time.

@collin80
Copy link
Owner Author

Yes, you are correct. The outputs are low side and switch ground so PWM is completely backward of what you would normally expect. High duty cycle corresponds to a lower average voltage and lower duty cycle raises the average voltage. So, for voltage sensitive gauges the whole thing is backward. For gauges that count pulses it can work as normal as you would still get the correct number of pulses, just with reverse polarity. I think that would still work OK.

A somewhat bigger issue is how irritating it is if you need a frequency controlled gauge. Controlling the frequency of the PWM outputs isn't a lot of fun. It's much simpler when you can just control the duty cycle.

@neuweiler
Copy link
Contributor

In ArduinoDue branch SystemIO::handleTick() (around line 100) I use PWM to output the estimated SOC to a DOUT. It is reversed due to the MOSFET. Works pretty fine for my digital fuel gauge with a resistor and capacitor to smoothen out the PWM to an analog signal.

@collin80
Copy link
Owner Author

collin80 commented Apr 2, 2017

Thanks for the heads up. Yes, I can see how you've implemented it. Using analogWrite works fine but as you know it's inverted and also does not support setting the frequency. Normally you don't need to change frequency but I had an application where I had to. I've still got that code in a private branch, perhaps I'll see what it would take to bring it into mainline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants