Page 3 of 3

Re: Discrete components VR decoder with zero firmware code

Posted: Fri Jan 06, 2023 3:53 am
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

Re: Discrete components VR decoder with zero firmware code

Posted: Mon Apr 03, 2023 3:12 pm
by AndreyB

Re: Discrete components VR decoder with zero firmware code

Posted: Thu Apr 13, 2023 2:57 am
by AndreyB
https://github.com/andreika-git/hellen-one/wiki/module-vr-discrete now spells current understanding of original schematics

Re: Discrete components VR decoder with zero firmware code

Posted: Thu Apr 13, 2023 3:25 am
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.

Re: Discrete components VR decoder with zero firmware code

Posted: Sun Apr 30, 2023 3:13 pm
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.

Re: Discrete components VR decoder with zero firmware code

Posted: Sun Apr 30, 2023 5:04 pm
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 14183 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

Re: Discrete components VR decoder with zero firmware code

Posted: Sun Apr 30, 2023 8:30 pm
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.

Re: Discrete components VR decoder with zero firmware code

Posted: Sun Apr 30, 2023 9:32 pm
by kb1gtt
Is phase shift a concern? I guess that would probably get compensated for during tuning.

Re: Discrete components VR decoder with zero firmware code

Posted: Sun Apr 30, 2023 9:47 pm
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

Re: Discrete components VR decoder with zero firmware code

Posted: Mon May 01, 2023 12:00 am
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.