Miata Turbo Forum - Boost cars, acquire cats.

Miata Turbo Forum - Boost cars, acquire cats. (https://www.miataturbo.net/)
-   ECUs and Tuning (https://www.miataturbo.net/ecus-tuning-54/)
-   -   How to drive an NB speedo without a speed sensor (https://www.miataturbo.net/ecus-tuning-54/how-drive-nb-speedo-without-speed-sensor-85749/)

aidandj 09-02-2015 01:04 AM

How to drive an NB speedo without a speed sensor
 
<p>
</p><p>More details once we get all the calibrations.</p>

aidandj 09-02-2015 12:04 PM

<p>So this came from @yank's need for a speedo. He has an FE3 swap with an rx7 transmission, and the exhaust is in the way of the transmission speed sensor. Its in an NA, which has a cable driven speedo, so instead we switched to an NB cluster which has an electrically driven speedo.</p><p>The MS3 has provisions for taking a square wave in as a speed sensor, and can also output a square wave.</p><p>The ABS sensor we used outputs a VR signal much like the NB sensor, but at a different rate. So the plan became abs sensor -&gt; vr conditioner -&gt; megasquirt -&gt; speedo.</p><p>Last night when I pulled out my spare cluster I realized that the cluster wanted a vr signal to drive it, and thought we were fucked. But I said screw it and hooked up the square wave, and it worked.</p><p>Now we just need&nbsp;to wire it into the megasquirt and do some math.</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>

yank 09-03-2015 03:02 AM

YaY!

yank 09-03-2015 03:03 AM

Now when i make sweet ripper videos people will know how fast i'm going.

aidandj 11-09-2015 04:49 PM

1 Attachment(s)
Can someone double check this.

We have the ABS sensor providing a speed signal to the MS3.

We have powered the speedo using a 0-5v square wave.

We are now trying to make a 0-5v output signal from the MS3. VSS out provides a switch to ground which means that we should just add a 5v pull up and it should be fine right?

The speedo works when you give it a 0-5v square wave between the two wires that connect to the speedo sensor. So one of these should be tied to ground, and the other pulled up to 5v right?

https://www.miataturbo.net/attachmen...ine=1447105774

Pull up resistor at location 1.

Is this right? What value resistor for a pullup.

Matt Cramer 11-10-2015 11:09 AM

Yep, I'd stick a 1K resistor at location 1.

aidandj 11-10-2015 02:10 PM

Thanks Matt.

gooflophaze 11-12-2015 12:31 AM

1 Attachment(s)
I'm doing something similar with OBDII PID's - but the good news is that I've already got your MPH figured. Okay, KPH - because OBDII standardizes on metric.

https://www.miataturbo.net/attachmen...ine=1447306315

Is the observed pulses per second and the correlating KPH on the gauge. Functionally I fudged together this equation - with some compensations for the microcontroller.

Code:

if (kph > 240) kph = 240; // quick sanity check
    delaytime = (360000 / kph) - 20; //20us compensation for swing time
    next_speedo_toggle = current_time + delaytime;


Leafy 11-12-2015 07:24 PM

Personally, with how fucked up and shitty miata gauges are, I'd only use that PPM math as a starting point. Then I'd put the wheels in the air in the garage, and fiddle with that output until the gauge matched the math you do to convert RPM and gear ratio. Or use a GPS on the road to fiddle with it.

aidandj 11-12-2015 07:29 PM

Thats a cool idea. This solution was meant to be as simple as possible. Should just be 1 wire from the ECU to the speedo. (Maybe 2)

gooflophaze 11-12-2015 08:11 PM

The PPM math came from observation - I tossed pulses at it, tweaked them until I had points (x1 and y1 correlations) then found the equation afterwards. It's not terrible on the speedo side - you can see slight deviations from my calcs, but I think it's accurate enough(tm).

The tach? Now that one is wonky. I ended up having to use a piecemeal function to get it accurate (originally dialed in a accurate to 100rpm lookup table) and it's not a square wave, the tach starts fluctuating wildly if a minimum low(been awhile, can't remember if it's low or high) time isn't maintained.

scenturion 11-12-2015 09:35 PM


Originally Posted by bittetech (Post 1283145)
The PPM math came from observation - I tossed pulses at it, tweaked them until I had points (x1 and y1 correlations) then found the equation afterwards. It's not terrible on the speedo side - you can see slight deviations from my calcs, but I think it's accurate enough(tm).

The tach? Now that one is wonky. I ended up having to use a piecemeal function to get it accurate (originally dialed in a accurate to 100rpm lookup table) and it's not a square wave, the tach starts fluctuating wildly if a minimum low(been awhile, can't remember if it's low or high) time isn't maintained.

I think the signal is ideally supposed to be 4k counts per mile (squarewave out to accessories) or 8k counts counts per mile (VR signal in to odometer unit).
What are the X and Y axes on your graph?

gooflophaze 11-12-2015 10:14 PM

X is kph, Y is microseconds until next pulse. So.. ugh, this'll be annoying to solve.

1 mile = 8k pulses

so.. 60 seconds at 60mph = 1 mile (make this easy on myself)
60mph = 96.5606 kph
360000 / 96.5606 kph = 3728.22869783 us pulse rate
6000000 microseconds in a minute / 3728.22869783
= 16093.433 signal switchings from high to low and low to high so.. /2 .. so.. 8k?

close enough? (to be fair - I only use integer math in my code for speed. accurate 'nuff.)

aidandj 11-12-2015 10:26 PM


Originally Posted by bittetech (Post 1283190)
X is kph, Y is microseconds until next pulse. So.. ugh, this'll be annoying to solve.

1 mile = 8k pulses

so.. 60 seconds at 60mph = 1 mile (make this easy on myself)
60mph = 96.5606 kph
360000 / 96.5606 kph = 3728.22869783 us pulse rate
6000000 microseconds in a minute / 3728.22869783
= 16093.433 signal switchings from high to low and low to high so.. /2 .. so.. 8k?

close enough? (to be fair - I only use integer math in my code for speed. accurate 'nuff.)

More accurate than stock.

gooflophaze 11-12-2015 11:03 PM

In my circuit I'm including a trimpot that'll give +-10% to allow for wheel / differential flexibility as well since I'm trying to read everything off the OEM ECU. And if you want to get a custom tachometer gauge face from revlimiter, I should be able to scale that as well.

Mobius 11-13-2015 01:01 AM

I'm so proud my speedo cluster can contribute so much to the general knowledge of the miata community.

aidandj 11-13-2015 01:25 AM


Originally Posted by Mobius (Post 1283219)
I'm so proud my speedo cluster can contribute so much to the general knowledge of the miata community.

It was a worthy sacrifice.

Mobius 11-13-2015 01:38 AM

As long as we end up with something I can use to drive an NB speedo cluster with MS3 logs. Or AIM logs. I can write whatever converter is necessary to feed it as long as I know whatever the necessary format is.

scenturion 11-13-2015 12:41 PM

2 Attachment(s)

Originally Posted by bittetech (Post 1283198)
In my circuit I'm including a trimpot that'll give +-10% to allow for wheel / differential flexibility as well since I'm trying to read everything off the OEM ECU. And if you want to get a custom tachometer gauge face from revlimiter, I should be able to scale that as well.

What are you trying to accomplish? I would be happy to help! I designed two different circuits to run the speedometer and tachometer so I could use custom gauges.

The Arduino-based one seems to be closer to what you are trying to accomplish and has some more detail in my thread here.

It can take a mostly-arbitrary signal (from any electronic speed sensor), modify it in software to scale it and change the duty cycle, and then output it back into the odometer unit or directly into the gauge.

https://www.miataturbo.net/attachmen...ine=1447436468

I also designed a much simpler board which allows for scaling the tachometer or speedometer independent of the odometer (not much use if you arent getting in 8k pulses/mile), but some of the general component blocks might be useful.

aidandj 01-02-2016 05:49 PM

2 Attachment(s)
Update: It works!


Final circuit:

Attachment 232793

AbeFM 01-21-2016 02:36 PM

Ah! I've been quite interested in this for years - never made it to the top of my "list of stuff I'll actually do".

I have no ABS, and I DO have the OEM VSS, but I've been wanting to make the MS apply my correction factor directly - as tire shape changes with speed (both larger from spinning and smaller from wrinkling), correlating GPS speed with pulses seems the way to go - then apply a correction algorithm to the input (be it ABS or VSS). I already take the VSS into the MS3Pro, but using the output to drive it makes sense.

Can you be more specific about this dwell time thing (or was that only for the tach)? As both have the same issue (https://abefm.smugmug.com/Miata/Modi...Tach-Response/) it would be nice to let the ECU just do ALL the corrections.

aidandj 01-21-2016 02:39 PM

We literally just connected an injector out with a 1k pullup to 5v, to the orange speedo wire. Set it up in MS3 and bam, it worked. Left the other yellow speedo wire floating

This has not been road tested, only tested up to about 45mph by spinning the front wheel.

AbeFM 01-22-2016 08:22 PM

I should just try it. What really killed my motivation was the lack of scaling options in MS.

aidandj 01-22-2016 08:31 PM


Originally Posted by AbeFM (Post 1301724)
I should just try it. What really killed my motivation was the lack of scaling options in MS.

I'll borrow a function generator from work and see what speeds I can get out of my spare cluster.

AbeFM 01-23-2016 03:30 PM

Oh, yeah, that would be good. I wonder if I have one? No. Spares of everything but what I need. :-)

aidandj 01-23-2016 03:57 PM

I have a spare cluster. And a MDO4k. It might even have a function generator output...

AbeFM 01-24-2016 05:54 PM

I think when I was doing it I used the Jim Stim. Drove the MS and compared screen to physical tach gauge.

""I fed the tach known spaced tach pulses, and found that the tach is accurate at low RPM (1000), and from ~1500-~4000 is picks up linearly about 175 rpm of offset (it reads high). Then it stays there until ~7200 (reading ~7375) and by 7500 it's reading correct again, which it retains through 8000 rpm, which is as high as I tested.""

There's my super-scientific data. Enough to know something's wrong, not sure enough of it. :-) But both tach and speedo should have ~7 point tables or a simple formula to tweak the output. The MS should be able to drive all of it - and it already knows the engine/road speed, etc, so why not do it there?

gooflophaze 01-24-2016 09:46 PM

1 Attachment(s)
https://www.miataturbo.net/attachmen...ine=1453689960

Here are my manual tach corrections. Big pain in the ass since it's obviously non-linear. I'm using scaled piecemeal functions for the moment (imagine point to point lines). Need to check against my 2nd cluster to see if the results are valid and not some inherent manufacturing differences (and create a few additional data points). Don't worry too much about how this data is actionable, this is primarily to see if wolfram alpha could create a best fit line that looked halfway implementable (hint: it didn't).

Did I mention I have this on my bench reading data from megasquirt thru canbus right now? Too cold to work in the shop so I'm working on my bench. I need to get the LFX running to pull OBDII data, but I can compensate for transaction times and other gotchas via MS. Been playing with the timer0 prescaler to try and knock out some jitter. Needles aren't flapping but it could always look better through the scope.


All times are GMT -4. The time now is 12:13 PM.


© 2024 MH Sub I, LLC dba Internet Brands