Re: active aero project

TheEngineer wrote:

I also need to figure out exactly what kind of motor the headlight motors are, and how to control them.

I see you googling for "low side mosfet" (N-type MOSFET) in the near future...

Re: active aero project

So i did figure out the motors. They are just DC motors that are able to be driven either way by flipping the voltage. I have a funny feeling if i rip open the concealed headlight control module i'm going to find two H-Bridges in there. Or just one and i'll curse and try and find another.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

Re: active aero project

russian wrote:

Oh, consider simplifying your design and using GPS data instead smile

Only an engineer would consider that a simplification...

Quad4 CRX - Wartburg 311 - Civic Wagovan - Parnelli Jones Galaxie - LS400 - Lancia MR2 - Boat - Sentra - 56 Ford Victoria
Known Associate of 3pedal Mafia, Speedycop, and the Russians.  Maybe even NSF.

Re: active aero project

http://www.racesharks.com/images/sharks-2.jpg

The Sharks aka Very Important Peasants, a California team with a ghettocharged 5-Series, at one point rigged up an active-aero rear wing setup that used GPS-determined location to control wing angle. In theory, it sounded like a great idea (actually, it sounded like a really stupid idea, but that's the Sharks); in practice, it resulted in a wing that sort of flapped up and down more or less at random. In fact, it did a lot of actuation while parked at the gas station five miles from the race track.

What you need is the Hillbilly Wing.

30 (edited by Maxzillian 2013-09-24 09:54 PM)

Re: active aero project

TheEngineer wrote:

So it's kind of working. Something is screwy though, because it seems to disconnect and reconnect to the computer about every time it goes through the main loop. I'm sure i'm just being stupid. But it's actually working. I have a basic servo motor hooked up and it's responding as I request when I meet the conditions.

I'm using a real throttle body, a push button to simulate brake pressure switch, and a potentiometer to simulate steering. I have a half second delay built into the end of the loop to try and keep the serial readout on the computer screen readable.

The below is written in whatever language arduino uses in their standard program. And for anyone that actually does coding, I apologize now for what i'm sure are some serious flaws in structure and approach. I'm sure there is a much better way to do this than a bunch of if loops, but it's just how I started. Wing angles are arbitrary.

*
  Active_Aero 
*/
#include <Servo.h>

// create servo object to control a servo
Servo wing1;   
//variable declaration
int led = 13;
int wing;
int throttle;
int brake;
int steer;
int thottleThresh = 90;


// the setup routine runs once when you press reset:
void setup() {
  //LED setup and on, because I can
  pinMode(led, OUTPUT);
  digitalWrite(led, HIGH);
  // attaches the servo on pin 9 to the servo object
  wing1.attach(9); 
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);


}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0 (Throttle Position):
  throttle = analogRead(A0);
  // read the input on analog pin 1 (Brake pressure);
  brake = analogRead(A1);
  // read the input on analog pin 2 (Steering Possition);
  steer = analogRead(A2);
 
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  // Throttle
  float throttlePos = ((4.4 - (throttle * (5.0 / 1023.0))) / (4.4 - 1.3))*100;
  // Brake
  float brakePres = (brake * (5.0 / 1023.0));
  // Steering
  float SteeringPos = (steer * (5.0 / 1023.0));

 
 
  // controling rear wing
  // change wing if throttle goes high and steering straight
  if ((throttlePos > thottleThresh) && (2 < SteeringPos < 3)) {
    wing1.write(0);
  }
  //air brake if steering straight and brakes go high
  else if ((2 < SteeringPos < 3) && (brakePres > 4.9)) {
    wing1.write(180);
  }
  //lift wing if turning
  else if ((brakePres < 4.9) && (SteeringPos > 3)) {
    wing1.write(80);
  }
  else {
    wing1.write(40);
  }
 
  // print out the value you read:
  Serial.println("Brake");
  Serial.println(brakePres);
  Serial.println("Wing");
  Serial.println(wing);
  Serial.println("throttle");
  Serial.println(throttlePos);
  Serial.println("steer");
  Serial.println(SteeringPos);
  delay(500);
}

For posterity I suggest setting the input pinmodes for the analog inputs. I also suggest just sticking with the raw analogRead values rather than converting them to percentage and voltage. I know it makes some of the later code easier to read, but it wastes RAM (not really a problem here) on the Arduino and makes the code slower to run. I just make notes in the code to correlate analogRead values to something that makes sense. IE: 800 on throttle position is 4 volts...

Finally, I think the brunt of your problem is nesting if statements together such as " if ((throttlePos > thottleThresh) && (2 < SteeringPos < 3)) {" I know many people say this can be done, but I've had very little luck making it work. My opinion is you're just better off saving the headaches and make a tree:

if (throttlePos > throttleThresh) {
  if (2 < SteeringPos) {
    if(SteeringPos < 3) {
      wing1.write(0);
    }
  }
} else if(....

Otherwise I find the only way I can get nested statements to work is if I use less than/greater than or equal comparisons:

if ((throttlePos >= throttleThres) && (2 <= SteeringPos <= 3))

Still, I have little faith in those methods.

Edit: Also for a neat trick if you're using windows HyperTerminal to read data from the Arduino, add this line to the top of your serial commands:

Serial.print("\033[2J");

This will clear the screen so you don't get a constantly scrolling wall of text. Instead with each loop it'll clear the screen and reprint all the information, keeping everything in the same place.

Team Fall Guy Stuntman Association - 1989 Ford Escort - Gator-O-Rama Feb 2010

That Looks About Right (TLAR) Motorsports - 1983 Dodge Challenger - In Build

Re: active aero project

The nested statements appear to be working, but if the other method has been more reliable I will certainly give it a shot.

The reason I have everything converted is I did that first before I got into the control side. Making sure I could read the inputs was goal #1, and it just made more sense if i could see throttle on a range of 0-100, and steering/brakes on a scale of 0-5. Once I have everything working I plan on going back and re-writing the whole program to clean it up and remove the excess that won't be important when it's installed on the car.

And thank you for the serial trick. that will make life much much easier.


I spent a lot of last night thinking i had killed my servo motor, and trying to figure out what was wrong. Turns out I just missed the detail that when you power motors with an external power supply you need to make a common ground between the supply and the arduino. Hooray more basic stuff I was clueless on.

As far as moving to real hardware, The headlight control module only has a single H-Bridge in it as i feared, so i'm just going to buy different ones that will take up far less space than two of those modules. The motors themselves suck incredible amounts of power. I normally leave the current knob on that power supply no higher than half. But the motors were railing it, and continued to do so as I increased it. Based on how the motor sounds I think i need to rebuild them. 24 year old motors that have been sitting in the elements for most of their life, probably need a little refresh.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

Re: active aero project

Well, if the IF statements are confirmed working, I wouldn't touch them. I suspect my problem has something to do with the version of programming software I'm running, the type of Arduino board or a combination of the two. I'm just suggesting that if you do run into logic problems, check there first. wink

I'm confused about the H-bridge though. Why would each motor need more than one? I was under the impression that one H-bridge can control a motor in either direction.

Team Fall Guy Stuntman Association - 1989 Ford Escort - Gator-O-Rama Feb 2010

That Looks About Right (TLAR) Motorsports - 1983 Dodge Challenger - In Build

Re: active aero project

Two motors. This is going to be a split rear wing, with each half moving independently, so I need a bridge for each motor. I just haven't written the code up that way yet. I'm moving in baby steps.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

Re: active aero project

I have nothing technical to add, but I'm looking forward to being amused by seeing this in action on track!

Chris from 3 Pedal Mafia

Re: active aero project

TheEngineer wrote:

Two motors. This is going to be a split rear wing, with each half moving independently, so I need a bridge for each motor. I just haven't written the code up that way yet. I'm moving in baby steps.

Gotcha. For some reason I was reading it as though the headlight control module as a part of each headlight assembly. In hindsight I'm not sure why I thought that.

Team Fall Guy Stuntman Association - 1989 Ford Escort - Gator-O-Rama Feb 2010

That Looks About Right (TLAR) Motorsports - 1983 Dodge Challenger - In Build

Re: active aero project

Sonic wrote:

I have nothing technical to add, but I'm looking forward to being amused by seeing this in action on track!

Unfortunately I won't have it done before October. Between work probably shipping me out west for most of October, and just general life, the actual building of the wing and physical pieces will move slow.

But you never know. I may get super ambitious and just not sleep for a weekend to make it happen.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

Re: active aero project

I'm still working on this. Life has just been crazy lately. I'm off from work between christmas and new years, so while I'm down visiting family I think I'm going to make use of my dad's tools to make the wing itself. Trying to wrap up the basic shape and design of the wing mounting this week.

Once the wing is done I can finalize the mounting structure on the car. I need to figure out where exactly i'm mounting this. But my thought was about midway up the rear hatch, and mounted to the hatch itself so it can still be opened.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

Re: active aero project

This might help with your wing design (if you're not already done with it): https://www.grc.nasa.gov/www/K-12/airplane/foil3.html

Don't skimp on your wing mounts.  I made our first mounts from steel scraps left over after a garage door installation.  They were pretty close to total failure after about 5 races.

~Van

13X losers (or is 14 now?) refusing to learn from our failures.
Organizer's Choice!  Trophy should have a bottle opener on it.

Re: active aero project

Make the rear hatch the wing.

Set the hydraulic ram so that the lower the speed the higher the hatch goes.

Then paint the car all yellow with some eyes on the roof and it will look like Pac-Man opening and closing his mouth (only going backwards).

"She's a brick house" 57th out of 121 and 5th in Class C, There Goes the Neighborhood 2013
"PA Posse" 21st out of 96 and 2nd in Class C, Capitol Offense 2013.
"PA Posse" 29th out of 133 and Class C WINNER, Halloween Hooptiefest 2013
"PA Posse" 33rd out of 151 and 2nd in Class C, The Real Hoopties 2013

Re: active aero project

I've been using that app actually. It's been helpful.

Won't be skimping on mounts. Since i'm doing the split wing i'll need the mounts to be more sturdy than normal since the wing itself won't add as much stiffness.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

41 (edited by TheEngineer 2013-12-19 05:59 AM)

Re: active aero project

Started playing with solidworks trying to figure out where to place the wing. What i've learned is my desktop is really getting old. Solidworks won't use the GPU for simulation calculations, and I'm running one of the first quad core intel chips still.

anyway, only got through one run last night by the time I had made a crappy model of the daytona, modeled the wing profile, and re-learned how to use flow works.

Pressure Plot
https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-ash3/1523832_342279335913970_1929632352_o.jpg

Velocity
https://scontent-b.xx.fbcdn.net/hphotos-ash3/1522761_342279332580637_215575742_o.jpg

view of the full car. I think i need to refine the car model slightly, considering i spent 30 seconds creating it.
https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-prn2/1524488_342270882581482_812913834_o.png

Somewhere I think i should be able to get solidworks to give me resultant force on the surfaces to confirm the theoretical downforce/drag numbers from foilsim. Just ran out of time last night. Not that you should ever believe solidwork's numbers 100%.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

Re: active aero project

actually, I just did some quick math. The pressure plot shows roughly 14.76psi on top of the wing, and 14.64psi under it. difference of .12psi. The wing is currently set at 5ft wide and 1.7ft chord, for an area of 8.5 ft^2. That pressure difference over that area gives a force of 146lbs. Foilsim said 154lbs. They should be different because foilsim doesn't assume a car next to it changing the airflow.

Obviously that's a super simplified back of the napkin calculation. But at least everything is in the same ballpark.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

Re: active aero project

Traditional placement is better for flow patterns, but the pressure differential on the wing isn't as good.

https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-ash3/1512226_342541015887802_868789833_o.jpg


I need to setup a bunch of configurations and just run them this weekend to find the best placement and angle combination.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

Re: active aero project

So is that going to be the downforce at rest then have it flip up into drag mode on the inside to help rotate the car? What happens to the downforce when it goes into drag mode? Are you worried about it making the rear end unstable at all?

-Killer B's (as in rally) '84 4000Q 4.2V8. Audis never win?

45 (edited by TheEngineer 2013-12-19 10:39 AM)

Re: active aero project

There are 4 states for the wing.
1. Normal position will be a balance between added downforce and low drag. This will be the default position when the active controls are off, or for normal driving.
2. Low Drag, on a straight the wing will lay back to the optimal angle for least amount of drag.
3. Braking, the wing will flip up almost vertical to be an air brake.
4. Cornering, the inside half will flip up to a higher downforce angle.

For cornering it won't be a drag only mode, just a higher downforce setting. I'm looking more to help fight body roll than i am to help turn in. The max downforce angle also has higher drag, which is why i'm not making that the default angle. If I program this right the transitions should be smooth and hopefully they won't upset the car.

The only times the wing will fall out of of downforce generation is straight-line braking and straight-line travel. If the steering wheel is turned the wing won't go into either of those modes so you won't lose downforce in any kind of turn.

And I do plan on adding a splitter to the front to match so i'm not just loading the rear on my FWD car.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

Re: active aero project

This is one of the reasons that I'm really starting to Love Lemons racing.  It's an enviroment that promotes creativity and nurtures those that stray from the norm.  Also gives a way to test the ideas without breaking the bank( and having a blast with your friends). 

Kudos for trying this out, at the very least it should be a fun way to learn.  If you need any parts machined or fabbed, I would be happy to help out, only cost you materials and shipping. 

Good luck on the project.

Pete

Captain- PDank Pedal Pushers
Popped my LeMon at Chubba Cheddar 2013
'96 Camo Cavalier
www.facebook.com/pdankracing

Re: active aero project

Chris,

Figure out how much downforce a 5' x 5' wing on the roof of a 93 Mustang generates.  I was guessing about 200 pounds until I saw your previous post and your wing is approximately 1/3 the surface and already generating about 150 pounds.

"She's a brick house" 57th out of 121 and 5th in Class C, There Goes the Neighborhood 2013
"PA Posse" 21st out of 96 and 2nd in Class C, Capitol Offense 2013.
"PA Posse" 29th out of 133 and Class C WINNER, Halloween Hooptiefest 2013
"PA Posse" 33rd out of 151 and 2nd in Class C, The Real Hoopties 2013

48 (edited by TheEngineer 2013-12-19 11:41 AM)

Re: active aero project

racinrob wrote:

Chris,

Figure out how much downforce a 5' x 5' wing on the roof of a 93 Mustang generates.  I was guessing about 200 pounds until I saw your previous post and your wing is approximately 1/3 the surface and already generating about 150 pounds.

I can scale my wing profile up to roughly those sizes, but unless I have the exact profile and angle of attack it's going to be a wildly inaccurate result. I'll try it anyway.

A super quick look using the foilsim app mentioned a few posts up gives me 301lbs downforce, and 165lbs drag. But just changing the angle of attack 4 dgrees changes that to 331lbs down and 200 drag. That's at 60mph BTW. At 80mph it's 537lbs down, and 294drag. remember that all these numbers are purely theoretical, and a huge number of real world factors will change them.

Go play with the foilsim app, is very user-friendly, and great for just getting an idea how different adjustments effect airfoils. when it first opens, make sure you change the size tab because it starts you off with a 5ft chord 20ft span wing. Flight is where you change your speed, and shape is where you tweak the airfoil shape.


edit: here's the link again
https://www.grc.nasa.gov/www/K-12/airplane/foil3.html

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

Re: active aero project

Pdank Pete wrote:

Kudos for trying this out, at the very least it should be a fun way to learn.  If you need any parts machined or fabbed, I would be happy to help out, only cost you materials and shipping. 

Good luck on the project.

Pete

I may just take you up on that in the spring if the local DIY place doesn't have the tools I need to make uprights. Thanks.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice

Re: active aero project

so running through a range of wing angles a range of them are claiming to create forward thrust instead of drag.

apparently i'm some sort of aero god.









ooooooor my model is messed up.

20+ Time Loser FutilityMotorsport
Abandoned E36 Build
2008 Saab 9-5Aero Wagon
Retired - 1989 Dodge Daytona Shelby 2011-2015 "Lifetime Award for Lack of Achievement" IOE, 3X I got screwed, Organizer's Choice