Potential analog reference voltage issue

Marcos' unmaintained, but still in-use, Puma for FreeEMS circuit board/hardware design!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Potential analog reference voltage issue

Post by Fred »

Fred wrote:Que? No entendido.
jharvey wrote:You don't understand
Thank you captain state the obvious.
let me clarify.
No. I'll let marcos clarify what he meant by his ambiguous statement. Not you speculate on it, whether you're right or not.
You claim it does not have good regulation
No, I did not. Read again.
your comment is wrong.
No, yours is. See above.
Fixed wrote:Or should I stop whining, and wasting our time with such chatter.
Please do. Please, if someone addresses someone else directly, by name, or by quote, leave it up to them to answer. Especially when they are being asked about something only they can answer, not something generic.

The next post should be unrelated to this post, or the two above it, unless it is Marcos replying to my query for him. IE, don't answer this, it's noise. Answering this will be moderated as off-topic and in breach of the rule that says don't argue with moderator actions...

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
nitrousnrg
LQFP144 - On Top Of The Game
Posts: 468
Joined: Tue Jun 24, 2008 5:31 pm

Re: Potential analog reference voltage issue

Post by nitrousnrg »

Jared was right. The regulators stays as they are now unless a better idea comes up.
Marcos
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Potential analog reference voltage issue

Post by Fred »

nitrousnrg wrote:The regulators stays as they are now unless a better idea comes up.
Brilliant! Glad to hear that you've dropped the SMPS idea, that was never a good idea for a mainstream reliable board with medium to long term supply without redesign, anyway. Good work.

I've got to point out, though, that I never suggested removing or changing it, not once. I suspect you just misunderstood. Which is why YOU, and only YOU, needed to answer my question, such that we could clarify the situation, get over the language barrier, etc. "it stays as is" is a ridiculous thing to say when no one has suggested otherwise, don't you think? The sky is blue! Wait, you never said it was night time, did you? etc.

As you were.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
nitrousnrg
LQFP144 - On Top Of The Game
Posts: 468
Joined: Tue Jun 24, 2008 5:31 pm

Re: Potential analog reference voltage issue

Post by nitrousnrg »

No, this topic is about the ADC voltage reference, and from which regulator it is taken. The SMPS is there to aid another totally diferent problem, its an addition to the actual 2 reg setup, and I like how it behaves.

What stays as it is is, is the reference configuration. It was -and probably will- be taken from the small regulator. In my mind, "stays as is" mean "it stays as it is right now", of course I could be totally wrong.
I've got to point out, though, that I never suggested removing or changing it, not once.
If you're talking about the SMPS, that's not true, and its the wrong thread to argue about this.
Marcos
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Potential analog reference voltage issue

Post by Fred »

nitrousnrg wrote:If you're talking about the SMPS, that's not true, and its the wrong thread to argue about this.
I wasn't, and neither were you.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
slacker.cam
QFP80 - Contributor
Posts: 69
Joined: Sun Jan 27, 2008 10:25 pm

Re: Potential analog reference voltage issue

Post by slacker.cam »

Shit you guys argue a lot!

This is a legitimate problem and the solution is extremely simple!!! If you stop bickering at each other it's actually very basic.

Marcos, I'll try and explain the issue as simply as I can so we don't have language problems: Most of the analog voltages on the ECU come from voltage dividers. This means that the voltage that we see at the ADC pin is a ratio of the resistances multiplied by the supply voltage (at the top of the voltage divider). In order to accurately determine what the actual voltage is at the ADC pin you MUST use the supply voltage for the divider network as the ADC reference voltage.

At the moment it is completely WRONG. And must be changed.

Let me make an example to clarify.

Lets assume that the miucrocontroller voltage regulator (the one thats currently used as the reference) is 100% accurate and outputs 5.0000V all day every day. And lets also assume that the secondary voltage regulator (that all of the analog circuits are powered from) gets some sag in it due to excessive loading. Lets assume the sagging is only an issue when the idle circuit is active (purely as an example) and the voltage drops to 4.0V. The rest of the time its 5.0V. So when the idle circuit is inactive the analog supply voltage is the same as the reference voltage and all of the ADC measurements will make sense (ie. a divider with two 10K resistors will give you 2.5V and a ADC reading of 512). But then the idle controller kicks in and suddenly the voltage on the tops of the dividers will drop to 4.0V. Now our resistor divider will only give us 2.0V at the ADC pin which will give us a reading of 410 ADC counts!

So even though the resistor divider has not changed we have a massive change in the ADC reading. This will throw off all of the analog measurements and make them completely worthless. Obviously this is an extreme scenario but even small differences in the voltages will cause errors of a few %. I can't believe that this is not seen by you guys as a massive problem. It is!!! It's just as bad as megasquirt not having a correct analog ground reference.

Please change it for the next revision. If you need more clarification as to why this is a big issue then just let me know.
slacker.cam
QFP80 - Contributor
Posts: 69
Joined: Sun Jan 27, 2008 10:25 pm

Re: Potential analog reference voltage issue

Post by slacker.cam »

Oh, one more thing.

In my example I suggested that the voltages might be different due to sagging. Well that's only one possible scenario.

If either of the supplies have any noise on them then this will cause measurement errors. This is probably the most likely scenario which will cause issues.

The other scenario is a permanent offset. If the accuracies of one of the regulators is out by a few % then this will carry on to the analog measurements also. The most likely scenario where this will be an issue is differing performance with temperature. This has already been flagged as an issue and hence why the SMPS is being researched.
User avatar
nitrousnrg
LQFP144 - On Top Of The Game
Posts: 468
Joined: Tue Jun 24, 2008 5:31 pm

Re: Potential analog reference voltage issue

Post by nitrousnrg »

Very appreciated input, slacker :D

I'm biased by some prior experience with rf amplifiers, when the errors of the first stages are the most relevant, and I see vref as the first stage of the whole thing. However, I see your point, and I don't have more than a gut feel to argue about it.

So, changing it won't be a problem. Just some reasonable filtering and thats it.

About the VDD/2, its not a problem neither. That voltage is an operative voltage, beyond it, the ADC just doesn't work as accurately as the datasheet tables say. In the absolute maximum ratings (pg 1241), it says -0.3v to 6v for the analog reference.

Okay, Its added to spin2's todo
Marcos
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Potential analog reference voltage issue

Post by Fred »

nitrousnrg wrote:Very appreciated input, slacker :D
Wait, I said exactly that above, no, fuck this, I WILL quote myself, one second...
Fred wrote:Lastly, the only real downside to using the wrong reference would be that the two noise values (ref and signal) would sum and the peak to peak noise of the measurement would be worse. Whereas with the correct one, signal would fall as reference fell and the same count would be delivered, or close to it.
Fred wrote:
MARCOS!!! wrote:If you believe it is better to have a less stable 5v as a reference because the circuits would move up and down together, then cool; I'm keen to hear some thoughts :-)
Consider TPS, just for example, TPS is a voltage divider between 0 and source, whatever source is. If source is 5.1 and TPS is at 100%, TPS is at 5.1 and the output is 1023 raw ADC count. If source is 5.1 and reference is 5.0, then TPS will show 100% when it is only at 95 or something. That's not cool.
Exactly the same! Blind? Deaf? Lazy? Confused? Something's not right.
Marcos wrote:About the VDD/2, its not a problem neither. That voltage is an operative voltage, beyond it, the ADC just doesn't work as accurately as the datasheet tables say. In the absolute maximum ratings (pg 1241), it says -0.3v to 6v for the analog reference.
Fred wrote:That isn't a hard limitation, it's a limitation for accuracy reasons.
Am I on your ignore list or something? There are some serious echoes in this thread and it's disappointing to say the least. Thanks Cam, it seems that the echo was loud enough to get heard, at least!
nitrousnrg wrote:The regulators stays as they are now unless a better idea comes up.
nitrousnrg wrote:So, changing it won't be a problem. Just some reasonable filtering and thats it.
Anyone else in here baffled by this behaviour? ...

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Potential analog reference voltage issue

Post by Fred »

nitrousnrg wrote:Okay, Its added to spin2's todo
No, no it's not. Last commit pushed to the master branch of your Puma repo was April 7, 2011. If you have local changes, please finalise them and push. You should really get into the habit of pushing immediately after the commit, and committing only after testing, thus you'll find that there is much less merge work to do.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Post Reply