Page 1 of 3

Discrete components VR decoder with zero firmware code

Posted: Sun Nov 29, 2020 4:15 pm
by AndreyB
We are hooked on JLC assembly and JLC does not stock any VR ASIC we like.

Some OEM were somehow surviving without any ASIC in this area maybe that's a dead end but could it be something for us to consider?
image.png
image.png (30.72 KiB) Viewed 30098 times
Just pushed some unfinished design https://github.com/rusefi/rusefi/tree/master/hardware/VR_discrete could it be salvaged into anything working?

PS: somewhere on page two this threads moves to https://github.com/mck1117/vr-interface

Re: Discrete components VR decoder

Posted: Sun Nov 29, 2020 4:27 pm
by Gepro
It works well in megasquirt, there is two adjustable pots by VR channel.

Image

But maybe it works with +3.3v for safety ?

Re: Discrete components VR decoder

Posted: Sun Nov 29, 2020 4:29 pm
by AndreyB
Just to keep the joke running: this board needs power LED and output LED :)

Re: Discrete components VR decoder

Posted: Sun Nov 29, 2020 4:34 pm
by AndreyB
@Gepro can you make this a JLCPBC board in KiCAD?

Re: Discrete components VR decoder

Posted: Sun Nov 29, 2020 7:41 pm
by Gepro
The megasquirt version on Kicad ?

Lol, I really don't like Kicad, it is a pain in the ass without a mouse. But I want to give a try, and it is an occasion.

I actually have a independant VR connector, it is a good thing for testing.

I know than JBperf has a board before the MAX9926.

I actualy don't have a lot of time, and I have my MRE <3 <3

The adjustable pot isn't a option for that kind of board, with a clear signal like crank, you don't have to worry, but for cam and secondary, it is more complicated, less signal = more noise.

But on my MAX9926 board, it is the same, I had to put 10K resistor inline with the cam VR.

Re: Discrete components VR decoder

Posted: Sun Nov 29, 2020 9:03 pm
by Gepro
Sorry... I take a look to Kicad, and I just can't.

I can do it with easyEDA if you want.

I think that MMBT5401 can certainly replace ZTX553, I don't think 2A is usefull for VR and 150v probably better.
The LM2904DR2G can certainly replace MC34072 who is basic part. Old megasquirt used LM2904.

The only adjustable resistor is extended, I thing through hole is easier and cheaper.

EDIT :

I find this :
https://www.msextra.com/forums/viewtopic.php?f=132&t=49221&hilit=lm2904

I think that the TLC2272 deserves the extended price.

Re: Discrete components VR decoder

Posted: Sun Nov 29, 2020 10:00 pm
by mck1117
Gepro wrote:
Sun Nov 29, 2020 7:41 pm
Lol, I really don't like Kicad, it is a pain in the ass without a mouse. But I want to give a try, and it is an occasion.
no mouse?

Re: Discrete components VR decoder

Posted: Sun Nov 29, 2020 10:02 pm
by mck1117
Gepro wrote:
Sun Nov 29, 2020 4:27 pm
It works well in megasquirt, there is two adjustable pots by VR channel.
this is not true - it doesn't work well. I couldn't get my car to run at all on megasquirt with the internal VR circuit, so I added a max9924 and then it was perfect.

Re: Discrete components VR decoder

Posted: Sun Nov 29, 2020 11:03 pm
by AndreyB
Gepro wrote:
Sun Nov 29, 2020 7:41 pm
The megasquirt version on Kicad?
It really has to be KiCAD to be useful for me :(

Re: Discrete components VR decoder

Posted: Mon Nov 30, 2020 4:19 am
by kb1gtt

Re: Discrete components VR decoder

Posted: Mon Nov 30, 2020 12:02 pm
by Gepro
Wow ! Thanks :D :D :D

It isn't possible to have software VR ? I mean, a small amp for converting 0-150v into 0-3.3v and tune trigger and hysteris by software.
Maybe a standalone stm32 ?

I think it is doable for Knock sensing, with an ADC microphone.

Mck117 is right, discrete from MS3 < LM1815 < NCV < MAX992X
A lot of cars works well with basic megasquirt, but the ms3pro and microsquirt go to MAX992x.

Re: Discrete components VR decoder

Posted: Mon Nov 30, 2020 4:56 pm
by AndreyB
Gepro wrote:
Mon Nov 30, 2020 12:02 pm
It isn't possible to have software VR ? I mean, a small amp for converting 0-150v into 0-3.3v and tune trigger and hysteris by software.
Maybe a standalone stm32 ?
This forum thread is dedicated to the attempt to make something with zero firmware.

https://rusefi.com/forum/viewtopic.php?f=4&t=1682 has an attempt for software VR, we are all waiting for more information to become public.

Jared is saying that stm32 could be at least generating reference threshold voltage via DAC I assume RPM-based?

But again, this forum thread is dedicated to the attempt to make something with zero firmware.

Re: Discrete components VR decoder

Posted: Mon Nov 30, 2020 7:08 pm
by mck1117
AndreyB wrote:
Mon Nov 30, 2020 4:56 pm
This forum thread is dedicated to the attempt to make something with zero firmware.

https://rusefi.com/forum/viewtopic.php?f=4&t=1682 has an attempt for software VR, we are all waiting for more information to become public.

Jared is saying that stm32 could be at least generating reference threshold voltage via DAC I assume RPM-based?

But again, this forum thread is dedicated to the attempt to make something with zero firmware.
I don't think this is the thread with no firmware. The proposed solution using an STM32's DAC to move the threshold around technically has no firmware in the actual signal path - but has firmware that's also sniffing the signal and sliding the threshold around on the side.

Re: Discrete components VR decoder with zero firmware code

Posted: Mon Nov 30, 2020 7:10 pm
by AndreyB
mck1117 wrote:
Mon Nov 30, 2020 7:08 pm
The proposed solution using an STM32's DAC to move the threshold around technically has no firmware in the actual signal path - but has firmware that's also sniffing the signal and sliding the threshold around on the side.
rusEFI STM32's DAC solution is out of scope in this thread. This specific thread is to discuss if a useable solution with VR decoding completely external to rusEFI is possible.

Re: Discrete components VR decoder with zero firmware code

Posted: Mon Nov 30, 2020 7:21 pm
by kb1gtt
Would dedicated STM32 that is independent of rusEFI firmware an OK solution, or does that also cross the no firmware solution? AKA dedicated chip, instead of integrated solution.

Re: Discrete components VR decoder with zero firmware code

Posted: Mon Nov 30, 2020 7:25 pm
by AndreyB
kb1gtt wrote:
Mon Nov 30, 2020 7:21 pm
Would dedicated STM32 that is independent of rusEFI firmware an OK solution, or does that also cross the no firmware solution? AKA dedicated chip, instead of integrated solution.
it would NOT be OK for this "Discrete components VR decoder with zero firmware code" thread.

It would be OK for a separate "Dedicated STM32 that is independent of rusEFI firmware VR" thread.

My goal is to focus this thread only on one of the four possible approaches, my preference is not to discuss alternative approaches within the same thread.

For general chatting/quick brainstorming I find Slack more efficient we have a relevant room at https://app.slack.com/client/T4NJHQ8QZ/CF4AKRUF6/details/pins

Re: Discrete components VR decoder with zero firmware code

Posted: Mon Nov 30, 2020 10:37 pm
by Gepro
I give a try, in basic part, with a board that I can install instead of my MAX9926 board.

I go for through hole trimmer, so they aren't in the BOM for JLC, everything else is okay.

I go with MCP6002, I abolutely not sure about it... Some say it works well, and it is basic.
discrete price.jpg
discrete price.jpg (158.13 KiB) Viewed 29391 times
Here is the price, it's for 5 SMT boards, and I have 5€ more for postage. But I have a 9$ coupon.

PS : I go with autoroute, it works, so I let it for now.

Re: Discrete components VR decoder with zero firmware code

Posted: Tue Dec 01, 2020 3:03 am
by kb1gtt
Do you have a simulation for this? I'm not fully following how parts of it work. I'm concerned that it would be weak against common mode noise. Can it be adjusted to use the opamp as a differential input?

Re: Discrete components VR decoder with zero firmware code

Posted: Tue Dec 01, 2020 7:53 pm
by Gepro
I never see that simulations are possible, that's crazy !!!

I will take a look :D

I don't know for differential input, on megasquirt you only have the positive of the signal, and there is noise !

Re: Discrete components VR decoder with zero firmware code

Posted: Sat Dec 05, 2020 4:21 am
by Gepro
I tested the simulation with LTspice, it is a bit difficult to find the components from jlc-smt, so I use a universal OPamp, I think the MCP6002 will act the same.

Here it is :
100mV.jpg
100mV.jpg (225.19 KiB) Viewed 29201 times
2V 50K.jpg
2V 50K.jpg (239.58 KiB) Viewed 29201 times
2V 200K.jpg
2V 200K.jpg (237.77 KiB) Viewed 29201 times
100V.jpg
100V.jpg (235.68 KiB) Viewed 29201 times
The tests are with 50K and 200K on the mosfet, the 200K allows 100mV detection, so a lot of noise. 50K looks fine for mid RPM range.
I think that's possible to adjust the "zero crossing setpoint" by putting a 10K resistor, and tunes it with duty cycle by RPM.
A lot of aftermarket do this.
But for now, a variable pot is fine.

I will add filtering and design a PCB an other day :P

Re: Discrete components VR decoder with zero firmware code

Posted: Sat Dec 05, 2020 10:43 am
by kb1gtt
Pictures can be uploaded to the rusefi forum. You do not need the external service to host the pictures.

Re: Discrete components VR decoder with zero firmware code

Posted: Sat Dec 05, 2020 1:14 pm
by Gepro
Thanks :D I realise after lol, the habit from Slack :roll: I wanted to upload the asc files, but I had to zip it.

I want to try the OP07 from texas instrument, I don't succeed in using it in LTspice because of lack of inputs, there is internal offset tuning, and it is a basic part !

Re: Discrete components VR decoder with zero firmware code

Posted: Sun Dec 06, 2020 1:11 am
by Gepro
Here is a more advanced board. I go with OP07 and a LM393.
Discrete Sexyjpg.jpg
Discrete Sexyjpg.jpg (261.67 KiB) Viewed 29189 times
Schematic_Discrete_2020-12-06_03-03-06.png
Schematic_Discrete_2020-12-06_03-03-06.png (61.15 KiB) Viewed 29184 times
Discrete Price.jpg
Discrete Price.jpg (150.34 KiB) Viewed 29189 times
The price is for 5 boards with components, pretty good, the price of 5 MAX9924 chips. (that is only single channel)

I think I will order 5 and try it. I have some troubles with MAX9926 on my single tooth cam. The board uses the same pins than jbperf and speeduino boards, same I have.

Thanks, (more particulary to Matt who helped me a lot ! )

PS : there is a new LTspice file in the zip.

Re: Discrete components VR decoder with zero firmware code

Posted: Fri Dec 11, 2020 6:46 pm
by AndreyB
One step back - what explicit specs do we assume for a typical VR sensor while running simulations? Do we have a datasheet at all at least for one of them?

Re: Discrete components VR decoder with zero firmware code

Posted: Fri Dec 11, 2020 6:53 pm
by AndreyB
AndreyB wrote:
Fri Dec 11, 2020 6:46 pm
One step back - what explicit specs do we assume for a typical VR sensor while running simulations? Do we have a datasheet at all at least for one of them?
@andreika points at 2112-3847010

Code: Select all

Датчик положения коленвала 191.3847 предназначен для формирования электрического сигнала при изменении углового положения специального зубчатого диска, установленного на коленчатом валу двигателя. 

Датчик используется в составе комплексной системы управления двигателем внутреннего сгорания с ЭСУД. Является аналогом датчиков 191.3847, 37.3847, 2112-3847010-04. 

Основные технические характеристики: 
Сопротивление обмотки датчика, Ом – 570 – 750 
Индуктивность обмотки, мГн – 200 – 420 
Минимальная амплитуда напряжения с датчика при частоте задающего диска 30 об/мин, не менее, В – 0,3 
Максимальная амплитуда напряжения с датчика при частоте задающего диска 7000 об/мин, не более, В – 250 

Штекерный разъем соответствует соединителю 12052648 фирмы Packard Electric Габаритные размеры, мм – 30x45x69 Масса, г – 52

Re: Discrete components VR decoder with zero firmware code

Posted: Sat Dec 12, 2020 1:13 pm
by kb1gtt
How do you search the new wiki for content? I know there was a honeywell app note and spreadsheet that was on the old wiki, it also detailed many specs of the typical VR sensor. I used to search the old forum for "300V VR" but that does not work any more. How do I find it on the new wiki?

Re: Discrete components VR decoder with zero firmware code

Posted: Sat Dec 12, 2020 1:15 pm
by kb1gtt
This is where it used to be, see the history on this page, it has a honeywell app note, spreadsheet, and many details about VR's.
https://rusefi.com/wiki/index.php?title=Manual:Hardware_Trigger&oldid=2806#VR_lower_level_details.2C_formulas.2C_app_notes.2C_etc

Re: Discrete components VR decoder with zero firmware code

Posted: Sat Dec 12, 2020 3:12 pm
by AndreyB

Re: Discrete components VR decoder with zero firmware code

Posted: Sat Dec 26, 2020 10:37 pm
by Gepro
I finally receive the little boards :D :D
IMG_20201224_124835.jpg
IMG_20201224_124835.jpg (201.07 KiB) Viewed 28808 times
But it isn't a success :roll:
I made a wrong wiring with capacitors before resistors in input, TV5 before 10K resistors and 0.00V threshold.

Actually, the crank signal looks fine, but my one tooth cam is really noisy, I had to change a 10M resistor before the comparator by a 100K, and It isn't perfect... but it works! (my cam signal is 4V signal at 500RPM :D )

Here is a picture with default board :
10M.png
10M.png (14.1 KiB) Viewed 28808 times
The engine don't even start.

And with 100K instead of 10M :
100K instead 10M.jpg
100K instead 10M.jpg (81.11 KiB) Viewed 28808 times
I can't do a lot of tests for now, but the idle was stable.

I will order a second revision of the board with external control, or resistor. Because not all VR signals are the same.
Here is a preview :
Schematic_Discrete_2020-12-26_23-30-12.png
Schematic_Discrete_2020-12-26_23-30-12.png (95.84 KiB) Viewed 28808 times

Re: Discrete components VR decoder with zero firmware code

Posted: Fri Jan 01, 2021 9:17 pm
by Gepro
Here is the "V2" board, it is a 20x28mm board, with equivalent pinout to jbperf/speeduino board and 2 additional pins for PWM control.
Schematic_Discrete_2021-01-01_21-08-32.png
Schematic_Discrete_2021-01-01_21-08-32.png (116.57 KiB) Viewed 28712 times
Updated schematic
Price V2.jpg
Price V2.jpg (153.06 KiB) Viewed 28712 times
Price for 5 boards without delivery
BACK.jpg
BACK.jpg (72.54 KiB) Viewed 28712 times
I will order 5 boards, and give you feedback.