EE's: help me with this TPS circuit
#1
Junior Member
Thread Starter
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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:
However... I'm sure there's something I missed, so that's why I'm posting here
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
#2
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.
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.
#3
I identify as a bear.
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,109
Total Cats: 6,640
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.
#4
Junior Member
Thread Starter
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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.
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.
#5
Junior Member
Thread Starter
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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?
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?
#8
I identify as a bear.
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,109
Total Cats: 6,640
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
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?
#10
Junior Member
Thread Starter
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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::
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::
#12
Junior Member
Thread Starter
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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.
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.
#15
Junior Member
Thread Starter
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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?
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?
#18
Junior Member
Thread Starter
Join Date: Jul 2005
Location: Hillsborough, NC
Posts: 273
Total Cats: 1
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.
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.
#20
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.
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.