Discrete components VR decoder with zero firmware code

Hardware inside and outside of the ECU
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Discrete components VR decoder with zero firmware code

Post by AndreyB »

It has been a while! Suddenly replacing one of the components in the BOM has triggered unexpected consequences https://github.com/andreika-git/hellen-one/issues/245
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Discrete components VR decoder with zero firmware code

Post by AndreyB »

Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Discrete components VR decoder with zero firmware code

Post by AndreyB »

https://github.com/andreika-git/hellen-one/wiki/module-vr-discrete now spells current understanding of original schematics
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Discrete components VR decoder with zero firmware code

Post by mck1117 »

AndreyB wrote:
Thu Apr 13, 2023 2:57 am
https://github.com/andreika-git/hellen-one/wiki/module-vr-discrete now spells current understanding of original schematics
There is already a model for the free LTSpice here: https://github.com/mck1117/vr-interface/blob/master/model/VR_Thresholded.asc

A few statements in that wiki page are inaccurate.
Nevertheless, you can connect VR on one wire, and ground the second at the input to the ECU, since the signal on the remaining VR line will cross the 0V voltage, but there seems to be no reason to do so.
This isn't quite true - while it would work that way with ideal opamps, no opamps are ideal like that in the real world. The clamp diodes (and opamps themselves) will distort any signal that goes more than ~0.5v below ground. So for very quiet VR sensors this will work (grounding one input pin), but for any real sensor it will result in severe distortion.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Discrete components VR decoder with zero firmware code

Post by AndreyB »

Jared says

Change the op amp GND from GND to V- with V- being a mirror of V+. Then install 2 resistors on the VR- node, so that VR- typically hangs out at the same voltage which would be the GND voltage.

The current op amp is only 6V on the high side rail, so either that means changing to +/-2.5V or changing to a different op amp which can handle a higher voltage swing.

I think you'd be OK with U1, U2, and U6 having a V- which goes below GND, then you could probably keep U3 as the GND and 5V. AKA if you connect V- to GND, it's not a significant change in voltage. So you could at this point use a single wire VR. I'm not 100% sure how well this would work for a hall. I might be OK, but I don't know the hysteresis of the circuit.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: Discrete components VR decoder with zero firmware code

Post by kb1gtt »

AndreyB wrote:
Sun Apr 30, 2023 3:13 pm
Jared says
Still in early stages of noodling this over, but this might mostly work. I basically just split off the op-amps to have a virtual ground. I think this would likely allow for a 1 wire VR, connect VR+ to GND, then VR- would be the other VR wire. Granted in 1 wire mode, it would have a lower common mode rejection, but good enough if your VR is hot enough, or good enough if you are using a hall.
Draft1_-2v5.PNG
Draft1_-2v5.PNG (46.39 KiB) Viewed 11746 times
Of course this would want a -V generator instead of relying on an external signal, etc.

See fork here if someone wants to review the KiCAD version of it.
https://github.com/jharvey/vr-interface
Welcome to the friendlier side of internet crazy :)
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Discrete components VR decoder with zero firmware code

Post by mck1117 »

You can also pull this off by capacitively coupling the sensor inputs, then doing whatever you want with the DC offset.

Ground one pin, ground the other pin, doesn't matter, it'll work.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: Discrete components VR decoder with zero firmware code

Post by kb1gtt »

Is phase shift a concern? I guess that would probably get compensated for during tuning.
Welcome to the friendlier side of internet crazy :)
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Discrete components VR decoder with zero firmware code

Post by mck1117 »

Also, that edited schematic doesn't actually fix it: The problem is with the clamp diodes, not the opamp inputs. If you delete the diodes the opamps are less protected, but the common mode input range is expanded.

Edit: just move the diodes to the inputs of the first opamp, instead of prior to the 100k resistors
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: Discrete components VR decoder with zero firmware code

Post by kb1gtt »

The drafted schematic has many issues. I'd also like if the diodes clamped to gnd instead of the +5 rail. In other similar circuits, I've seen that clamped energy self power the 5v and override the ability to shut off the 5v. So I typically either avoid that style of clamp or I add something like a crowbar to make sure the 5v turns off.
Welcome to the friendlier side of internet crazy :)
Post Reply