LS1TECH - Camaro and Firebird Forum Discussion

LS1TECH - Camaro and Firebird Forum Discussion (https://ls1tech.com/forums/)
-   PCM Diagnostics & Tuning (https://ls1tech.com/forums/pcm-diagnostics-tuning-7/)
-   -   TPS for switch on off? (https://ls1tech.com/forums/pcm-diagnostics-tuning/1896289-tps-switch-off.html)

ElQueFør 04-14-2018 12:43 PM

TPS for switch on off?
 
I want to control a switch or relay with a certain TPS % threshold. Is this possible? A Hobbs switch for boost is my backup option but I'd really like to explore the possibility of of using TPS to switch a relay on or off instead.


I'm going to add a fluid pump to the T56 hybrid I finished a month or so ago and I'm playing with ideas on how to control it. I don't want a toggle, except for maybe a manual override, I'd rather automate the process. A Hobbs switch will do the trick. But is it possible to control switches/relays with TPS????

As some of you know, the vehicle is a mutt but here are the relevant details as I can think of them now.

90 GMT400, LQ4, S475, T56, 3 bar SD 411 PCM.

truckdoug 04-14-2018 04:21 PM

If you're good with Arduino boards you could do it. Tps output is a .5 to 4.5 volt output.

Ms3pro or Holley dominator might have an output you could configure to do that. Hp tuners does not.

Or you rig a microswitch on the throttle cam itself.

Lots of ways to skin thatcatt

brandon6.0 04-14-2018 07:59 PM

Nitrous micro switch sounds like the best and easiest way. Just read the tps with your software and make bracket for trigger around tht tps%.

ElQueFør 04-14-2018 10:50 PM

Right on, thanks guys.

Might need to revisit some of my arduino experience from the flow bench and see how involved controlling it that way will be.

I have no experience with these microswitches. Do they have to be for nitrous setups? I get a few electronics catalogs in the mail. All Electronics is one. They have all kinds of weird eccentric stuff. I wonder if there is something in there that might work.

truckdoug 04-16-2018 08:48 AM

any of those little microswitches sold on sparkfun would work.

https://www.sparkfun.com/products/9506

i'm sure everyone from nitrous kit makers to pinball machine manufacturers buy from the same place

JoeNova 04-16-2018 09:53 AM

Would take ~5-6 lines to do it with an arduino.

ElQueFør 04-16-2018 07:23 PM

My limited Arduino experience is just with that injector flow bench.


Joe, you're obviously good with Arduino, I saw your flow bench! Care to help with the code? I haven't even thought about it yet really. :secret:

pdxmotorhead 04-16-2018 07:29 PM

If your running the pump just to cool the transmission, a contact temperature switch on the tranny would be an option.?

If your trying to turn the pump off when running hard, a RPM switch would work maybe?

Combination of the two?

ElQueFør 04-16-2018 08:18 PM

Hmmm I'm liking all the ideas that have been suggested. I have options on how to do this which I likey!!!!

Yeah main thought is on hard pulls I want it to start spraying lube at the headset gears since the oil rushes towards the back of the case for a split second.

NSFW 04-17-2018 12:30 AM

Sounds like you might also want an accelerometer to turn the pump on. And throttle, and a temp sensor... sense all the things! Maybe 50 lines of Arduino code?
​​

JoeNova 04-17-2018 07:13 AM


Originally Posted by ElQueFør (Post 19878631)
My limited Arduino experience is just with that injector flow bench.


Joe, you're obviously good with Arduino, I saw your flow bench! Care to help with the code? I haven't even thought about it yet really. :secret:

Should be easy.

Declare the analog input and digital output with variables.

Inside the loop, just do an IF analoginput > X, digitalWrite relay HIGH, else digitalWrite relay LOW. X will be somewhere between 0 and 1023 for the analog input.

4 lines of code.

Don't quote this because I don't have the IDE in front of me so I'm going off top of my head, and it depends on which board you're using)

Code:

Relay = D2;

void loop() {
TPS = analogRead(A1);
if (TPS > 950) {digitalWrite(relay, HIGH)} else {digitalWrite(relay,LOW)}

You'll have to experiment with the number. 0 to 1023 is 0V to 5V. TPS operates closer to .5V - 4.5V.

You can make the code more complicated and set mine/max TPS amounts and then convert to a TPS % from there, but it just creates extra lines that basically do nothing but make it easier for you to understand your own code.

JoeNova 04-17-2018 07:16 AM

and I forgot the } at the very end. I can't edit posts.

Also, you can skip the variables all together and just do.

[CODE]
void loop() {
if (analogread(A1) > 950) {digitalWrite(D2, HIGH)} else {digitalWrite(D2, LOW)}}

2 lines.

TrendSetter 04-17-2018 07:23 AM

you're going to want some hysteresis in the code.
i have exactly what youre asking for, i use it to activate my boost controller and fuel pumps. i can post some code snippets tonight

JoeNova 04-17-2018 07:35 AM


Originally Posted by TrendSetter (Post 19878904)
you're going to want some hysteresis in the code.
i have exactly what youre asking for, i use it to activate my boost controller and fuel pumps. i can post some code snippets tonight

They'll help with a runaway relay in this situation, but not completely required.

TrendSetter 04-17-2018 09:42 AM

its important for when you are part throttle and it keeps switching back and forth between the on and off state.
analog signals can be noisy so you want some form of filtering in there, or a hysteresis. i like it for when I pedal it a little it wont turn my pumps/boost control on and off, it keeps them on until i let off completely

JoeNova 04-17-2018 12:32 PM

I had problems with a runaway relay when using it for water/meth. When you crossed the threshold for the relay but stayed within a couple of KPA, the relay would just buzz. A full hysteresis isn't needed, just a simple gap between activation/deactivation thresholds. If TPS > 700, HIGH, if TPS < 650, LOW.

TrendSetter 04-17-2018 02:38 PM

in this context, that's what hysteresis is, homey

TrendSetter 04-17-2018 04:52 PM

i pulled this out of my fuel pump controller i use in my truck.

Code:

#define MAPTHRESH  325 // raw 0-1023 analog in
#define MAPHIST    150 //  1 bar = 328, 1.4 bar = 461

#define TPSTHRESH  450  // raw 0-1023
#define TPSHIST    150

#define MAIN_DELAY_FASTER        10
void loop() {
        //  100hz loop
        if ((millis() - lastMil10) >= MAIN_DELAY_FASTER) { //run this every 10 ms (100hz) 
        mapRaw = analogRead(A0);
        tpsRaw = analogRead(A1);
       
        //mapV = (5000/1023) * mapRaw;  //convert to mv
        //tpsV = (5000/1023) * tpsRaw;
       
       
        if ((mapRaw > MAPTHRESH) && (tpsRaw > TPSTHRESH)) {
            // fuel pump/bc not on, but the map and tps thresholds have been exceeded
            //Serial.println("fuel pump on");
            digitalWrite(FUELOUT, HIGH);
        }

        if ((mapRaw < MAPTHRESH - MAPHIST) || (tpsRaw < TPSTHRESH - TPSHIST)) {
            //Serial.println("fuel pump off");
            digitalWrite(FUELOUT, LOW);
           
        }
                lastMil10 = millis();
        }
}


ElQueFør 04-17-2018 08:14 PM

You guys are awesome.

I just checked to make sure I have a few perf boards and all the rest of the goodies from my last arduino go round and I do.

Just ordered up another Arduino board for this project. I'm going to leave the other one dedicated to my flow bench.


Do you guys have a favorite enclosure for these? I'll need one for both of these Arduino projects. My flowbench Arduino board is still just pinned in to a temporary breadboard :lol:

truckdoug 04-17-2018 09:12 PM

man i'm gonna have to get up on this arduino stuff. looks like i'm missing out on fun.


All times are GMT -5. The time now is 01:23 AM.


© 2024 MH Sub I, LLC dba Internet Brands