MEGAsquirt A place to collectively sort out this megasquirt gizmo

EE's: help me with this TPS circuit

Thread Tools
 
Search this Thread
 
Old 01-14-2009, 05:43 PM
  #1  
Junior Member
Thread Starter
 
JustinHoMi's Avatar
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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  
Old 01-14-2009, 05:54 PM
  #2  
Elite Member
iTrader: (16)
 
patsmx5's Avatar
 
Join Date: Aug 2007
Location: Houston, TX
Posts: 9,295
Total Cats: 476
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  
Old 01-14-2009, 06:23 PM
  #3  
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,023
Total Cats: 6,591
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  
Old 01-14-2009, 07:18 PM
  #4  
Junior Member
Thread Starter
 
JustinHoMi's Avatar
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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  
Old 01-14-2009, 07:39 PM
  #5  
Junior Member
Thread Starter
 
JustinHoMi's Avatar
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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  
Old 01-14-2009, 08:07 PM
  #6  
Elite Member
iTrader: (12)
 
cardriverx's Avatar
 
Join Date: Jan 2007
Location: Hermosa Beach, CA
Posts: 2,573
Total Cats: 12
Default

you cant simply get a oem miata automatic tps? or is that out of the rules?
cardriverx is offline  
Old 01-14-2009, 09:26 PM
  #7  
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,023
Total Cats: 6,591
Default

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

Originally Posted by JustinHoMi
I'm stuck with the standard TPS switch on my 90-93 miata because of the class I race in.
Joe Perez is offline  
Old 01-14-2009, 09:30 PM
  #8  
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,023
Total Cats: 6,591
Default

Originally Posted by JustinHoMi
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.

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

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  
Old 01-15-2009, 09:25 AM
  #9  
Boost Czar
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

Originally Posted by JustinHoMi

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  
Old 01-18-2009, 12:18 AM
  #10  
Junior Member
Thread Starter
 
JustinHoMi's Avatar
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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  
Old 01-18-2009, 12:23 AM
  #11  
Elite Member
iTrader: (16)
 
patsmx5's Avatar
 
Join Date: Aug 2007
Location: Houston, TX
Posts: 9,295
Total Cats: 476
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  
Old 01-18-2009, 12:38 AM
  #12  
Junior Member
Thread Starter
 
JustinHoMi's Avatar
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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  
Old 01-18-2009, 12:45 AM
  #13  
Junior Member
Thread Starter
 
JustinHoMi's Avatar
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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, 159 views)
JustinHoMi is offline  
Old 01-18-2009, 12:48 PM
  #14  
Boost Czar
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

I would go back over where I wired my stuff to...
Braineack is offline  
Old 01-18-2009, 02:47 PM
  #15  
Junior Member
Thread Starter
 
JustinHoMi's Avatar
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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  
Old 01-20-2009, 05:32 PM
  #16  
Junior Member
Thread Starter
 
JustinHoMi's Avatar
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
Default

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

post a screen shot of your ignition settings that you are currently running on the MS.
patsmx5 is offline  
Old 01-20-2009, 07:24 PM
  #18  
Junior Member
Thread Starter
 
JustinHoMi's Avatar
 
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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  
Old 01-21-2009, 08:34 AM
  #19  
jwx
Junior Member
 
jwx's Avatar
 
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  
Old 01-21-2009, 10:07 AM
  #20  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
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  


Quick Reply: EE's: help me with this TPS circuit



All times are GMT -4. The time now is 03:20 PM.