Walkera Magic Cube Computer Control

3689508829?profile=originalThe Walkera Magic Cube is used to control Walkera models with either a Walkera remote control or using an Android app. We wanted to control the Walkera Ladybird with a computer so we started to investigate how to interface the Magic Cube work with a computer. After some tinkering and dome dead ends we ended up generating a PPM signal using an Arduino. The proof-of-concept setup for this is depicted above. This allows us to send commands via serial to the Arduino which in turn controls the Ladybird using the Magic Cube. The code used to generate a PPM signal which is accepted by the Magic Cube can be found on a GitHub project page. The wiki for this project also contains some further explanations on how to recreate the setup. Some experiments and data regarding the reverse engineering of the Android app and its protocol can also be found there (see the early_attempts branch).

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Awesome, thanks.

    Looking forward to see this part of the code,

    Danny

  • I'll try to dig up the code but it'll take a few days. So just for the record some information on the PIDs:

    • lateral control: You can just use PD controllers, they work quite fine in my experience, you need a surprisingly high D part though
    • hovering control: Hovering basically breaks the PID model since it is asymmetric and there are all kind of effects like ground effect etc. but you can get it to work. You can compensate for gravity with an I term, which has to be tuned a bit more carefully, I_max is a good idea. You will run into problems if you start with a zero integral since you want a fast start but a slow I-term to compensate for the battery drain. The way we solved it was pretty dirty since we just added an initial I offset to get a headstart and tuned the I-term only to the battery drain.
    • We controlled on the position itself and didn't opt for nested PIDs controlling the velocity and position. If you want to do something a bit more acrobatic, you need to go that route though and probably ditch PIDs all together.
    • We hand-tuned all the parameters, so no need for mass, gravity, etc. Basically we only used xyz and yaw.

    Basically that's all not correct if you are a control theory guy but it was a student project so we opted for quick and dirty and it works surprisingly well.

  • Thank you for the quick reply Chrisitan!

    I saw the paper and will definitely cite it.

    >> If you want to, I can dig up the code

    I will really appreciate it, my e-mail is dannyf@csail.mit.edu

    Also, it will be great to host here at the distributed robotics lab of MIT.

    We try to extend your project and running the quad outside.using a visual tracking system.

    I'm new to the field and the translation from (x,y,z) to the Euler angels confuses me. Also, I wonder what is the simplest PID for, say, hovering. Can I use just PD? Do I need mass, gravity, etc or just (x,y,z)? Is it ok to compute velocity by myslef?

    Your code can probably answer these questions.

    Thanks again

    Danny

  • For the basic stabilization, you can use the PIDs which are running on the Ladybird itself. If you want to go a step further and also control the position, you need a way to track the Ladybird to close the feedback loop. We are using an active motion capturing system for that but the infrared markers on the Ladybird impact battery life time severely.

    If you want to, I can dig up the code, but it isn't public since the parts interacting with the mocap system are not freely available. We had a short paper demonstrating an application here. There are some pictures to give you an impression of the system.

  • Awesome! can you also share the PID code please? 

This reply was deleted.