Finished Fly by wire throttle control

Showcase your projects! We love to see what people come up with, so please share your creations here.
rameses32
Posts: 18
Joined: Sat Nov 05, 2011 11:49 am

Finished Fly by wire throttle control

Post by rameses32 » Sat Oct 12, 2013 12:11 pm

I finally finished the fly by wire throttle controller I designed for four engines at a TAFE NSW, vocational institute Grafton. Attached is the schematic and link to a video on you-tube. It took me a lot of hours to work the software out to be smooth, consistent, and quick in response. In the end it is very simple, yet performs quite complexly.
http://youtu.be/IJv_XWXhRig
int potpin = A0;
int tps = A1;
int val1;
int val2;
int val3;
int led = 13;

void setup() {

  TCCR2B = TCCR2B & 0b11111000 | 0x01;       //sets PWM to 32 KHz
digitalWrite(led, HIGH); //turns LED in front panel on, letting you know the Arduino is running
}

void loop() {
 
  val1 = analogRead(potpin); //reads POT position
  val2 = analogRead(tps); //reads TPS position
  val1 = map(val1, 1023, 0, 0, 1023); //sets POT Value between 0 and 1023, actually reverses the pot
  val2 = map(val2, 862, 59, 0, 1023); //sets TPS Value between 0 and 1023
  
  while(val2 < val1) { //routine if POT is ahead of TPS
  if (val2 < 340) {
   analogWrite(3, 60); //writes a PWM signal of 60 to pin 3 for first 3rd of throttle opening to smooth out low throttle settings
  }
  if (val2 > 339 && val2 < 680) {
   analogWrite(3, 90); //write a PWM signal of 90 to pin 3 for middle 3rd of throttle positioning, this speeds up throttle response
  }
  if (val2 > 679) {
   analogWrite(3, 120); //write a PWM signal of 120 to pin 3 for remainer of throttle positioning, this speeds up throttle response even faster
  }                                          //by limiting the PWM to an out put of 120, it regulates the output voltage to a maximum of 5 volts from the TIP120 attached
  val1 = analogRead(potpin); //reads inputs for comparison in while loop
  val2 = analogRead(tps);
  val1 = map(val1, 1023, 0, 0, 1023);
  val2 = map(val2, 862, 59, 0, 1023);
   }
   
   while(val2 > val1) { //routine if TPS is ahead of POT
  analogWrite(3, 0); //sends a 0 to Pin 3 to turn off motor
  val1 = analogRead(potpin); //reads inputs for comparison in while loop
  val2 = analogRead(tps);
  val1 = map(val1, 1023, 0, 0, 1023);
  val2 = map(val2, 862, 59, 0, 1023);
  }
}




Attachments
throttle2.jpg

rameses32
Posts: 18
Joined: Sat Nov 05, 2011 11:49 am

Re: Finished Fly by wire throttle control

Post by rameses32 » Sat Oct 12, 2013 12:11 pm

I just realized the diode goes before the Electrolytic cap on the 12v input, the diode is the reverse polarity protection, if it came after the cap, it would protect the Arduino, but the cap would explode,lol. I only drew it this way in the schematic, I built it correctly. Also, do not leave out the diode across the motor terminals, i tried it without it and let the smoke out of a TIP120.
Charle

rameses32
Posts: 18
Joined: Sat Nov 05, 2011 11:49 am

Re: Finished Fly by wire throttle control

Post by rameses32 » Sat Oct 12, 2013 12:19 pm

I just realized by studying my code, that if I would have used a logarithmic potentiometer I could have eliminated even more of the code, oh well, live and learn:)
Charley

andrew
Freetronics Staff
Freetronics Staff
Posts: 978
Joined: Sun Jul 14, 2013 7:06 am
Location: Melbourne, Australia
Contact:

Re: Finished Fly by wire throttle control

Post by andrew » Mon Oct 14, 2013 2:20 am

Well done, it's always interesting to see such things :)

Pogo
Posts: 6
Joined: Thu Dec 19, 2013 6:49 am

Re: Finished Fly by wire throttle control

Post by Pogo » Fri Dec 20, 2013 3:14 am

rameses32 wrote:I just realized by studying my code, that if I would have used a logarithmic potentiometer I could have eliminated even more of the code, oh well, live and learn:)
Charley
Maybe, Charley. Log pots aren't log, they are a few different rate linear segments linked together. The steps might be as much effort to overcome as writing your own linear to log code.

Pogo.

mattechperf
Posts: 2
Joined: Sat Dec 21, 2013 6:40 pm

Re: Finished Fly by wire throttle control

Post by mattechperf » Sun Dec 22, 2013 1:36 am

rameses32 wrote: val2 = map(val2, 862, 59, 0, 1023); //sets TPS Value between 0 and 1023
[/quote]

Great work! I've been curious to see if someone's been working on this.
Does the TPS value of 862-59 come from measurement on that specific throttle body or does it seem be consistent for any using a 5V setup?

mattechperf
Posts: 2
Joined: Sat Dec 21, 2013 6:40 pm

Re: Finished Fly by wire throttle control

Post by mattechperf » Sun Dec 22, 2013 1:36 am

Great work! I've been curious to see if someone's been working on this.
Does the TPS value of 862-59 come from measurement on that specific throttle body or does it seem be consistent for any TB using a 5V setup?

rameses32
Posts: 18
Joined: Sat Nov 05, 2011 11:49 am

Re: Finished Fly by wire throttle control

Post by rameses32 » Mon Apr 14, 2014 9:07 am

It is specific to that model of Throttle Body and would need to be tuned slightly for any other. Actually If I remember correctly, when I designed it I had one model but the ones on the engine were a different model and it took a slight modification, but only minor.

C4Vette
Posts: 1
Joined: Mon Jun 05, 2017 2:09 pm

Re: Finished Fly by wire throttle control

Post by C4Vette » Mon Jun 05, 2017 2:20 pm

Ok, ok, I know: Very OLD topic :lol:
But this sketch helped me to start my own, so thanks for posting!

I tried to make it smoother but did not succeed 100% due to the simplicity of the sketch and electronics. But did succeed partly and brushed up the readability:

Code: Select all

int potpin = A0;
int tpspin = A1;
int POT = 0;
int TPS = 0;
int Start = 200;
int Stop = 950;

void setup() {
  TCCR2B = TCCR2B & 0b11111000 | 0x01;  //sets PWM to 32 KHz
}

void loop() {
  while(TPS <= POT) {                    //routine if POT is ahead of TPS
    analogWrite(3, 185);                 //write a PWM signal to pin 3
    POT = analogRead(potpin);            //reads inputs for comparison in while loop
    TPS = analogRead(tpspin);
    TPS = map(TPS, Start, Stop, 0, 1023);
  }
   
  while(TPS >= POT) {                    //routine if TPS is ahead of POT
    analogWrite(3, 0);                   //sends a 0 to Pin 3 to turn off motor
    POT = analogRead(potpin);            //reads inputs for comparison in while loop
    TPS = analogRead(tpspin);
    TPS = map(TPS, Start, Stop, 0, 1023);
  }
}
My throttle body needed some more power; higher percentage duty-cycle and the mapping needed changing.
https://youtu.be/DqV14BKRVg4

clibin009
Posts: 329
Joined: Mon Oct 23, 2017 2:57 am

Re: Finished Fly by wire throttle control

Post by clibin009 » Mon Oct 23, 2017 4:45 am

clb1023
cheap jordan shoes
cheap oakley sunglasses
cheap ray ban sunglasses
ugg boots
uggs outlet
coach outlet store
supreme shirts
adidas shoes
canada goose outlet
coach outlet online
cheap jordan shoes
red bottom
coach outlet online
polo ralph lauren
oakley sunglasses outlet
pandora jewelry
pandora jewelry
coach outlet online
mulberry
michael kors outlet canada
coach outlet store
canada goose coats
nike sneakers
oakley sunglasses outlet
michael kors bags
adidas sneakers
pandora charms
cheap jordan shoes
michael kors outlet online
canada goose jacket
cheap jordan shoes
polo ralph lauren outlet online
michael kors handbags outlet
harden shoes
fred perry polo shirts
ray ban sunglasses sale
ugg boots sale
moncler outlet online
coach outlet online
ugg shoes
valentino
pandora charms sale clearance
uggs outlet
moncler outlet online
louis vuitton outlet online
michael kors
air max shoes
christian louboutin shoes
coach outlet store online
ugg boots women
ray ban sunglasses outlet
ugg
ugg boots
nike outlet
cheap ray ban sunglasses
ugg outlet
canada goose sale
ray ban sunglasses outlet
michael kors outlet online
jordan shoes
hermes bags
canada goose jackets
burberry outlet online
coach outlet online
longchamp bags
mlb jerseys
coach outlet online
coach outlet
michael kors outlet online
supreme uk
pandora charms
the north face outlet
cheap air jordans
canada goose jackets
canada goose coats
timberland outlet store
ralph lauren outlet online
ugg boots
yeezy boost 350
pandora outlet
michael kors outlet canada
north face outlet
mlb jerseys
air max
uggs
ralph lauren outlet online
michael kors
jerseys cheap
cheap jordans
canada goose outlet
coach outlet online
supreme clothing
michael kors
michael kors outlet store
coach outlet online
salvatore ferragamo outlet
michael kors outlet clearance
burberry handbags
air jordans
coach factory outlet online
retro 11
ugg outlet online
pandora charms sale clearance
louis vuitton outlet store
longchamps
louis vuitton outlet online
nfl jerseys
ugg outlet online
canada goose outlet
cheap nfl jerseys wholesale
polo ralph lauren
canada goose jackets
tory burch shoes
toms
uggs outlet
ugg boots on sale
christian louboutin shoes
michael kors outlet online
ralph lauren outlet
cheap uggs
uggs outlet
adidas outlet online
cheap ugg boots
ray ban sunglasses discount
moncler jacket
nike outlet online
michael kors outlet online
coach factory outlet online
ray ban sunglasses outlet
christian louboutin sale
uggs outlet
birkenstock shoes
hermes bags
michael kors outlet store
nike shoes
pandora jewelry outlet
canada goose outlet
uggs
uggs outlet
louis vuitton outlet
uggs clearance
louboutin outlet
moncler uk
cheap ugg boots
ugg boots outlet
ugg outlet
coach factory outlet
adidas superstar shoes
coach outlet online
adidas nmd runner
pandora jewelry outlet
adidas outlet store
canada goose coats
adidas nmd r1
ralph lauren outlet online
discount oakley sunglasses
ugg outlet
toms
coach purses
birkin handbags
ralph lauren outlet online
kate spade outlet
michael kors outlet online
pandora charms
yeezy shoes
coach factory outlet online
michael kors outlet store
canada goose uk
michael kors outlet clearance
burberry outlet online
canada goose jackets
uggs outlet
air jordan shoes
burberry outlet online
ray ban sunglasses cheap
ugg boots
hermes handbags
nike outlet store
uggs outlet
moncler coats
ugg boots
red bottom heels
coach outlet online
cheap ugg boots
moncler jackets
cheap ugg boots
bottes ugg
uggs outlet
polo ralph lauren outlet
ugg outlet store
coach outlet online
ralph lauren sale
toms shoes
ralph lauren
fred perry shirts
pandora charms sale
canada goose outlet online
moncler
adidas superstars
pandora uk
ugg boots outlet
cheap ugg boots
coach outlet online
coach factorty outlet online
louis vuitton factory outlet
canada goose parka
nike cortez classic
uggs outlet
moncler coats
burberry outlet online
cheap oakley sunglasses
ugg boots
polo ralph lauren outlet online
longchamp bags
coach outlet online
kate spade outlet online
coach factorty outlet online
coach factory outlet online
adidas yeezy boost
toms
nike outlet store online
coach factory outlet online
birkenstock outlet
coach outlet store
ugg boots outlet
coach outlet store online
michael kors outlet online
coach factory outlet
ralph lauren outlet
mbt
ugg boots
nike shoes
coach outlet online
ugg boots
north face outlet
polo ralph lauren outlet
canada goose outlet
canada goose
coach factory outlet online
kate spade outlet online
longchamp outlet
kate spade outlet online
polo ralph lauren outlet online
pandora charms outlet
adidas outlet online
coach factory outlet online
hermens
kate spade handbags
pandora charms outlet
columbia sportswear outlet
nike huarache shoes
uggs outlet
polo ralph lauren outlet
moncler sale
mulberry handbags
moncler
adidas nmd r1
canada goose coats
moncler jackets
moncler sale
air max
coach outlet store online clearance
burberry handbags
michael kors outlet store
caterpillar boots
yeezy boost 350
moncler sale
michael kors outlet clearance
uggs outlet
ralph lauren sale clearance uk
ugg sale
moncler coats
coach outlet canada
michael kors uk
coach outlet online
ugg boots clearance
ugg outlet
pandora jewelry store
cheap air jordans
coach outlet online
canada goose jacket
nmd adidas
coach factory outlet online
adidas outlet store
canada goose coats
ray bans
air jordans
coach factory outlet online
cheap nike shoes
ugg sale
pandora charms sale clearance
moncler coats
louis vuitton factory outlet
polo ralph lauren outlet
ralph lauren sale clearance uk
burberry outlet
michael kors outlet store
adidas ultra boost
michael kors outlet online
toms
ugg slippers
adidas nmd r1
coach outlet online
louboutin outlet
louboutin shoes
canada goose jackets
coach factory outlet online
louis vuitton factory outlet
canada goose outlet
michael kors bags
north face jackets
cheap ray bans
ugg australia
cheap nfl jerseys
uggs clearance
jordans
cheap uggs
adidas yeezy boost
cheap ray ban sunglasses
coach factory outlet
ugg boots
canada goose sale
coach factory outlet
polo outlet online
adidas store
canada goose sale
canada goose outlet
ray ban glasses
yeezy shoes
birkenstock
air jordan retro
cheap uggs
timberland outlet
mlb jerseys whgolesale
adidas nmd runner
coach outlet online
coach outlet canada
canada goose jackets
ugg boots clearance
ugg outlet online
michael kors outlet clearance
canada goose jackets
discount ray ban sunglasses
pandora charms outlet
canada goose sale
uggs outlet
coach outlet online
polo ralph lauren outlet
birkenstock uk
ray ban sunglasses discount
longchamp sale
ugg boots
michael kors outlet store
canada goose jackets
canada goose clothing
cheap jordan shoes
canada goose jackets
yeezy boost
michael kors outlet clearance
uggs
canada goose sale
christian louboutin sale
ugg boots outlet
red bottoms
ugg boots outlet
uggs on sale
canada goose jackets
adidas yeezy boost 350
ralph lauren uk
uggs outlet
cheap ugg sale
moncler jackets
coach factory outlet
christian louboutin shoes
yeezy boost 350
ferragamo shoes
uggs outlet
canada goose uk
gucci outlet online
ugg outlet store
cheap ugg boots
fitflops sale clearance
nike outlet online
nike outlet store
canada goose sale
uggs outlet
cheap air jordans
canada goose jackets
moncler outlet online
mulberry outlet uk
north face jackets
louis vuitton outlet store
ugg boots
coach factory outlet online
valentino outlet
ralph lauren sale
louis vuitton outlet online
yeezy shoes
ferragamo outlet
canada goose
pandora
canada goose coats
hermes outlet
coach factory outlet online
the north face outlet
polo ralph lauren outlet online
uggs outlet
coach outlet online
kate spade handbags
ugg outlet
ray ban glasses
michael kors outlet clearance
ralph lauren sale
hermes bag
longchamp outlet store
harden vol 1
pandora charms
polo ralph lauren outlet
burberry outlet online
michael kors outlet online
ugg boots
ugg canada
ralph lauren outlet
burberry handbags
tory burch outlet online
polo ralph lauren outlet
michael kors
canada goose jackets
fitflop sandals
coach outlet store
polo ralph lauren outlet
salvatore ferragamo shoes
ray bans
adidas yeezy shoes
coach outlet online
gucci outlet
coach handbags outlet
christian louboutin shoes
pandora charms outlet
ralph lauren
nike air max 2018
mbt
coach outlet online
kate spade handbags
cheap oakley sunglasses
louis vuitton handbags
christian louboutin shoes
michael kors outlet store
moncler pas cher
moncler outlet online
ray bans
kate spade outlet
cheap jordans for sale
nike sneakers
tory burch outlet online
toms outlet
ugg on sale
coach outlet online
ugg outlet
mulberry uk
cheap jordans free shipping
coach outlet store online
clb1023

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest