Friday, 22 January 2016

Team Pi Over Four

Team: Pi Over Four

David O Mahony
Filipe Terra
Philip O Connor
Siang Wei Lee

Task plan and delegation
The first section of the project involved delegating the different sections of the design and then allocating a timeline for these areas which is shown below:

Design overview

Stage one involves developing basic set-up for lamp head including sight, sound and movements. 
These sections will then be delegated to different members of the team which has been shown above.

  • Sight Thread
The sight section of the design involves using the pi camera and OpenCV to take still frames from the camera which are continuously taken to produce a video like stream. Then using this camera feed faces will be detected within the capture sizes of the window. Once a face has been detected the X, Y and Z coordinates which gives the position values of the detected face. These values can then be used by other components of the design.  

  • Sound Thread
The sound section of the design will be used to play mp3 files. Different mp3 files will be selected depending on the values received from the camera. In this way we can match movements of the motors to specific sounds for example Generic robot sounds, animal sounds or more human emotion effects. This will bring more life to the overall project and draw attention. sound effects will be easily obtained from ( .
online pdf detailing how to set up to play sound effects:

  • Movement Thread
The movement of the project will be applied thought the uses of three servos. The positioning of these motors will be dependent on the values obtained from the opencv face tracking section.

The robot’s arms are moved by hobby servos.  These devices are controlled by a PWM signal witch relates to the desired angle.

The Raspberry Pi has GPIOs accessible in a header, many of them capable of doing simple PWM. For the Python to have access to the GPIO we install the following modules:

sudo apt-get install python-dev python-rpi.gpio

The Python module RPi.GPIO is used to handle the PWM. Python must run with sudo privileges for it to work:

sudo idle3 &

Sample code for testing the PWM can be found at - Using PWM in RPi.GPIO. The frequency was set to 50Hz and the duty cycle to 5%, in order to replicate the servo signal for 0 degrees. The signal was verified using an oscilloscope.

We are now planning to use the XMOS startKIT together with the Raspberry Pi, first as a logic analyzer for the servo control signals and maybe later as a coprocessor for the motion algorithms and the PWM time handling. The multicore architecture of the XMOS processor is similar to FPGA, being able to do real time DSP, true parallelism and deterministic code running. It is more suitable for time-sensitive applications than the Raspberry, as the Python Code runs at a high level and may lag.

  • Combining Thread
The Combining Thread section of the design will then combined each of the three above sections so that the system will be able to operate as an OS. The Movement Thread will be the main core in this system. Each of the movements will determine which of the sound effect is going played. In addition, the motion of servo motor will also based on the position values of the detected face. Combining Thread will be run by using python as programming language once each of the threads of the project is completed.

The link below was shown that the basic idea and knowledge for thread and multithread in python programming:

Team Pi Over Four entry 1,

No comments:

Post a Comment