How to drive an NB speedo without a speed sensor - Miata Turbo Forum - Boost cars, acquire cats.

Welcome to Miataturbo.net   Members
 


ECUs and Tuning Discuss Engine Management, Tuning, & Programming

Reply
 
 
 
LinkBack Thread Tools Search this Thread
Old 09-02-2015, 02:04 AM   #1
SADFab Destructive Testing Engineer
Thread Starter
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 17,992
Total Cats: 1,457
Default How to drive an NB speedo without a speed sensor

<p>
</p><p>More details once we get all the calibrations.</p>
aidandj is offline   Reply With Quote
Old 09-02-2015, 01:04 PM   #2
SADFab Destructive Testing Engineer
Thread Starter
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 17,992
Total Cats: 1,457
Default

<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>
aidandj is offline   Reply With Quote
Old 09-03-2015, 04:02 AM   #3
Senior Member
iTrader: (1)
 
Join Date: Jun 2007
Posts: 669
Total Cats: 29
Default

YaY!
yank is offline   Reply With Quote
Old 09-03-2015, 04:03 AM   #4
Senior Member
iTrader: (1)
 
Join Date: Jun 2007
Posts: 669
Total Cats: 29
Default

Now when i make sweet ripper videos people will know how fast i'm going.
yank is offline   Reply With Quote
Old 11-09-2015, 05:49 PM   #5
SADFab Destructive Testing Engineer
Thread Starter
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 17,992
Total Cats: 1,457
Default

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?



Pull up resistor at location 1.

Is this right? What value resistor for a pullup.
Attached Thumbnails
How to drive an NB speedo without a speed sensor-mkbra2x.jpg  
aidandj is offline   Reply With Quote
Old 11-10-2015, 12:09 PM   #6
Supporting Vendor
 
Matt Cramer's Avatar
 
Join Date: Sep 2006
Posts: 2,266
Total Cats: 51
Default

Yep, I'd stick a 1K resistor at location 1.
Matt Cramer is offline   Reply With Quote
Old 11-10-2015, 03:10 PM   #7
SADFab Destructive Testing Engineer
Thread Starter
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 17,992
Total Cats: 1,457
Default

Thanks Matt.
aidandj is offline   Reply With Quote
Old 11-12-2015, 01:31 AM   #8
Junior Member
 
Join Date: May 2007
Location: Atlanta
Posts: 383
Total Cats: 38
Default

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.



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;
Attached Thumbnails
How to drive an NB speedo without a speed sensor-speedo.png  
gooflophaze is offline   Reply With Quote
Old 11-12-2015, 08:24 PM   #9
Elite Member
iTrader: (1)
 
Leafy's Avatar
 
Join Date: Jun 2012
Location: NH
Posts: 9,091
Total Cats: 90
Default

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.
Leafy is offline   Reply With Quote
Old 11-12-2015, 08:29 PM   #10
SADFab Destructive Testing Engineer
Thread Starter
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 17,992
Total Cats: 1,457
Default

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)
aidandj is offline   Reply With Quote
Old 11-12-2015, 09:11 PM   #11
Junior Member
 
Join Date: May 2007
Location: Atlanta
Posts: 383
Total Cats: 38
Default

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.
gooflophaze is offline   Reply With Quote
Old 11-12-2015, 10:35 PM   #12
Junior Member
iTrader: (9)
 
Join Date: Dec 2011
Location: SFBay
Posts: 339
Total Cats: 39
Default

Quote:
Originally Posted by bittetech View Post
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?
scenturion is offline   Reply With Quote
Old 11-12-2015, 11:14 PM   #13
Junior Member
 
Join Date: May 2007
Location: Atlanta
Posts: 383
Total Cats: 38
Default

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.)
gooflophaze is offline   Reply With Quote
Old 11-12-2015, 11:26 PM   #14
SADFab Destructive Testing Engineer
Thread Starter
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 17,992
Total Cats: 1,457
Default

Quote:
Originally Posted by bittetech View Post
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.
aidandj is offline   Reply With Quote
Old 11-13-2015, 12:03 AM   #15
Junior Member
 
Join Date: May 2007
Location: Atlanta
Posts: 383
Total Cats: 38
Default

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.
gooflophaze is offline   Reply With Quote
Old 11-13-2015, 02:01 AM   #16
Elite Member
iTrader: (2)
 
Mobius's Avatar
 
Join Date: May 2008
Location: Portland, Oregon
Posts: 3,176
Total Cats: 261
Default

I'm so proud my speedo cluster can contribute so much to the general knowledge of the miata community.
Mobius is offline   Reply With Quote
Old 11-13-2015, 02:25 AM   #17
SADFab Destructive Testing Engineer
Thread Starter
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 17,992
Total Cats: 1,457
Default

Quote:
Originally Posted by Mobius View Post
I'm so proud my speedo cluster can contribute so much to the general knowledge of the miata community.
It was a worthy sacrifice.
aidandj is offline   Reply With Quote
Old 11-13-2015, 02:38 AM   #18
Elite Member
iTrader: (2)
 
Mobius's Avatar
 
Join Date: May 2008
Location: Portland, Oregon
Posts: 3,176
Total Cats: 261
Default

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.
Mobius is offline   Reply With Quote
Old 11-13-2015, 01:41 PM   #19
Junior Member
iTrader: (9)
 
Join Date: Dec 2011
Location: SFBay
Posts: 339
Total Cats: 39
Default

Quote:
Originally Posted by bittetech View Post
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.



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.
Attached Thumbnails
How to drive an NB speedo without a speed sensor-80-136665_stackd_miata_arduino_controlled_gauge_cluster_067a3093_44b4927bfc53200e24d758e325b4549.jpg  
scenturion is offline   Reply With Quote
Old 01-02-2016, 06:49 PM   #20
SADFab Destructive Testing Engineer
Thread Starter
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 17,992
Total Cats: 1,457
Default

Attached Thumbnails
How to drive an NB speedo without a speed sensor-6yuttlc.jpg  
aidandj is offline   Reply With Quote
 
 
Reply

Related Topics
Thread Thread Starter Forum Replies Last Post
My solution for Oiltemp and Oilpressure input into Megasuirt (MS3) Zaphod MEGAsquirt 41 01-24-2016 01:25 PM
Back to Stock Part Out!! Turbo Parts, MS2 Enhanced 01-05, Suspension, and MOAR! StratoBlue1109 Miata parts for sale/trade 16 10-02-2015 10:39 AM
3rd Time's a Charm...hopefully. zephyrusaurai Meet and Greet 2 09-28-2015 11:59 PM
Got bad Crank Angle Sensor and Random Misfire codes, but runs fine. Greasyman General Miata Chat 2 09-28-2015 11:44 AM


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 05:57 PM.