Cruise control

Status
Not open for further replies.

PaulH

Active member
I want to be able to read the analog signal 0-5v, from a throttle position sensor (basically a pot). The signal is used by the car's ecu so the method I use to get the signal to the teensy 2 cannot influence the signal as it is seen by the ecu.

The teensy 2 will be powered by another 5v supply used by a sensor that input has been disabled so I am good as far as power goes, I just need to figure out the signal.

With the analog signal from the tps I will write a small sketch to make another pin on the car's ecu go to ground which will in turn switch maps to a more economical one. I do not have the code skills to hack the car's ecu to find this feature so one solution is the teensy 2 along with a simple code.

Any help would be most appreciated.

For the curious here is a link to the open source software that is loaded into the car's ecu. http://www.romraider.com/forum/viewtopic.php?f=36&t=7594

Thank you,

Paul
 
It goes without saying... be very careful about unintended alteration of the sensor's signal!
Could you use speed or some such from the safer OBD-II connector instead? Maybe all you are sensing is in-motion, and RPM might do.
 
Yes, that is my biggest concern. RPM is sent to the ecu in a similar manner so the concern with unintentional alteration of the sensor's signal applies to practically all of the OBD-II readings. It is the rate of change and the amount of change to the throttle opening that is used as an input to determine "highway mode". Sometimes the voltage is converted to degrees of opening for various tables.

Paul
 
Perhaps I should look at getting the readings from the OBD-II port. There are libraries in arduino for reading various OBD-II parameters and one which is included is the throttle position. http://arduinodev.com/hardware/obd-kit/
The teensy 2 is small enough to embed into an OBD connector. The code portion is way over my head but perhaps it is time to learn something new.

Paul
 
I briefly looked at the library code. Looks like it should work as-is on Teensy 2.0.

For Teensy++ 2.0 or Teensy 3.0, it will probably work if you edit this part in ODB.h:

Code:
#ifndef OBDUART
#if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega644P__)
#define OBDUART Serial1
#else
#define OBDUART Serial
#endif
#endif

On all Teensy boards, Serial1 is the first hardware serial port. That list doesn't include checks for Teensy++ 2.0 and Teensy 3.0. The simplest way to just make it work would be the change both cases to "Serial1".
 
Thank you Paul!
Just to clarify, can I use the teensy2 to read directly from the OBD-II port or do I need additional hardware? I will use a basic OBD connector to physically connect the teensy to the port.
I do have spare ecus that I will use while testing.

Paul
 
I would most certainly stay away from taking signals directly from the ETC. Older ETCs use a normal dual track potentiometer for feedback of the throttle blade position, more recent versions use a Hall sensors for contact less feedback. The throttle blade is usually driven through a couple of gears by a PWM controlled DC motor with at least a 12bit resolution.

The whole control loop as in many industrial solutions relies on a finely tuned PID loop.
Due to the very high safety impact of these devices everything in manufacturing has to be traceable including test data. These devices 100% End-of-line function tested.

Be very careful with what you are doing!!!
 
This car does not have an ETC. It is a "drive by wire" throttle body, there is no motor or gears involved. There is no input from the ecu to control the throttle, it is linkage and wire. The throttle position sensor is a pot.
I understand your concerns and I appreciate your voicing them. I already collect this data and use it to modify the maps in the ecu rom. What I want to do is to collect only the throttle position changes, compare them, and then based on the amplitude/frequency of the changes ground a pin on the ecu to switch maps. I can change maps using a switch but I want to change from "performance" to "economy" using the teensy 2.
Paul
 
Doh! Sometimes, okay most of the time I am an idiot. You are correct, this is not a drive-by-wire. Time for some warm milk then bed.

Thanks again for your comments!

Paul
 
I think that I should look at one approach at a time.

How can I "tap" into the throttle position sensor without affecting the voltage sent to the ecu?

I am able to log the TPS voltage through the OBD-II port and my tuning/logging software to check if there is a voltage difference.

Thank you,

Paul
 
Last edited:
Status
Not open for further replies.
Back
Top