Basic Stamp code question - Altitude

Hi Chris,I have been looking at your basic stamp code and I think it is all starting to make sense to me finally! I have a question relation to the altitude control, I understand that if the UAV is + or - 10 Meters away from starting altitude it will correct by moving the elevators either up or down by just a bit. But if the UAV was some how a bit further below or above that, wouldn’t that cause the UAV to start doing a big loop the loop. I.e., never reaching the altitude and just doing big loops? What do you think would be the best way to stop this? I was thinking maybe a gyro or something that could measure the angle of climb or decent and not let the plane go steeper than that angle.Also then I could include altitudes into the waypoints. This could be handy with photography or Mountains!.I should be getting my BS2P and other gear this week! I can’t wait to start trying some of this stuff out!Regards,Scott James

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Another thing about the altitude hold freezing the navigation for three seconds. I'm reading the PSC/Parallax GPS source code, so I don't know if the updated one is different, but wouldn't it be better if the program switched to altitude hold when the plane is on course (i.e. turning angle is close to 0)?

    Right now it switches to altitude hold when the plane hits the current target waypoint, but isn't that when the plane needs to make the sharpest turns to the next waypoint? (Correct me if I'm wrong, just something that came to me while I was reading through the code).
  • Ah, I see

    Scott:

    I don't know the specifics on how a gyro works, but I definitely don't think that it is needed for this application. You could have proportional elevator control where you can take into account the actual error in altitude and use that in a function for elevator position, that way you won't have jerky movements where the elevator will always move to the same position, whether its 10 meters off target or 1 meter. (Not sure if the autopilot code is already programmed to do this, since I don't understand the FT639 syntax)

    However, even that I don't think is necessary, since as Chris says, the angle of the elevator is already fixed to move at a shallow angle, so there shouldn't be a problem unless you're dangerously low to the ground.

    Then again, I have no r/c experience, but that is just what I concluded from what I know so far.

    @Chris, again:

    This is slightly off topic, but do you think an Easy Star would be able to fly somewhat with decent stability (anything that doesn't end in a crash) without an FMA co-pilot? I don't want to use something that does all the work for me, since it's for a science fair, and I've also heard that the co-pilot won't help on a plane with no ailerons. We'll have a manual pilot too in case something does go wrong, but do you think it is acceptable to fly without the co-pilot?
  • Chris, I've never flown R/C before. Is altitude hold something that is very crucial to the UAV's performance? Or is it acceptable to let it "bounce" around in a 10-15 meter error range as long as it doesn't veer right into the ground? With no concern for camera/video quality, of course.
  • 3D Robotics
    Scott,

    Although it may have to be tweaked for different aircraft, the code is written to just give a small amount of up elevator (equivalent of one trim click) so that the plane climbs or descends gradually until it's back within +-10m of the target altitude.

    I am going to fine tune that subroutine, however, but for another reason. Right now it takes three altitude samples in a row. At a 1Hz refresh rate, that means that it freezes the autopilot for three seconds, which is too long. Instead, I'll adjust it so it takes a single reading before handing back to the navigation subroutine. It will remember the past two readings and just use those to take an average.

    As I say, all this will have to be tweaked after air trials!
This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…