Throttle Signal Position


UselessPickles

New Member
I thought we were talking about the throttle position sensor, not the tach. :confused:
We were, but then this happened:

I would look into sensing the tachometer output with one of the A/D channels, then you can drive your LEDS with one/many digital outputs.
As for the throttle signal, it's pretty easy. Just splice a wire into the TPS wire somewhere, connect it to an analog input pin of the hardware, and now you can read the throttle position as a number ranging from 0 to 1023 (assuming 10-bit ADC, which is common).

The catch is that the TPS signal does not cover the whole range of 0-5 volts. You have to calibrate the TPS signal somehow so that your code knows that, for example, 0% throttle is a digital value of 117 and 100% throttle is a digital value of 723. The exact range will vary from bike to bike (this is why you need to calibrate the throttle for a Power Commander).

I included some calibration code in my device that runs upon startup if there is a throttle reading over 512 for a full second. It stores the highest value read as the max throttle position. Then it waits for the throttle to drop below 512 for a full second and records the lowest value read. Some basic math can then convert any raw throttle position reading into a value ranging between 0 and whatever I want to use as my max throttle value.

That's once place where microcontroller programming becomes fun. You want to avoid floating point math if at all possible because they have no hardware floating point math support. The compiler will happily allow you to using floating point math, but it is all done in software. this means that a large chunk of your precious limited program memory on the chip is now used up with all the code necessary to perform floating point math operations. So you try to stick to integers. If you need more precision than whole numbers, then you can use integers as "fixed point" numbers and deal with the complications of fixed point integer math, including the limited sizes of integers. You have to be careful to ensure that the numbers you will be working with will not overflow when multiplying, etc.
 

Rhinotjv

New Member
We were, but then this happened:



As for the throttle signal, it's pretty easy. Just splice a wire into the TPS wire somewhere, connect it to an analog input pin of the hardware, and now you can read the throttle position as a number ranging from 0 to 1023 (assuming 10-bit ADC, which is common).

The catch is that the TPS signal does not cover the whole range of 0-5 volts. You have to calibrate the TPS signal somehow so that your code knows that, for example, 0% throttle is a digital value of 117 and 100% throttle is a digital value of 723. The exact range will vary from bike to bike (this is why you need to calibrate the throttle for a Power Commander).

I included some calibration code in my device that runs upon startup if there is a throttle reading over 512 for a full second. It stores the highest value read as the max throttle position. Then it waits for the throttle to drop below 512 for a full second and records the lowest value read. Some basic math can then convert any raw throttle position reading into a value ranging between 0 and whatever I want to use as my max throttle value.

That's once place where microcontroller programming becomes fun. You want to avoid floating point math if at all possible because they have no hardware floating point math support. The compiler will happily allow you to using floating point math, but it is all done in software. this means that a large chunk of your precious limited program memory on the chip is now used up with all the code necessary to perform floating point math operations. So you try to stick to integers. If you need more precision than whole numbers, then you can use integers as "fixed point" numbers and deal with the complications of fixed point integer math, including the limited sizes of integers. You have to be careful to ensure that the numbers you will be working with will not overflow when multiplying, etc.
Wow I feel stupid now!
 

FitZ6R

Member
Here's what I'm thinking:

Buffer the TPS signal and send it to a pair of amps driving red and yellow LED strips (rear-facing, eg., under the tail section). If the offset and gain of the drivers are slightly different, this will produce a "flame-like" brightness and color shift, from dim red to bright orange, as the thottle is revved. Could be implmented pretty simply with a few op-amps (yeah, I'm an old school analog kinda guy).
 

Attachments

DubiousDrummer

New Member
So after playing around with the bike all day Saturday, I wasn't successful. :mad:

I tried hooking a potentiometer to the actual throttle piece itself (the one that opens and closes as you twist on the throttle). But, there just isn't enough space on this part of the bike to get it to work. As far as a "throttle signal wire", I don't know where I could find one, or what it would look like. I'm at a loss. You all gave some really good advice, but unfortunately I still feel a little too uninformed. I just don't know where to go with this mod anymore.

Thanks for all of the helpful tips, though, guys. And if anyone else can get it to work or has another idea, please let me know.
 

FastFreddy

New Member
TPS affects the acceleration enrichment mainly.

I haven't seen the Yamaha maps, but typically the load is calculated based on RPM, Temp, TPS and Manifold Pressure (or sometimes MAF sensor), then that all gets multiplied into a load factor for the final load vs rpm map.

Buy off the shelf for this.
 

Sneakynuts

New Member
We were, but then this happened:



As for the throttle signal, it's pretty easy. Just splice a wire into the TPS wire somewhere, connect it to an analog input pin of the hardware, and now you can read the throttle position as a number ranging from 0 to 1023 (assuming 10-bit ADC, which is common).

The catch is that the TPS signal does not cover the whole range of 0-5 volts. You have to calibrate the TPS signal somehow so that your code knows that, for example, 0% throttle is a digital value of 117 and 100% throttle is a digital value of 723. The exact range will vary from bike to bike (this is why you need to calibrate the throttle for a Power Commander).

I included some calibration code in my device that runs upon startup if there is a throttle reading over 512 for a full second. It stores the highest value read as the max throttle position. Then it waits for the throttle to drop below 512 for a full second and records the lowest value read. Some basic math can then convert any raw throttle position reading into a value ranging between 0 and whatever I want to use as my max throttle value.

That's once place where microcontroller programming becomes fun. You want to avoid floating point math if at all possible because they have no hardware floating point math support. The compiler will happily allow you to using floating point math, but it is all done in software. this means that a large chunk of your precious limited program memory on the chip is now used up with all the code necessary to perform floating point math operations. So you try to stick to integers. If you need more precision than whole numbers, then you can use integers as "fixed point" numbers and deal with the complications of fixed point integer math, including the limited sizes of integers. You have to be careful to ensure that the numbers you will be working with will not overflow when multiplying, etc.
This is my thought on this! :)
 

Attachments

Scott_Thomas

Insert title Here
Elite Member

SurfJunkie

New Member
Its nothing too complicated. Hes just talking about writing some basic software and compiling it for your own IC to basically perform or store a look up table. There are just multiple types of calculations and types of math you can use depending upon the application.

It would make more sense to go off the tach instead of the TPS. Higher RPMs = activate more LEDs. so as you down shift/upshift, you would get quite the light show.

With a factory service manual, multimeter, an arduino board / raspberry pi and some decent computer programming knowledge, this should be easy to accomplish.
 



Top