- INTRODUCTION: -
The Pluto 1.2 drone and its app has a Gyroscope Control already built in it which means that while controlling your Pluto using your mobile phone, you can use the mobiles motion about the pitch and roll axis to make the drone move respectively. But what is not inbuilt is the motion about the drone’s yaw axis and we have to give the commands manually like we give from a joystick instead of moving our mobile phone. So, conclusively, this project is to make use of the mobile phone’s motion about the yaw axis to turn the drone’s head in the desired direction.
- OBJECTIVES: -
To push the boundaries of exploration possible in Pluto 1.2 drones
To experience a new way to control the drone and ignite new ideas in the student’s brains.
- PROBLEM STATEMENT: -
To use the mobile phone’s motion to control Pluto’s heading.
- APPROACHING THE PROBLEM: -
The aim of this project is to control the heading of Pluto X using the heading of the phone. This objective can be achieved by achieving two sub objectives.
Getting the heading of the phone from the app.
Setting the heading for Pluto X based on the phone heading.
While using the phone to fly Pluto X, the data regarding the orientation of the phone is stored in the User block. It is using this data that a pilot is able to fly using tilt mode. This data also contains the data of the phone’s Magnetometer. This Magnetometer data will be used as the heading for Pluto X. However, there will be an error if the phone’s raw data is directly used for Pluto X. This is because the orientation of the phone while flying, and the orientation of Pluto X will be some degrees (close to 90) apart. For example, if the heading of the phone is 90° while starting to fly, the heading of Pluto X could be 0° or 360° at that time. The error would be the difference between the heading of the phone and the heading of the drone, which comes down to 90°. In order to remove this error, subtract 90° from the phone’s heading. So, if 90° is subtracted from 90° as in the above example, it gives 0° or 360° which is the heading of Pluto X. However, this could cause another issue in certain cases where the angle would become negative. For example, if the phone’s heading is changed by 30° i.e. changed from 90° to 60°, then 60° - 90° will be -30°, which is negative. In such cases, add 360° and use it as the heading for Pluto X. So, -30° + 360° will be 330° hence Pluto X will change its heading by 30° only. In a nutshell, the logic for this project will include getting the data of phone’s heading from the app, correcting the data, specifying the condition if the sum goes beyond 360°, and setting this data as the heading for Pluto X.
- EXPLANATION OF THE SOLUTION: -
So, now initially we need to understand how can we measure the phone’s movements and then calibrate it with Pluto. Do not use RC Yaw for this (as it only gives the yaw values given through the joystick in the app and not the phones actual spatial orientation). We need to use the “ Get App Heading” command from the current state block collection. This command is used to get the app (Mobile Phone’s) yaw orientation.
Initially, it is important that you use the Get App Heading command individually to understand how it is working and when you do, we understand whether the phone’s heading and the drone’s heading is aligned or not. Which is why, we have to add or subtract a certain angle in the phone’s yaw orientation in order to calibrate it with Pluto’s yaw orientation. In this very code we have tried adding 90 degrees to the command’s values.
Later, you have to check whether after calibrating the App Heading, if it has not become negative (this is only for coders who are subtracting the angle to calibrate). If the value has become negative indeed, we need to add 360 degrees to rectify the orientation command as the negative value won’t give a proper yaw orientation.
Conclusively, we need to send this calibrated value saved in the user defined variable “Yaw” to Pluto in order to make it act accordingly after pressing the developer mode.
Comments
Please log in or sign up to comment.