Design > Engineering board

Electric Motor Control - severe Geek speak

<< < (2/4) > >>

Mark wood:
Derivations:

Drag function

The 1-cosine X is a basic approximation of drag of a flat plate. As a flat plate is rotated from 0 to 90 degrees the drag increases from 0 to one, with a bucket shape. Cosine goes from 1 to 0 in the same change of angle. By subtracting cosine from one the shape becomes that of the flat plate. A fairly simple derivation and useable for doing things like loads analysis and such, it isn’t perfect and we don’t need perfect. We just need close enough and some ability to adjust to fit. In this case, using coefficients, the overall magnitude, the rate of curvature and the sensitivity can be adjusted.

 
Figure 4 Cl v Cd - Drag – Annotated - 1-Cosine θ


Linear gain v 1- Cosine X

It only takes a casual inspection of the following Figure with linear gains plotted on top of the drag polars and 1-Cosine X gain function. It is impossible to match the required thrusts increase with a linear line and there is only one condition where the gain meets that requirement. The result is the gain will either under thrust or over thrust for given AOA (G) condition. Note that the normal operating range of the CL airplane is from the origin to the crossing of the two cosine function lines. The result of not following the thrust requirement is oscillations in flight velocity.

 

Figure 5 Cl v Cd - Drag – Linear Gain vs 1-Cosine X Gain


Mark wood:
Flight Conditions

Refer to Figures 2 and 3, there is one them various flight conditions illustrating flight conditions of interest which are important in deriving the gain requirement for the control system. It is not necessary to derive further conditions since they are merely subsets conditions of these, call them principal, conditions. Each has its unique requirement for performance. The wing over is left out and has a further requirement which will be addressed later but is also a subset of the square corner maneuvers. In order to create a coefficient based structure it was necessary to solve several states. I picked level flight at zero azimuth angle, level flight at 45 degree azimuth angle, 6 G and 10 G looping maneuvers.

Level Flight

The interesting thing about level flight is that, if we make the bold constant velocity simplifying condition, all of the maneuvers become a simple function of the level flight tension induced G force. While this isn’t exactly how the airplane works, a gain derived from control position would converge on that condition with enough time. So, it is reasonable to make this assumption.

 

Figure 6 - Forces during Level Flight


A typical CLPA airplane flies on 65’ lines and has a lap time of about 5.2 seconds. From this we can calculate the accretion the airplane experiences as I travels the circular fight path:
V=d/t=2*pi*r/t

V =2 * 3.1416 * 65 / 5.2 = 408.4 ft / 5.2 s = 78.5 ft/s

And:
a=V^2/r=〖78.5〗^2/65=94.9 ft/s^2

G = a/g = 94.9 / 32.2 = 2.9 G’s

The result is the airplane is pulling 2.9 G’s on the line which is seen at the handle.

Mark wood:
Tethered Level Flight with 45° Bank Angle

It’s an interesting condition to derive the tethered airplane flight with the same bank angle as the untethered aircraft. It is also a simple way of progressively deriving the vectors of the tethering state of the Cl model flying level at the 45° azimuth since the horizontal component will be the same. The vertical component will change when we derive that condition as well as the necessary G force to fly the condition. The reason to have look at this is to understand the impact that the horizontal lift component has on line tension.


 


Figure 8 – Forces during Tethered 45° Banked Level Flight
In order to cause the airplane to fly a smaller corner there are a number of solutions such as thrusters, side force generators and in our case a wire tether. So, this derivation will use a radius which would be the result of the airplane flying up to the 45° azimuth angle. This is the first step in the derivation of the total turning force and resulting line tension. In the same way as the untethered condition the lift vertical lift component must support the weight of the airplane.

The first step is finding the radius of the flight path with is the line length time the Cosine of 45 degrees resulting in 46 ft. From this we can determine the centripetal acceleration a=V^2/r From Figure 8 the radius is 46 ft and the velocity is 78.5 ft/s which result in an acceleration of 133.9 ft / s2. This can be reduced to a simple form which can be used for number of tasks such as calculating the tension in the lines. GTh = a/g = 133.9 / 32.2 = 4.2 G. This is the total horizontal G on the airplane and the tension in the line would be reduced by the contribution of the total lift vector, in this case 1 g so the line tension would be 4.2 – 1 = 3.2 G’s. If your airplane weighs 4 pounds the pull on the handle would be 4 x 3.2 = 12.8 lbs.


Ground Tethered Level Flight with 45° Bank Angle

When the airplane is tethered from a position off axis such as from the ground to the wing the forces change. The primary change is in the vertical lift component. This example is a progression from Figure 8 with the focus now on the vertical elements. All of the horizontal portions carry over. The impact of the tether being ground based is that it creates a vertical vector component which must be compensated for by increasing the lift on the wing.

 

Figure 9 – Forces during Wing Tethered 45° Banked Level Flight

Since the aircraft is flying around the same path as the previous calculation, the horizontal component is exactly the same and can be used to calculate the required total force necessary to be provided by the tension in the lines. Knowing the FTh we can find the total lift component FL ttl as follows:
FTh=FLttl*cos⁡θ

FLttl=FTh/cos⁡θ   


Again by dividing both sides by g we can coefficientwise this to terms of G. By doing that we get GL ttl = 5.9 G’s.  This is an interesting result in that the solution for the lift on the wing, G force, GL ttl to maintain level flight at a 45° azimuth is pretty much the same as that required for a loop scribing a 45° cone. This shouldn’t be surprising.

Mark wood:
A friend of mine is helping me improve the English that I use to improve my communication skills. He didn't thin the 1-Cos X function fit and I had simply made some graphic representation for illustration. So, I worked up some plots with excel to show how well 1-Cos X can actually be made to fit. The attached snip is the excel plot over the graphic of the drag curves. Notice I was able to get a fairly decent fit by using only two constants.K1 and K2 which makes the equation

Drag gain = K2 * (1-Cos (  K1 * X))

Mark wood:
I flew the first prototype of my timer this evening on an Igor GeeBee foamy. During the period of beginning implementation, spelled learning a bucket load of code and how to use different devices, now our club became interested in the indoor foamy models which I made us a bunch of kits. While flying these it became obvious why Igor said a few times about the need for a different firmware for the indoor models. Flying and watching his models fly it became obvious that here needs to be an attitude input to the thrust function which drove me to figure out how to do it. This was always part of my original concept but had slid away partially after working out the control input and drag gain element.

The main difficulty with implementing solely a thrust gain based upon control position is that at times it will add too much thrust. For instance, during the high side of square maneuvers the turn to the vertical down line needs to have reduced thrust once the nose is pitching downward. And in a vertical eight type maneuver from basically the same position more thrust needs to be added in order to make the climbing turn. The trouble I was running in to is finding a simple solution to implement this. Most of the application attempt to use a linear gain based upon one of the acceleration axis. Being the propulsion guy, I'm thinking I don't need that exactly but what is necessary is enough thrust to compensate for the pull of gravity. Basically if there is a way of computing which way gravity is pointing then the thrust command can be determined as a function of the angle with respect to gravity.

It's easy enough to think that we could create a gain that works directly as a function of acceleration along the x axis, the line from nose to tail. The trouble with that is that when the airplane is accelerating or decelerating there is a resulting response.  Another way is to determine the actual attitude via an IMU and while this works, a Kalman filter takes a significant amount of computation time and the aircraft being tethered creates some special math problems as demonstrated by my previous derivations. It's not easy and the general form of that calculation is significantly more difficult than what I want to do.

In 2D space, the gravitational vector angle with respect to the nose is actually quite simple to determine using only an accelerometer.  In level flight the gravity vector is perpendicular to the x axis and has a value of one G. This is the Z axis. When the nose is pointed straight up the gravity vector is directly behind the airplane. Making an assumption in the operation of the previously developed control gain that the airplane made it through the corner without loosing energy it would now begin to decelerate since the level flight thrust just compensated for the drag and now gravity is adding to the drag force slowing the airplane.  The fix is simply adding enough thrust at this point to roughly equal the weight of the airplane. An interesting thing is that for a hard corner the increase in thrust is slightly more than that which is required to arrest the deceleration and all the control really needs to do is not cut the thrust back from the corner value.

It's not a very hard exercise to determine the amount of power required to compensate in this case. APC has some very wonderful data available on all of their propellers with thrust, RPM, speed and power required numbers which can be easily translated in to an RPM change and corresponding servo signal increase. Point the nose up, you have to increase the RPMs by 1,200 which results in x microseconds addition to the command going to the ESC. Simple.

To make this work smoothly the first step is to make a rough determination of the pitch attitude.  I fretted over this endlessly. If we do a simple statics calculation what we can easily sort out is the the thrust required to compensate for gravity is simply the weight times the sine of the pitch angle. In level flight the angle = 0 and sin(0) = 0 and at nose up the sin(90) = 1. As result there is a basis of calculating the gain. We just need an equation that goes attitude gain = a constant time the sine of the pitch angle. The missing part is a way to determine the angle.

There are a number of ways to calculate an angle from sensors or vectors. The form which computationally works in this case is to find the magnitude of the Gx and Gz vectors and use their vector sum to find the angle. Gt = sqrt( Gx^2 = Gz^2) and theta = arcsin(Gx / Gt). This has an inherent trouble in that the Gz value is quite high during the maneuver which will cause the computation to be off. I simplified the calculation of the angle while playing around with the IMU. It occurred to me that during the loaded portion of the maneuver it isn't necessary to know the attitude perfectly. Only to be working on the solution. By accident I realized that if the accelerometer were saturated at 2G's wrung a 6 G maneuver the calculation wouldn't be that far off. The result of doing this is a "better" idea of the pitch attitude and consequently  a better solution for setting the thrust.

The way this is implemented in to the control is by adding the control gain and the attitude gain together and limiting the output such that the total is never greater than a given value which can be made trimmable. The first flight test this value is fixed but my plan is to make it a trimmable parameter.  I currently don't have a programming box and am setting the power and gain via a potentiometer.  By using this approach the gain output will saturate during the hard maneuver and when the control is relaxed the attitude gain will have caught up and take over. During pitch down maneuvers towards the ground the attitude gain is subtracting from the control gain and the reduction is realized. Again the flight actually demonstrated this to work better than I expected as the attitude solution was working more quickly than I expected.

In order to better communicate this, I need to make some illustrations. However, I wanted to get his down in words.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version