Wing lift force(Custom Wing Joint)

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Wing lift force(Custom Wing Joint)

Postby PJani » Sun Aug 29, 2010 2:25 am


I balanced a plane as much as possible. I am only using Lift Formula(L = 1/2 * ro * v^2 * A * C_l) and Lift Curve(polynomial) which i calculated from some data from XY plane. Later i will add lift induced drag.
The plane on video is completely uncontrolled, it just gains speed and takes off, I can only turn on or off the "Thruster" Joint.

3D model is build up from barrels and planks as you see :D
Plane weight is ~675kg(main fuselage 600kg. + three wheels each 25kg).
Main wing span is 9m. back wing span is 3m.
Tail wing has 9 degree inclination larger than main wing.

Tail wing will lift back of plane at around 31m/s(112km/h). At 33m/s(120km/h) the plane will lift. After 35m/s the plane will start to climb very fast, probably because i will need more control over my plane.

Only one thing i want to know.

If i do AddForce(...) there is no need to multiply lift force by time step, am i right?
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Wing lift force(Custom Wing Joint)

Postby Sash » Tue Aug 31, 2010 4:15 am

Imho, yes, no need to multiply, because Newton does it for you.

I also played with airplanes. But in fact I never used lift formulas - only precalculated curves.
Neither I use a joints - I'm just adding a force and torque.

The most important part (for me) to implement wimg stall characteristics depending on wing profile.


Her's my current (video a bit outdated) radio controlled helicopters project :)
Sash
 
Posts: 34
Joined: Wed Sep 30, 2009 3:38 am
Location: Novosibirsk

Re: Wing lift force(Custom Wing Joint)

Postby PJani » Tue Aug 31, 2010 11:00 am

Good work and video. :D
I have stall conditions all the time :D its hard to keep it balanced. I hope lift induced drag will help keep my plane balanced. Formula for lift induced drag is very unstable, because at ~0 air speed makes things complicated because m_dragForce is khm...LARGE. :roll:

I am using joints because i have things more modular then and i leave force callback clean. I can build anything i want, with any (JSON, XML, INFO script) or even python interpreter. :wink:
I have idea to use my wing joint for helicopter to. :D

Lift induced drag.
Code: Select all
m_dragForce = (_k * m_liftForce*m_liftForce) / (0.5 * m_roAtSL * airVel*airVel * S * 3.14 * AR);


can anyone confirm this is the right procedure for calculating absolute speed of point with offset with omega included or i am missing something? :|
Code: Select all
dMatrix chasMatrix;
dVector vel,omg;
NewtonBodyGetMatrix(GetBody0(), &chasMatrix[0][0]);
NewtonBodyGetVelocity(GetBody0(),&vel[0]);//Global velocity
NewtonBodyGetOmega(GetBody0(),&omg[0]); //Global omega

dVector absVel = vel+omg * chasMatrix.RotateVector(m_WingCOM); //absolute Wing center of mass velocity. m_WingCOM is offset from plane local 0,0,0.
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Wing lift force(Custom Wing Joint)

Postby Julio Jerez » Tue Aug 31, 2010 11:51 am

PJani wrote:
If i do AddForce(...) there is no need to multiply lift force by time step, am i right?


Hey that very cool.
Yes you are right, you do not tneed to multiply force by time.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Wing lift force(Custom Wing Joint)

Postby Julio Jerez » Tue Aug 31, 2010 11:55 am

Sash wrote:Her's my current (video a bit outdated) radio controlled helicopters project :)


wolly cow that is very cool, if it was not for teh block tha fall and take away the sence of reallity, it will look liek a movies of oen of those walmal radion control toy helicopters.
flying a helicoter if more difficult than most people think, and that one shows the same flying pattern than the toy, very cool :D
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Wing lift force(Custom Wing Joint)

Postby Julio Jerez » Tue Aug 31, 2010 12:04 pm

I like your idea of of leaving the force a tourqe to apply just gravity, and the using a joint as controller to apply the forces and torque .
That is the way Newton 2.0 is meant to be used because leads to modular and clean design, it is unfortunate that few peopl get teh concept.
Basically you can make several model ot aiplain each a joint and you cna just swap then at will.
and even f oen doe no work you can keep around for reference.

we used similar technique in a game I worked long time ago named Battle zone, where you can change vehicle engine on the fly and one vehicle can be convert into another.
when I proposed that design scheme people thought I was crassy bacase they were used to Object oriented in the sence of CPP where you make on class with one or two virtual function as the physic update.
The despiced the design and considered i was way over my head. It toot aroun ten years for people to realize what I meant at the time.

PJani wrote:Good work and video. :D
Lift induced drag.
Code: Select all
m_dragForce = (_k * m_liftForce*m_liftForce) / (0.5 * m_roAtSL * airVel*airVel * S * 3.14 * AR);


why do you divide the force by teh air speed?


Code: Select all
dMatrix chasMatrix;
dVector vel,omg;
NewtonBodyGetMatrix(GetBody0(), &chasMatrix[0][0]);
NewtonBodyGetVelocity(GetBody0(),&vel[0]);//Global velocity
NewtonBodyGetOmega(GetBody0(),&omg[0]); //Global omega
dVector absVel = vel+omg * chasMatrix.RotateVector(m_WingCOM); //absolute Wing center of mass velocity. m_WingCOM is offset from plane local 0,0,0.

your airplane stall because you are applyin teh force to a poin the is off from the center of mass.
I am assuming you are tryin to calculate some king of Aerodynamics cenet of mass tha os a funtion of teh air speed of the plain bu the expresion do no make cent to me bacuse it
calculation a velocity.
Maybe if you tell me what you wnat to do wit that exparsion, I can help more because it can no make snece of that.

In general aerodynamics forces calculate from airfoild are applyed to a center aerodynamcis center of the airfoil that varyes slightly win the shape, angle of attack and the airspeed.
you can use that idea, but to get thing stable first I woiuld make and ideal airfoil with a fix aerodynamic center.
They after I have all my compenets, I will add the effect of an aierodynamics center fo presure.

also you need to add control surfaces to make sure the net torque on the entire body add to zero, so that the plain do not stall.
this is why airplain have ailerons and rudders.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Wing lift force(Custom Wing Joint)

Postby PJani » Tue Aug 31, 2010 4:16 pm

Julio Jerez wrote:
we used similar technique in a game I worked long time ago named Battle zone, where you can change vehicle engine on the fly and one vehicle can be convert into another.



My first game(Battle zone, year 1998) i bought :D, not bad game for that time, actually the only game where i did enjoy freedom that time.

Julio Jerez wrote:
Code: Select all
dMatrix chasMatrix;
dVector vel,omg;
NewtonBodyGetMatrix(GetBody0(), &chasMatrix[0][0]);
NewtonBodyGetVelocity(GetBody0(),&vel[0]);//Global velocity
NewtonBodyGetOmega(GetBody0(),&omg[0]); //Global omega
dVector absVel = vel+omg * chasMatrix.RotateVector(m_WingCOM); //absolute Wing center of mass velocity. m_WingCOM is offset from plane local 0,0,0.

your airplane stall because you are applyin teh force to a poin the is off from the center of mass.
I am assuming you are tryin to calculate some king of Aerodynamics cenet of mass tha os a funtion of teh air speed of the plain bu the expresion do no make cent to me bacuse it
calculation a velocity.
Maybe if you tell me what you wnat to do wit that exparsion, I can help more because it can no make snece of that.

I am trying to calculate global speed with rotational velocity included.

this is my code
Code: Select all
   struct F
   {
//Applying global force on the body at some point.
   static void NewtonBodyAddGlobalForce(const NewtonBody* bdy, const dVector& force, const dVector& point)
   {
      dMatrix mtrx;
      NewtonBodyGetMatrix(bdy,&mtrx[0][0]);

      dVector glbForce =  point - mtrx.m_posit;
      dVector glbTorque = glbForce * force;

      NewtonBodyAddForce(bdy, &force[0]);
      NewtonBodyAddTorque(bdy, &glbTorque[0]);
   }
///////// Applying local force on the body at some local point.
   static void NewtonBodyAddLocalForce(const NewtonBody* bdy, const dVector& force, const dVector& point)
   {
      dMatrix mtrx;
      NewtonBodyGetMatrix(bdy,&mtrx[0][0]);

      dVector glbForce = mtrx.RotateVector(force);


      dVector newForce = mtrx.TransformVector(point) - mtrx.m_posit;
      dVector newTorque = newForce * glbForce;

      NewtonBodyAddForce(bdy, &glbForce[0]);
      NewtonBodyAddTorque(bdy, &newTorque[0]);
   
   }
//Few "utility" functions
   static dVector UnitdVector(const dVector& v)
   {
      return v.Scale(1.0f/(dSqrt(v%v)));
   }
   static dFloat dVectorLength(const dVector& v)
   {
      return dSqrt(v%v);
   }
   static dFloat dVectorLengthSQD(const dVector& v)
   {
      return (v%v);
   }
   };

//joint constrains. //its not perfect especially not optimized.
void CustomWing::SubmitConstraints(dFloat timestep, int threadIndex)
{
   dMatrix chasMatrix;
   dVector vel,omg;
   NewtonBodyGetMatrix(GetBody0(), &chasMatrix[0][0]);
   NewtonBodyGetVelocity(GetBody0(),&vel[0]);//Global velocity
   NewtonBodyGetOmega(GetBody0(),&omg[0]); //Global omega
   

   dVector absVel = vel+omg * chasMatrix.RotateVector(m_WingCOM); //absolute Wing center of mass velocity. (global velocity of wings COM with rotation velocity.)
   dVector relVel = chasMatrix.UnrotateVector(absVel); //local air velocity.

   dVector airVel = m_WingTangent.Scale((relVel % m_WingTangent)/(m_WingTangent % m_WingTangent)); //velocity over wings.//LOCAL

   //calculate angle of attack //
   m_AoA = dAcos((relVel%airVel)/(dSqrt(relVel%relVel)*dSqrt(airVel%airVel)));
   

   
   if(F::dVectorLengthSQD(relVel)>0.0001)//i just dont want to add 0 force to body.
   {

      m_liftForce = -0.5f * m_ro * S * ( F::dVectorLengthSQD(airVel) ) * liftCurve(m_AoA); //lift force formula

      //induced lift force
      m_liftForceVec = (F::UnitdVector(relVel)*(m_WingTangent*m_WingNormal)).Scale(m_liftForce);
      
      
      //induced drag force
      // _k

      //m_dragForce = (_k * F::dVectorLengthSQD(m_liftForceVec))
      //            / (0.5 * m_roAtSL * F::dVectorLengthSQD(airVel) * S * 3.14 * AR);

      //lets fly.
      F::NewtonBodyAddLocalForce(GetBody0(), m_liftForceVec /*+ m_dragForceVec*/, m_WingCOM);

   }
}

   dFloat liftCurve(dFloat x)
   {

      if(x>-0.087 && x<0.421)
         return -13432.556f
               * (-0.52151586f + x)
               * (0.087f + x)
               * (0.092538092f + x)
               * (0.20620989f + (-0.84661103f + x)* x)
               * (0.047291951f + (-0.15885782f +x)* x);

      return 0.0;

   }



Julio Jerez wrote:
PJani wrote:Good work and video. :D
Lift induced drag.
Code: Select all
m_dragForce = (_k * m_liftForce*m_liftForce) / (0.5 * m_roAtSL * airVel*airVel * S * 3.14 * AR);


why do you divide the force by teh air speed?


I got that from wiki. and actually is the equivalent airspeed
http://en.wikipedia.org/wiki/Lift-induc ... duced_drag


Julio Jerez wrote:
In general aerodynamics forces calculate from airfoild are applyed to a center aerodynamcis center of the airfoil that varyes slightly win the shape, angle of attack and the airspeed.
you can use that idea, but to get thing stable first I woiuld make and ideal airfoil with a fix aerodynamic center.
They after I have all my compenets, I will add the effect of an aierodynamics center fo presure.

also you need to add control surfaces to make sure the net torque on the entire body add to zero, so that the plain do not stall.
this is why airplain have ailerons and rudders.


Nice to hear that, aierons and rudders are my next stop when i fix this basic problems. :)
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Wing lift force(Custom Wing Joint)

Postby Julio Jerez » Tue Aug 31, 2010 5:25 pm

Code: Select all
dMatrix chasMatrix;
dVector vel,omg;
NewtonBodyGetMatrix(GetBody0(), &chasMatrix[0][0]);
NewtonBodyGetVelocity(GetBody0(),&vel[0]);//Global velocity
NewtonBodyGetOmega(GetBody0(),&omg[0]); //Global omega
dVector absVel = vel+omg * chasMatrix.RotateVector(m_WingCOM); //absolute Wing center of mass velocity. m_WingCOM is offset from plane local 0,0,0.

I am trying to calculate global speed with rotational velocity included.

I see, just remember that NewtonBodyGetVelocity and NewtonBodyGetOmega
are the force of the body center of mass.

here is a sketch of that migh help you to

Code: Select all
calculateAilforilForceAndCenetofPresureInLocaSpace (Force, centerOfpresure, velocLocal, Omega);
{
   // to make it simpel alway retun teh cent fo eth foil and the aerodynammic center of presure
   centerOfpresure = foilorifin;

   // veleocity of eth fil center
   veloc = velocLocal +  cross (centerOfpresure, Omega)

   //angle of attack is the angle between Velocity and the durection for the file frame.
   // for a fix frame wings it is simple the angle between velocity and a unit vector in (1, 0, 0) if you use x
   // as the principla axis OF the plain,
   // else it is that angle plus the inclination of the foil


   // the rest is applying the formulas for aerodynamics force at the center of aerdynamics presure.
   ...
   

   //as you cna see thsi si bo much diffrent tha teh componet buidl UP to calculat eth Force teh supention on a car



}



// calcuale wind force and center or force.
matrix = BodyGetMatrix(body);
velocLocal = (matrix.Unrotate (GetVelocirty (body)))
Omega = (matrix.Unrotate GetVelocirty (body)))

Torque = ZeroVector
Force = ZeroVector
for airfoil in airfioldList
    vector Foildforce
   vector centerOfpresure;
    calculateAilforilForceAndCenetofPresureInLocaSpace (Force, centerOfpresure, velocLocal, Omega);

   Force += Foilforce
   Torque += crossProduct (centerOfpresure, Foilforce);


Force = matrix.RotateVcetor (Fopce)   

// here you can chake of teh air plane stable of the next torque amont to zero when the plane is a steady flight
Torque += matrix.RotateVcetor (Fopce)   ;
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Wing lift force(Custom Wing Joint)

Postby Sash » Tue Aug 31, 2010 7:53 pm

PJani wrote:I am using joints because i have things more modular then and i leave force callback clean. I can build anything i want, with any (JSON, XML, INFO script) or even python interpreter. :wink:
I have idea to use my wing joint for helicopter to. :D


I have my F&T callback clean too because I'm using a wrapper class for a body+collision+visuals+joints with full XML (de)serialization.
But yes, its' just a matter of taste.

In helicopters - one of my biggest problems was unstable and nonrigid hinge joint when using realistic masses and speeds(the smaller heli (and rotordisc) the more rotor angular speed needed to get required lift force - most radiocontrolled helis runs @ 2000-4000 RPM), but if you're about fullsize machines - it may work as those rotorspeeds much slower.
Sash
 
Posts: 34
Joined: Wed Sep 30, 2009 3:38 am
Location: Novosibirsk

Re: Wing lift force(Custom Wing Joint)

Postby PJani » Wed Sep 01, 2010 7:07 pm

Sash wrote:In helicopters - one of my biggest problems was unstable and nonrigid hinge joint when using realistic masses and speeds(the smaller heli (and rotordisc) the more rotor angular speed needed to get required lift force - most radiocontrolled helis runs @ 2000-4000 RPM), but if you're about fullsize machines - it may work as those rotorspeeds much slower.


yep i am working on real world sizes. :D

Julio i will look in to it, when i will have more time.
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest