Abstract
In "Star wars", a young Luke Skywalker is trained to use the force and sense your enemy. In the training sessions, the enemy is an hovering sphere that randomly fires laser shots. The apprentice Jedi has to intercept the non-lethal laser beams with his light saber.
For this challenge, I'd like to build a similar gadget.
Reasons
The are many reasons why building the hovering sphere is both exciting and challenging
- autonomous flight is a field I always liked to explore in more depth
- make the Raspberry act as a real-time controller is something that can be useful in many other fields of interest
- indoor localization through landmarks is also a field of research that can be easily ported to many other projects
Overview
The flying sphere will be build using harmonic steel for the wireframe. The wireframe contains the blade and prevent any damage to the player due to the rotating blades. The mechanics for the coaxial rotor will be salvaged from an normal RC helicopter
The sphere will hover thanks to the mechanic components taken from an RC helicopter with counter-rotating blades. Counter-rotating blades solution makes the "helicopter" intrinsically stable, so a steady flight condition can be maintained with very few control interventions. Rotation along the vertical axis (yaw) is achieved by properly adjusting the speed of the two rotating blades. A third propeller will be used to make the sphere translateConsidered that
the sphere will determine its position using the camera. A reference landmark will be placed on the floor. The sphere will try to maintain a predefined distance from the landmark by looking for the landmark and analyzing the size and orientation of the landmark itself. Picture below outlines the basic geometry of the vision system. Based on the two variables y (distance from the ground to the camera) and Φ (angle of camera from ground), analysis can be done on the Y position on the image to determine the distance from the landmark. Initial calibration will be needed to determine the exact distance of the landmark based on the placement of the landmark in the camera view. It should be noted that due to the nature of an angled camera, the higher the value of h1 (from diagram), the farther the landmark is. A range finder will be installed facing downwards to determine the value of y (distance from the ground to the camera) and an accelerometer will determine the value of Φ (angle of camera from ground)A laser pointer will be mounted and a platform with two degrees of freedom to randomly shoot a laser beam.The trainee's light saber will be covered with a light reflective material. His purpose will be to place the saber on the beam trajectory and reflect it back to the sphere. The sphere's camera will run a blob recognition algorithm to determine whether the reflected beam is in sight From the electronic point of view, the following boards will be installed
- Raspberry Pi Model A
- Raspberry Pi camera board
- Ultrasonic range finder
- Microstack accelerometer
- Infineon DC Motor control module
- A laser pointer
- two servos to point the laser pointer
Hardware description
The flying sphere will be made up of a wireframe structure built using harmonic steel threads. Picture below gives a rough idea of the way the components will be assembled
The mechanic needs to provide enough thrust to lift all the required electronics components. We expect blades of 25 cm in diameter to be enough to lift 400g of equipments.Motor will be controlled by a motor controlled board like the Infineon DC Motor control module. The control signal will be provided by the Raspberry Pi module.The third small rotor for translation will be controlled by simple L293 IC since the power involved is much lower than the power required by the main rotor
Software description
The software flow chart is as shown in the flowchart below
The software will implement the following features
- altitude and position hold: by analyzing range finder readings and video stream from Raspberry Pi camera, the software that runs on the Raspberry Pi Model A board will try to hold an altitude of about 2 metres from the ground and to always face the landmark placed on the floor. Height is simply determined by reading the range finder's output. Translations that are eventually required to hold position are achieved by first rotating the sphere in the direction where the sphere needs to translate and then activating the third propeller. Vertical rotation (yaw) is achieved by slightly changing the speed of the counter-rotating blades
- human body recognition: after the flying sphere has reached the operating altitude, it starts rotating around its vertical axis scanning for human bodies (i.e. the Jedi under training) using the Raspberry Pi camera module. Vertical rotation is achieved by slightly changing the speed of the counter-rotating blades
- laser firing: when the human body is in view, the flying sphere activates the laser pointer for a few seconds. The Jed trainee have to intercept the laser beam with its light saber (in this case, it's just a stick covered with light reflective material). In order to make the laser beam visible, a smoke machine will be installed in the room
- since the sphere will be used in closed environment (mainly because you need a dark and smoky room to see laser beams), a method for indoor localization has to be devised
- since a camera is required to "see" the beam reflected by the trainee's light saber
- reflected laser beam detection: when the laser beam is reflected with the right angle by the light saber, the reflected beam is seen by the Raspberry Pi camera by means of a Blob detection algorithm. The flying sphere will switch on a green light and activate a buzzer to signal that the test has been passed
Top Comments