Altimeter Module Test and Test Drive <video>
xanadu
Posts: 3,347
[video=youtube_share;nqdFmwpqE5Y]
Saturday I'll take it for a test flight in a Cessna 172SP.
Sunday I should be using it for altitude hold on an RC airplane.
Edits: Saturday's flight didn't go so well, I forgot to turn on the altimeter on the ground, so in the air it read my starting altitude... doh! Anyway I have enough info to move forard with the altitude hold on the RC airplane with just bench testing. I showed the altimeter to some other pilots and their eyes were popping out of their heads watching it reading 1' increments lol.
Saturday I'll take it for a test flight in a Cessna 172SP.
Sunday I should be using it for altitude hold on an RC airplane.
CON _clkmode = xtal1 + pll16x ' Change to xtal1 + pll8x for Propeller Backpack. _xinfreq = 5_000_000 ' Change to 10_000_000 for Propeller Backpack. START_ALT = 331 ' Your starting altitude in feet. VAR byte alta 'pst ' VARs for alt condition flags byte altb 'nst OBJ alt : "29124_altimeter" pst : "parallax serial terminal" LCD : "serial_lcd.spin" PUB start | a,t alta := 9001 ' Variable init lcd.init(15, 19200, 2) ' Init LCD on pin 15 lcd.displayOn lcd.cursor(0) ' No cursor lcd.backlight(true) ' Backlight on lcd.clrln(0) ' Clear line 1 - altimeter lcd.clrln(1) ' Clear line 2 - reserved pst.start(38400) ' Start Parallax serial terminal. alt.start(alt#QUICKSTART, alt#BACKGROUND) ' Start altimeter for QuickStart with background processing. alt.set_resolution(alt#HIGHEST) ' Set to highest resolution. alt.set_altitude(alt.m_from_ft(START_ALT * 100)) ' Set the starting altitude, based on average local pressure. lcd.gotoxy(10, 0) lcd.str(string("FT MSL")) repeat a := alt.altitude(alt.average_press) ' Get altitude data altb := a ' Sync alt to VAR if ((altb := altb) <> alta) ' Refresh LCD w/ data (Altitude on line 1) if (altb) lcd.gotoxy(0, 0) lcd.str(alt.formatn(a,alt#TO_FEET,0)) else alta := altb waitcnt(clkfreq * 1 + cnt) ''=======[ License ]============================================================== {{{ ┌──────────────────────────────────────────────────────────────────────────────────────┐ │ TERMS OF USE: MIT License │ ├──────────────────────────────────────────────────────────────────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this │ │software and associated documentation files (the "Software"), to deal in the Software │ │without restriction, including without limitation the rights to use, copy, modify, │ │merge, publish, distribute, sublicense, and/or sell copies of the Software, and to │ │permit persons to whom the Software is furnished to do so, subject to the following │ │conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies │ │or substantial portions of the Software. │ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, │ │INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A │ │PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT │ │HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF │ │CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE │ │OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ └──────────────────────────────────────────────────────────────────────────────────────┘ }}
Edits: Saturday's flight didn't go so well, I forgot to turn on the altimeter on the ground, so in the air it read my starting altitude... doh! Anyway I have enough info to move forard with the altitude hold on the RC airplane with just bench testing. I showed the altimeter to some other pilots and their eyes were popping out of their heads watching it reading 1' increments lol.
Comments
Right now the servo is not moving enough, so I'm working on a ground adjustable gain. My RC TX only has 4 channel, so I'll be using XBee to enable and disable the hold. I was going to just enable the hold when the elevator stick was centered, but sometimes I throw in elevator when turning, so I ruled that out.
Okay I fixed the gain problem, although it is not yet adjustable. I'm pretty happy with it the way it is, and I'll bring my laptop to the field just in case. Not sure if this was the best way to go about doing it but here goes-
That's good for a stable descent during landing, in cruise you need both and for now I'm using only elevator.
Also with a pusher prop the thrust pushes the nose down, especially without a T-tail.
There is no altitude to speak of by initializing it like this (at your current altitude) the altitude = 1500, which is the center of the servo. I changed the starting altitude to 10' and then multiplied it by 5 to make the servo move more. If you make your starting altitude 1500 then 1' up or down would only output 1499 or 1501 and that's not enough servo movement to stabilize anything. Honestly I'm not sure why what I did works better, but I wanted to keep going to I could fly on Sunday, and it still didn't end up happening.
It is a tad unstable (~1' per minute), but the instability makes the aircraft lose altitude, which is good because if I lose control I don't want it going up into the air.
I'm aiming for after work today. I'm using my crash test airplane so hopefully we'll see some good crashes hehe. Also as the barometric pressure drops so will the airplane, high to low, look out below.
It looks like I'm also using feet in one place and meters in the other which may explain why the math doesn't add up.
As of now the code works fine, except I can enable altitude hold mode only once. Once I turn off altitude hold it will not turn back on. I have written the code a couple different ways and I get the same result. At this point I'd rather go see if this even works before continuing to modify code.
If anyone could tell me why I cannot go back into altitude hold once I switch out of it, I'd really appreciate it
Also I'm using coginit again here, just for one part, because I still haven't quite grasped how to get the returned value of the cog ID for different cogs.
[video=youtube_share;VV_h-hbPU3c]
Either way, I'm far from giving up on this. Next time I'll have some adjustments I can make in flight.
I admit it has been a few years since I was behind the yoke but as I remember, adjusting the throttle worked equally well for adjusting rate of climb as well as descent. Flying, and maintaing altitude without touching the the steering yoke was the goal. Airspeed was adjusted by way of the elevator trim. the only time I use the wheel is when maneuvering, takeoff or landing.
When I applied the same method to an autonomous aircraft it worked very well. If the pusher prop is forcing the nose down with increased throttle then you could try adjusting the thrust line upwards.
Yeah that's right it does work like that, but it depends a lot on the airplane configuration and if you want to maintain a constant airspeed or rate of climb. In the C-172 that I fly, you can't really increase throttle to climb during cruise because you're already at 75% power and leaned for max RPM. Going to 100% throttle in a non-altitude engine at cruise while leaned 50 degrees short of peak EGT is very bad for the engine.
In most cases you can cut throttle to descend, but then you're adding drag by fighting your trim setting, so you still need to trim it out to maintain airspeed. Both ways work in the long run but it really depends on more factors that can change, and varies across different types of aircraft. I started out with C-152's and those are always at full throttle. One instance where you always want to cut throttle before pushing the nose over is when you start to add flaps, if you push the nose over before adding flaps you'll never slow down and be to fast to add in more flaps. In the landing configuration if you don't fly like you're saying you're screwed, pushing the nose down to lose altitude will float you down the runway so far you'll need to go around.
I will definitely add throttle control and ailerons next. I'd like to be able to fly it with just the laptop, and no on-board GPS
I don't remember having to adjust trim to maintain airspeed after reducing throttle. If you reduce throttle the airspeed should remain (stabilize to be) the same. Instead of the engine providing the energy you use up your potential energy by trading altitude. If you were to deploy a drag chute behind the aircraft you still should not have to adjust trim to maintain airspeed. The added drag would be compensated for by the increased rate of descent.
This all depends on the airplane and phase of flight. If you're trimmed for level flight and reduce throttle you will lose more altitude because you're sinking. Sinking doesn't always equate to an increase in forward airspeed when trimmed for level flight. In a small airplane reduction of throttle isn't going to push the nose over at all, maybe if you pull all the power out, even still in a small Cessna you'd have a low angle of attack.
The point here is that it depends, if you can hash out an exact scenario I can tell you exactly how to fly it and what would happen. If you had a flight instructor that told you the only way to go up or down is by increasing the throttle I'd ask for my money back.
I'm not a flight instructor but I have around 100 hours dual and 40 hours PIC. I have only flown three different aircraft so I'm not saying this applies to any aircraft or situation you may have encountered.
Right, sinking is the same as descending. Reduced throttle = descent.
Right again, sinking (descending) doesn't increase airspeed if the trim hasn't changed. Reduced throttle = same airspeed, decreasing altitude.
Descending by use of the elevator will increase airspeed.
I do believe you are wrong about this. I challenge you to reduce throttle while trimmed in level flight, do nothing else, then observe the results.
Challenge accepted, I'll post you a video.
The engineers that designed airplanes like C-172's had this in mind, trust me on this.
Also for the sake of argument, because I can see your posts on my non-flying posts are simply for the sake of argument, you originally said to change altitude you only use throttle, I challenge you to prove that lol. It seems now you're only talking about descending and not climbing, so are you saying the only way to descend is by reducing power, you're still not grasping that airplanes are designed to stay level, not nose down just because there is less thrust.
You're thinking weight shift type control.
Especially at full throttle, how are you going to climb by adding more throttle at full throttle, you cannot. All I'm saying is it depends on the aircraft, and phase of flight.
If you have any input on the actual task at hand, I'm all ears though.
Google VG diagram.
Can you explain what you expect to happen with the altitude and airspeed when you perform the challenge?
Engineers don't really have a say in these things.
Not just for the sake of argument. I do believe you will have better altitude control by using the throttle rather than the elevator.
I'm afraid I won't be finding myself in a powered aircraft in the near future. The last aircraft I piloted did not have an engine, and the next one won't have one either. My piloting experience consists of Cessna 150s, 152s, 172s, a Robinson R22, a trike, an electric powered paraglider ( Dec 17, 2003), a Blanik sailplane and various hang gliders.
No.
Well I'll give you that one. If you are already at full throttle then you will need to use the elevator to increase you AOA - which will decrease your airspeed and hopefully give you more ROC.
The VG diagram has nothing to do with this discussion.
No. Well yes, I was mentioning descending more often but the same holds true for increasing the throttle. Increase throttle = gain altitude, same airspeed. Decrease throttle = lose altitude, same airspeed.
Changing the throttle setting does not change AOA. It will change the aircraft's attitude with respect to the horizon.
You still have not explained how to CLIMB when you're already at full power. All that aside...
Yeah the airspeed will decrease and the altitude will drop until you reach a point where the airspeed will increase. In a descent an increase in vertical speed has nothing to do with an increase in forward speed while the airplane is level because of drag. Most airplanes WILL stay level.
If you don't see where the VG diagram fits in here then fine, you can say it doesn't matter all day, doesn't change anything.
Engineers don't have a say in these things? Are you drinking tonight? An airplane like a C-172 is designed to be inherently stable. That means pitch too. Weight and balance, etc, etc.
If you really still think that you can adjust your altitude by using only throttle then I'm throwing in the towel. It's not entirely true but you seem to only agree with part of that, the part that you think is all of it, when it is only PART of it...
I understand what you believe it just doesn't make sense you won't budge on the fact that you're only half right. I understand you're some kind of robotics genius but wow. This isn't just coming from me and not even related to this subject a friend of mine wont even post on this forum because of some nonsense you wrote to him in a pm about his post.
I fly twice a week lol... I cut my throttle in IMC and scan the panel faster than you can peer at your speedometer on the highway. Go get your PPL, IFR, build some hours, then go to a flying forum and troll people there. Goodnight!
I never said that changing throttle was the only way to change altitude. But you are right, lets drop this. I don't want it to go negative.