EE's: help me with this TPS circuit - Miata Turbo Forum - Boost cars, acquire cats.

Welcome to Miataturbo.net   Members
 


MEGAsquirt A place to collectively sort out this megasquirt gizmo

Reply
 
 
 
LinkBack Thread Tools
Old 01-14-2009, 06:43 PM   #1
Junior Member
Thread Starter
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 0
Default EE's: help me with this TPS circuit

I'm stuck with the standard TPS switch on my 90-93 miata because of the class I race in. I'm trying to put together a circuit that makes more use of the TPS.



Explanation:

The miata has two TPS inputs.

1N:
0v when pedal released
5v when PARTIALLY applied

2L:
5v when released
0v when FULLY applied

The above circuit attempts to obtain the following:

0v when pedal released
3v when partially applied
5v when fully applied

So I used a voltage divider to bring 1N down to 3v. The NPN transistor is used as a switch to invert the signal on 2L. Maybe there is a better way? Is this circuit "safe"?

I have almost no idea what I'm doing... I just read a lot on wikipedia, and messed around with a circuit simulator for a LONG time until I found something that appeared to work

Note that I am using a custom firmware that can take advantage of this. Some people will never need anything like this... but I do.

I tested the following conditions in the simulator:

Code:
              1N  2L  MS
No throttle   0v  5v  0.02v
Partial       5v  5v  2.97v
Full          5v  0v  5v
However... I'm sure there's something I missed, so that's why I'm posting here
Attached Thumbnails
EE's: help me with this TPS circuit-tps.jpg  
JustinHoMi is offline   Reply With Quote
Old 01-14-2009, 06:54 PM   #2
Elite Member
iTrader: (15)
 
patsmx5's Avatar
 
Join Date: Aug 2007
Location: Houston, TX
Posts: 8,796
Total Cats: 247
Default

Circuit looks ok to me. I didn't break out the calculator and check it, but I think it's right. Only thing I question is when you're WOT and the R3 2k2 goes to ground, then current will go from vref>1N>D1>R4>R3>ground. That gives me a current of .001515151 amps. And a voltage drop across R4 of 1.515151 volts. So the voltage would be 5-1.5151= 3.48 when you go WOT.

EDIT: Disclaimer: I'm no EE. But I am doing E.E. Systems HW right now. But I'm going for ME, not EE.

EDIT2: Yeah, I can't read. My math's way off, ignore it. I think yours is right, I'll check it again in a sec.
patsmx5 is offline   Reply With Quote
Old 01-14-2009, 07:23 PM   #3
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago (Over two miles from Wrigley Field. Fuck the Cubs. Fuck them in their smarmy goat-hole.)
Posts: 26,317
Total Cats: 1,914
Default

Looks good to me. Your predicted voltages check out, current through Q1 should be a max of 9ma when at half-throttle, no sneak paths that I can see... Looks like a winner.
Joe Perez is offline   Reply With Quote
Old 01-14-2009, 08:18 PM   #4
Junior Member
Thread Starter
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 0
Default

Sweet, thanks for looking at it. I never expected it to work as-is!

So, if I want to build this circuit in the MS proto area, I could run the TPS through pins 4 and 5 on the connector, and that would bring them out to SPR2 and SPR3 on the board, right? Then I'd run the output to the backside of pin 22.

I know the TPS normally comes in through pin 22, but I'm not sure how I'd intercept the signal. It'd be nice not to waste a pin though.
JustinHoMi is offline   Reply With Quote
Old 01-14-2009, 08:39 PM   #5
Junior Member
Thread Starter
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 0
Default

Also... The MS came with some spare 2N3904FS-ND (similar to this: 2N3904 NPN Small Signal Transistor - RadioShack.com). Will that do the trick?

Or should I get something more like this: MPS2222A Transistor - RadioShack.com

I assume most diodes will work? I have a couple of 1N4001DICT-ND.

Is there any minimum wattage I should be looking at for the resistors?
JustinHoMi is offline   Reply With Quote
Old 01-14-2009, 09:07 PM   #6
Elite Member
iTrader: (12)
 
Join Date: Jan 2007
Location: Hermosa Beach, CA
Posts: 2,575
Total Cats: 11
Default

you cant simply get a oem miata automatic tps? or is that out of the rules?
cardriverx is offline   Reply With Quote
Old 01-14-2009, 10:26 PM   #7
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago (Over two miles from Wrigley Field. Fuck the Cubs. Fuck them in their smarmy goat-hole.)
Posts: 26,317
Total Cats: 1,914
Default

Quote:
Originally Posted by cardriverx View Post
you cant simply get a oem miata automatic tps? or is that out of the rules?
(...)

Quote:
Originally Posted by JustinHoMi View Post
I'm stuck with the standard TPS switch on my 90-93 miata because of the class I race in.
Joe Perez is offline   Reply With Quote
Old 01-14-2009, 10:30 PM   #8
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago (Over two miles from Wrigley Field. Fuck the Cubs. Fuck them in their smarmy goat-hole.)
Posts: 26,317
Total Cats: 1,914
Default

Quote:
Originally Posted by JustinHoMi View Post
Also... The MS came with some spare 2N3904FS-ND (similar to this: 2N3904 NPN Small Signal Transistor - RadioShack.com). Will that do the trick?

Or should I get something more like this: MPS2222A Transistor - RadioShack.com
There are some trivial differences in the small-signals section of the specs page, and the rated collector current on the 2222 is about triple that of the 3904, but either one should work for this application.

Quote:
I assume most diodes will work? I have a couple of 1N4001DICT-ND.
1n400x are fine here.

Quote:
Is there any minimum wattage I should be looking at for the resistors?
No. You're dealing with microscopic amounts of current here. 1/8 watt parts would be fine.
Joe Perez is offline   Reply With Quote
Old 01-15-2009, 10:25 AM   #9
Boost Czar
iTrader: (61)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 72,847
Total Cats: 1,788
Default

Quote:
Originally Posted by JustinHoMi View Post

I know the TPS normally comes in through pin 22, but I'm not sure how I'd intercept the signal. It'd be nice not to waste a pin though.

or you'd solder the output directly to R9 since it's already on the board.
Braineack is offline   Reply With Quote
Old 01-18-2009, 01:18 AM   #10
Junior Member
Thread Starter
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 0
Default

Welllll.....

I built the circuit, hooked it up to the car, and turned the key. After tapping the throttle, I realized that the MS LED's blink on when hitting the throttle, and turn off when letting up.

Scared that I fried my coils, I hooked up the oem ecu, and it sure enough, it runs terribly. So I tested each plug wire with my timing light and two aren't firing.

I take it my coil pack is toast?

::sob::
JustinHoMi is offline   Reply With Quote
Old 01-18-2009, 01:23 AM   #11
Elite Member
iTrader: (15)
 
patsmx5's Avatar
 
Join Date: Aug 2007
Location: Houston, TX
Posts: 8,796
Total Cats: 247
Default

Probably. Post your msq or a screen shot of your ignition settings. Probably have something backwards and it's holding your coils 'high' all the time.
patsmx5 is offline   Reply With Quote
Old 01-18-2009, 01:38 AM   #12
Junior Member
Thread Starter
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 0
Default

I would, but the power supply I've been using for my stim just decided to kick the bucket too.

But I don't think it's a setting. When I turned the key to ON, the MS LED's did not turn on. When I hit the throttle they turned on, and when I released the throttle they turned back off. I'm thinking that I must have shorted out the MS somehow, and that must have caused my coils to be held high or low or whatever.... I must have made an error when wiring up the circuit.
JustinHoMi is offline   Reply With Quote
Old 01-18-2009, 01:45 AM   #13
Junior Member
Thread Starter
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 0
Default

Well my packratedness paid off... I found another power supply. Here is my MSQ. Note that I'm using MAF mode (no MAP sensor), so my ve and spark tables may look off.
Attached Files
File Type: msq megasquirt-apocolypse.msq (35.4 KB, 71 views)
JustinHoMi is offline   Reply With Quote
Old 01-18-2009, 01:48 PM   #14
Boost Czar
iTrader: (61)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 72,847
Total Cats: 1,788
Default

I would go back over where I wired my stuff to...
Braineack is offline   Reply With Quote
Old 01-18-2009, 03:47 PM   #15
Junior Member
Thread Starter
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 0
Default

I double-checked the circuit, and I don't see any obvious problems. The entire circuit is on the proto area of the MS.

1N -> Pin4 on DB37 -> SPR2
2L -> Pin5 on DB37 -> SPR3

I copied the exact layout of the circuit into a simulator, as you can see below. I added the pullups for each input through the +5v on the proto area, and the transistor is grounded to the proto GND. I didn't have any output. I just hooked up the multimeter, which was grounded to one of the grounds on the DB37.

I don't really know how to represent 1N and 2L in the simulator though. How do you represent a signal that needs a pullup?
Attached Thumbnails
EE's: help me with this TPS circuit-tps-circuit-final.jpg  
JustinHoMi is offline   Reply With Quote
Old 01-20-2009, 06:32 PM   #16
Junior Member
Thread Starter
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 0
Default

Any ideas on how this might have shorted out my MS? I'm pretty much as a loss.
JustinHoMi is offline   Reply With Quote
Old 01-20-2009, 06:45 PM   #17
Elite Member
iTrader: (15)
 
patsmx5's Avatar
 
Join Date: Aug 2007
Location: Houston, TX
Posts: 8,796
Total Cats: 247
Default

post a screen shot of your ignition settings that you are currently running on the MS.
patsmx5 is offline   Reply With Quote
Old 01-20-2009, 08:24 PM   #18
Junior Member
Thread Starter
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 0
Default

Here ya go.

I connected the MS to the car with the above circuit hooked up, and wouldn't start, and LED's were OFF when the ignition was turned to ON. Then I disconnected the circuit and hooked it up, and the LED's were ON. The only difference was the circuit, no config changes.
Attached Thumbnails
EE's: help me with this TPS circuit-ms1.jpg   EE's: help me with this TPS circuit-ms2.jpg  
JustinHoMi is offline   Reply With Quote
Old 01-21-2009, 09:34 AM   #19
jwx
Junior Member
 
Join Date: Sep 2007
Location: North of Atlanta
Posts: 78
Total Cats: 0
Default

Its sounds like your shorting the Vref to ground. When the Vref is grounded, it makes the MS shut down, or not start, depending upon how you look at it.
jwx is offline   Reply With Quote
Old 01-21-2009, 11:07 AM   #20
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

There's probably a much simpler circuit to be had. Sort of like an R-2R ladder D-A circuit.
I need to know what the TPS switches do (how they connect).

I take it the TPS switches are all pullup to 5V switches? (Your circuit sort of assumes that). If you get the pull up vs. pull down (to gnd) wrong, your circuit won't work right.

But I gotta ask, what is the "off,half,full" signals for? So the MS can tell when throttle is closed, WOT, and somewhere in between? I would recommend turning off TPS based accel because this circuit can't tell the MS the rate of change of throttle opening.
JasonC SBB is offline   Reply With Quote
 
 
Reply

Related Topics
Thread Thread Starter Forum Replies Last Post
1.8 TB/TPS for use with 1.6 wiring Elfering MEGAsquirt 17 12-16-2016 07:44 PM
Bunch of NB stuff - mspnp2, begi intake mani, injectors mikeflys1 Miata parts for sale/trade 12 05-01-2016 10:51 AM
Going back to stock. Need some 1.6 parts. Trent WTB 2 10-01-2015 01:15 PM
TPS Screw Thread Pitch aidandj General Miata Chat 1 09-15-2015 01:27 AM
BMW TPS / P&P TPS for Megasquirt albumleaf WTB 0 09-10-2015 10:28 AM


Thread Tools

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 03:43 AM.