Playing With UDB LOGO

We've been working hard to make MatrixPilot ever more modular, and to test this modularization, I thought it would be fun to build a LOGO-like mission planning language as a plug-in replacement for the existing waypoints module.

After a few evenings of playing, I ended up with something that actually feels pretty useful. All the logo basics are there: HOME, RT, LT, FD, BK, REPEAT, etc. You can also set specific locations (like traditional waypoints), set altitude, and set and toggle flags like whether to fly inverted. You can also toggle between controlling the plane, and controlling the camera target. More info on the language here.

The above image is from a simulation of the following UDB LOGO program running in XPlane using MatrixPilot's HIL Simulation.

// 10-pointed star with an external loop at each point
REPEAT(10)
// One leg of the star
FD(2000)
// Turn 180 + 72 degrees over the course of 18 small segments
REPEAT(18)
RT(14) // RT( (180+72)/18 )
FD(50)
END
END

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • T3
    Hi Ben,

    Actually, we have very little data on what happens when the distance between Tx and Rx is large enough to degrade the pulses. I have thought about it, and done a little bit of testing with my Tx antenna down, and I don't think it would be pretty. The problem is there could be a large number of erroneous pulses coming through that would not be so far off as to trigger RTL.

    Plus, I think that the range of a fully charged Tx might be way farther than you would want your plane to go, it might even be far enough to drain your battery, depending on the pattern you are running.

    I think the far safer thing to do would be to put in an explicit distance range. Then, conservatives like me could set it for 200 meters, while the folks in countries that permit out of visual range flying could set it for as far as they want.

    Best regards,
    Bill
  • That's an interesting idea Bill. Almost like a watchdog timer but for distance instead of time. Although I guess we sort of have this already with an emergent hardcoded distance of "how far your transmitter reaches", since on signal loss, the separate RTL UDB Logo program will engage. The default rtl program commands the plane to come home and circle.
  • T3
    There is a simple thing that could be done to improve flight security:

    Trigger an automatic return to launch if the plane got farther away from the origin than a specified limit.

    Best regards,
    Bill
  • I understand the concern, and it's a good point to keep in mind when planning a mission. But I'm happy to test out more complex plans before flying. If some are not, then they can always choose not to use nested loops. :)
  • T3
    "Oh right, I should also point out that you can already use HIL Simulation to test a UDB Logo program before a real flight. :) "
    Same as everywhere, but with nested loops, you are practically OBLIGATED to do so in order to avoid surprises. You will see, once a number of parameters grows, you will be bound again to the laptop under the sun.
  • Oh right, I should also point out that you can already use HIL Simulation to test a UDB Logo program before a real flight. :)
  • Hi Krzysztof, I agree that it becomes non-trivial to determine exactly what's going to happen before flying.

    But I'm not willing to give up on nested repeats. They allow too much cool stuff. :) I'm thinking of making a quick and dirty tool to let you run a UDB Logo program on the desktop before a flight, to make sure it's planning to do what you think it is...
  • Thanks Brian, I'm having fun playing with LOGO again, and I agree the real power comes from the repeats.
  • T3
    There is a serious danger. No way to determine the distance, number of waypoints etc before executing.
    Therefore I have opted for allowing only a single loop in flexipilot.
  • T3
    I've been adding similar commands to my scripting language but didn't think to use a standard like Logo.

    I like it. Nice work and very useful.

    I've found the repeat command in particular to be a big timesaver.

    Thanks,
    Brian
This reply was deleted.