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

Discrete components VR decoder with zero firmware code

Post 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 28239 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
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
Gepro
Posts: 100
Joined: Sun Nov 01, 2020 2:15 pm
Location: France

Re: Discrete components VR decoder

Post 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 ?
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

Post by AndreyB »

Just to keep the joke running: this board needs power LED and output LED :)
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

Post by AndreyB »

@Gepro can you make this a JLCPBC board in KiCAD?
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
Gepro
Posts: 100
Joined: Sun Nov 01, 2020 2:15 pm
Location: France

Re: Discrete components VR decoder

Post 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.
Gepro
Posts: 100
Joined: Sun Nov 01, 2020 2:15 pm
Location: France

Re: Discrete components VR decoder

Post 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.
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

Post 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?
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

Post 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.
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

Post 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 :(
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

Post by kb1gtt »

Welcome to the friendlier side of internet crazy :)
Gepro
Posts: 100
Joined: Sun Nov 01, 2020 2:15 pm
Location: France

Re: Discrete components VR decoder

Post 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.
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

Post 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.
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

Post 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.
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 »

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.
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 »

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.
Welcome to the friendlier side of internet crazy :)
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 »

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
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
Gepro
Posts: 100
Joined: Sun Nov 01, 2020 2:15 pm
Location: France

Re: Discrete components VR decoder with zero firmware code

Post 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 27532 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.
Attachments
Schematic_Discrete_2020-11-30_23-24-18.pdf
(60.15 KiB) Downloaded 422 times
PCB_Discrete_2020-11-30_23-24-56.png
PCB_Discrete_2020-11-30_23-24-56.png (12.44 KiB) Viewed 27532 times
Discrete.zip
(91.24 KiB) Downloaded 446 times
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 »

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?
Welcome to the friendlier side of internet crazy :)
Gepro
Posts: 100
Joined: Sun Nov 01, 2020 2:15 pm
Location: France

Re: Discrete components VR decoder with zero firmware code

Post 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 !
Gepro
Posts: 100
Joined: Sun Nov 01, 2020 2:15 pm
Location: France

Re: Discrete components VR decoder with zero firmware code

Post 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 27342 times
2V 50K.jpg
2V 50K.jpg (239.58 KiB) Viewed 27342 times
2V 200K.jpg
2V 200K.jpg (237.77 KiB) Viewed 27342 times
100V.jpg
100V.jpg (235.68 KiB) Viewed 27342 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
Last edited by Gepro on Sat Dec 05, 2020 4:30 pm, edited 1 time in total.
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 »

Pictures can be uploaded to the rusefi forum. You do not need the external service to host the pictures.
Welcome to the friendlier side of internet crazy :)
Gepro
Posts: 100
Joined: Sun Nov 01, 2020 2:15 pm
Location: France

Re: Discrete components VR decoder with zero firmware code

Post 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 !
Attachments
Discrete.zip
(722 Bytes) Downloaded 370 times
Gepro
Posts: 100
Joined: Sun Nov 01, 2020 2:15 pm
Location: France

Re: Discrete components VR decoder with zero firmware code

Post 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 27330 times
Schematic_Discrete_2020-12-06_03-03-06.png
Schematic_Discrete_2020-12-06_03-03-06.png (61.15 KiB) Viewed 27325 times
Discrete Price.jpg
Discrete Price.jpg (150.34 KiB) Viewed 27330 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.
Attachments
Schematic_Discrete_2020-12-06_03-03-22.pdf
(45.71 KiB) Downloaded 342 times
Discrete.zip
(25.77 KiB) Downloaded 395 times
PCB_Discrete_2020-12-06_01-50-49.png
PCB_Discrete_2020-12-06_01-50-49.png (10.64 KiB) Viewed 27330 times
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 »

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?
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 »

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
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 »

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?
Attachments
Capture.PNG
Capture.PNG (20.66 KiB) Viewed 27191 times
Welcome to the friendlier side of internet crazy :)
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 »

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
Welcome to the friendlier side of internet crazy :)
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
Gepro
Posts: 100
Joined: Sun Nov 01, 2020 2:15 pm
Location: France

Re: Discrete components VR decoder with zero firmware code

Post by Gepro »

I finally receive the little boards :D :D
IMG_20201224_124835.jpg
IMG_20201224_124835.jpg (201.07 KiB) Viewed 26949 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 26949 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 26949 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 26949 times
Gepro
Posts: 100
Joined: Sun Nov 01, 2020 2:15 pm
Location: France

Re: Discrete components VR decoder with zero firmware code

Post 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 26853 times
Updated schematic
Price V2.jpg
Price V2.jpg (153.06 KiB) Viewed 26853 times
Price for 5 boards without delivery
BACK.jpg
BACK.jpg (72.54 KiB) Viewed 26853 times
I will order 5 boards, and give you feedback.
Attachments
V2.zip
(27.17 KiB) Downloaded 394 times
Schematic_Discrete_2021-01-01_21-08-24.pdf
(70.44 KiB) Downloaded 359 times
Post Reply