[[FrontPage]]

#contents

*Basic operation sequence(Linux) [#y53f12a8]

1.Set battery on the Phenox.
-Please check that 4 propellers don't touch battery cable. 
-Battery is fixed to frame by double-sided adhesive tape. Users may renew it.
-Measure battery voltage to check if the voltage is not under 11.2V.

2.Set up bluetooth communication(needed once until host machine shutdown)
-Turn on power switch of Phenox without injecting micro SD card and run this command in terminal to get MAC address of bluetooth module.
 hcitool scan
-Turn off the power switch after MAC address is obtained.
-When MAC address is obtained, register bluetooth device as /dev/rfcomm1 using following command 
 rfcomm bind 1 xx:xx:xx:xx:xx

3.Add bluetooth device to host PC(first time only)
-Turn on power switch of Phenox without injecting micro SD card.
-Click the bluetooth icon at right upper on the window and select "Set Up New Device..."
-Choose "BC04-B" and click "continue".
-(If required,) Type '1234' when a pairing key number is required.
-Soon after, bluetooth communication will be enabled.
-Turn off the power switch of Phenox.

4.Set up serial terminal application(but not start it yet. We use "minicom" in this tutorial.)
--device name = /dev/rfcomm1
--baudrate = 230400 bits/s
--1 stop bit, non parity, 8 bit data
--no hardware flow control and no software flow control
-Users may be required to be an administrator.

#ref(basic_operation.png)

5.Inject micro SD card to Phenox, then turn on power switch.
-Users can see blue LED blinks at slow speed.
-If red LED doesn't turn off, please try again. 
--This often happens on some kind of micro SD card.([[known issue>Maintainance and Trouble Shooting]])
--Making backup of micro SD card is recommended so that users can copy contents to new micro SD card(see [[instruction>Maintainance and Trouble Shooting]]) 

6.Start minicom ("Exit" after setting above parameters)
6.Start minicom ("Exit" after setting parameters above)
-Blue LED will be lighting (not blinking) when connection is established.
-When no message appears after blue LED is in lighting state, wait 10 seconds and turn off power switch and retry again. ([[known issue>Maintainance and Trouble Shooting]])
-When no message appears after blue LED is in lighting state, wait 10 seconds and turn off the power switch and try again. ([[known issue>Maintainance and Trouble Shooting]])
-When the connection is established, message like "+CONNECTED" from bluetooth module itself interfers to minicom 
-If host PC fails to establish connection many times, Inject and eject bluetooth dongle and try again.
-If host PC fails to establish connection many times, inject and eject bluetooth dongle and try again.

7.u-boot command(if required)
-If u-boot is still running, please input the following command 
-If u-boot is still running, input the sdboot command 
 run sdboot 
#ref(boot1.png)

-By default, u-boot waits 3 seconds to start uncompressing kernel if no command is asserted. Users don't need to input the command if boot is already beginning. 
-By default, u-boot waits 3 seconds to start uncompressing kernel if no command is asserted. You don't need to input the command if boot is already beginning. 
 
-If following messages after "run sdboot", please turn off slide switch and try again.([[known issue>Maintainance and Trouble Shooting]])
-If following messages appears after "run sdboot", please turn off slide switch and try again.([[known issue>Maintainance and Trouble Shooting]])
#ref(boot4.png)

8.After root filesystem is mounted (as following picture), users can run your application or edit program.
8.After root filesystem is mounted (as following picture), you can run your applications or edit programs.
#ref(boot3.png)

-If following message appear after connection is established, press "ctrl+c" to assert command.
#ref(boot2.png)

9.Before you turn off the switch, run following command.
9.Before you turn off the switch, run the command below.
 shutdown -h now
-Four yellow LED blinks when the battery is nearly out.
-Phenox automatically starts landing when it is hovering state.
-Four yellow LEDs blink when the battery is nearly out.
-Phenox automatically starts landing when it is in hovering state.

10.Recharge battery if it is nearly out.
-connector type is JST-XH.
-Cheap 3 cell charger is available in following site. 
-Cheap 3 cell charger is available at following site. 
-http://www.hobbyking.com/hobbyking/store/__7637__Turnigy_balancer_Charger_2S_3S.html

*Basic operation sequence(Windows) [#wa40f34e]
0.Basic Concept
-Operational flow is almost same as Ubuntu. The main difference between the operation by Ubuntu and that by Windows is the way how to establish bluetooth connection.

1.Set battery on the Phenox.
It is same as Ubuntu case 1.
It is same as Ubuntu case, stage 1.
-Please check that 4 propellers don't touch battery cable. 
-Battery is fixed to frame by double-sided adhesive tape. Users may renew it.
-Measure battery voltage to check if the voltage is not under 11.2V.

2.Set up bluetooth communication
-We can skip this stage when using Windows.

3.Add bluetooth device to host PC(first time only)
-Turn on power switch of Phenox without injecting micro SD card.
-Open control panel and search by the word "bluetooth," and choose "add the device." (also see: http://windows.microsoft.com/en-us/windows7/add-a-bluetooth-enabled-device-to-your-computer)
-Choose "BC04-B" and click "continue".
-(If required,) Type '1234' when a pairing key number is required.
-Soon after, bluetooth communication will be enabled.
-Turn off the power switch of Phenox.

4.Inject micro SD card to Phenox, then turn on power switch.
-It is Same as Ubuntu operation stage 5 (NOT stage 4--only here the order of operation is different).
-It is Same as Ubuntu case, stage 5 (NOT stage 4--only here the order of operation is different from Ubuntu case).

5.Set up serial terminal application (we use "Tera Term" in this tutorial).
-Open port with port name = "COMx." (x is some number, so port name is something like "COM5." If many ports appear, try all of them to find correct port.)
-From "Setting" -> "Serial port", Configure serial port settings as follows.
--baudrate = 230400 bits/s
--1 stop bit, non parity, 8 bit data

6.Check Tera Term Console
It is same as Ubuntu case 6. From here all operations are same as those by Ubuntu, as those operations are command line operations of Linux OS on Phenox.
-Blue LED will be lighting (not blinking) when connection is established.
-When no message appears after blue LED is in lighting state, wait 10 seconds and turn off power switch and retry again. ([[known issue>Maintainance and Trouble Shooting]])
-When the connection is established, message like "+CONNECTED" from bluetooth module itself interfers to minicom 
-If host PC fails to establish connection many times, Inject and eject bluetooth dongle and try again.
-If host PC fails to establish connection many times, inject and eject bluetooth dongle and try again.


7.u-boot command(if required)
-If u-boot is still running, please input the following command 
-If u-boot is still running, input the sdboot command 
 run sdboot 
#ref(boot1.png)

-By default, u-boot waits 3 seconds to start uncompressing kernel if no command is asserted. Users don't need to input the command if boot is already beginning. 
 
-If following messages after "run sdboot", please turn off slide switch and try again.([[known issue>Maintainance and Trouble Shooting]])
#ref(boot4.png)


8.After root filesystem is mounted, users can run your application or edit program.
application or edit program.
8.After root filesystem is mounted, you can run your applications or edit programs.

#ref(boot3.png)

-If following message appear after connection is established, press "ctrl+c" to assert command.
#ref(boot2.png)

9.Before you turn off the switch, run following command.
 shutdown -h now
-Four yellow LED blinks when the battery is nearly out.
-Phenox automatically starts landing when it is hovering state.
-Four yellow LEDs blink when the battery is nearly out.
-Phenox automatically starts landing when it is in hovering state.

10.Recharge battery if it is nearly out.
-connector type is JST-XH.
-Cheap 3 cell charger is available in following site. 
-http://www.hobbyking.com/hobbyking/store/__7637__Turnigy_balancer_Charger_2S_3S.html

*Tutorial1:Reading images from two cameras [#k713cd2a]
+Follow step 1-7 of [[instruction>#y53f12a8]]
+enter /root and execute the script
 cd /root
 ./tutorial_image.sh
+waiting for "CPU1 ready" messages, and image acquisition starts.
-10 frame of images are obtained from front cameras. After that, 10 frame of images are obtained bottom cameras. 
-10 frames of images are obtained from front cameras. After that, 10 frames of images are obtained bottom cameras. 
+Press ctrl+c and system shutdowns automatically.
+turn off power switch. Then, eject micro SD card.
+Reading contents of "boot/*.png" in micro SD card using host machine, you will find images.

*Tutorial2:Sound recognition and whistle detection [#x73e6b54]
+Follow step 1-7 of [[instruction>#y53f12a8]]
+enter /root and execute the script
 cd /root
 ./tutorial_sound.sh
+When "sound start" message appears, sound recognition process starts for 2 seconds, so input your voice.
+When "sound start" message appears, sound recognition process starts and lasts for 2 seconds, so input your voice.
+After "sound finish" message appears, sound recognition by Julius starts.
+After "julius finish" message appears, result of voice recognition is printed.
+Users can check whistle detection."whistle detected" messages appears when whistle is detected. This check is important for later tutorials because whistle detection can work under noise of propeller rotation .   
+Users can check whistle detection."whistle detected" messages appear when whistle is detected. This check is important for later tutorials because whistle detection can work under noise of propeller rotation .   

*Tutorial3:Getting self state information and visualize feature points logs [#ab953a87]
1.Follow step 1-7 of [[instruction>#y53f12a8]]

2.enter /root and execute the script
 cd /root
 ./tutorial_selfstate.sh

3.Users can see 7 values are printed. 
-pitch,roll,yaw angle (1st,2nd,3rd columns)
-estimated position x,y,z (4th, 5th, 6th columns)
--Orientation is determined after executing script, so don't move Phenox until CPU1:all initialization finished" message appears.
--There exists calibration time to determine the orientation after executing script, so don't move Phenox until "CPU1:all initialization finished" message appears.
-height(sonar sensor)

-Check tx,ty,tz of self state (4th, 5th, 6th columns of printed messages) is updated smoothly by moving Phenox. Sometimes this update becomes very slow, and if this happens, shutdown Phenox and try again ([[known issue>Maintainance and Trouble Shooting]])
--Following definitions are used to define x, y, z coordinate. The x, y, and z axes correspond to rightward, frontward, and upward direction.

#ref(xyz_definition.jpg)

--And the roll-pitch-yaw definition is shown in the following picture. Roll angle increase means banking to the right. Plus pitch angle indicate nose up. Yaw angle increases when turning left.

#ref(angle_definition.jpg)

4.Install openframeworks http://www.openframeworks.cc/ and users can see feature points tracking log by building visualizer application. The following archive only includes source files. Thus users need to create own projects and copy them to correct folder.
4.Install openframeworks http://www.openframeworks.cc/ and users can see feature points tracking log by building visualizer application. The following archive only includes source files. Thus you need to create a new project and copy them to correct folder.
 
#ref(visualizer.zip)

In the case of Windows, CSharp visualizer program is also available.

#ref(FeatureLogVisualizer.zip)

-Executable file is at 'FeatureLogVisualizer->bin->Debug' directory. Put "featurelog.txt" on this directory (a sample txt file already exists in the directory; you can remove it) and execute "FeatureLogVisualizer.exe" by double click.

a.Shutdown Phenox and set micro SD card to host PC, and copy boot/featurelog.txt to correct path(see visualizer/src/testapp.cpp) 

b.Compile and execute visualizer. 

*Tutorial4:Manual control Simulation [#f43e128a]
-This is practice for Tutorial5, and this tutorial is strongly recommended before trying Tutorial5 
-Host PC should be Linux system to compile host program.
--Tutorial by Windows is [[Tutorial4'>#f3687dba]]
--Tutorial for Windows: [[Tutorial4'>#f3687dba]]

1.Please prepare PS3 controller.

2.Install a package required for joystick interface.
 sudo apt-get install joystick 

3.Download and unzip host PC program. 
#ref(zhost.zip)

4.Open joystick.h and rename joystick device to fit user environment. 
 #define JOYSTICK_DEVNAME "/dev/input/js0"

5.In host machine, please enter and build program.
5.In the host machine, enter and build program.
 cd zhost
 make

6.Follow step 1-7 of [[instruction>#y53f12a8]]

7.enter /root and execute the script
 cd /root
 ./tutorial_manualsim.sh

8.exit from minicom(press "ctrl+a" -> "z" -> "q") and run host program.
 cd zhost
 ./main
-Users may be required to be an administrator. Please add "sudo" at the beginning of the command if needed.
-If blue LED is lighting, connection is established. 
--press center logo mark of PS3 for first operation.  

9.In this tutorial, only message "button xxx is pressed" appears and by any command Phenox does not move.

10.When controller is detected correctly, following message appears.
++Press triangle -> "startup button"
++Press cross -> "stop button"
++Press circle or square -> "yaw button"
--When messages do not appear, rewrite button configuration and rebuild "zhost/main.c".

11.Press ctrl+c or "e" in host program to end this tutorial.
-Host program automatically send shutdown signal to Phenox.

*Tutorial4':Manual control Simulation (Windows) [#f3687dba]
This is Windows version of [[Tutorial4>#f43e128a]]. Windows has some problems as follows:
-"zhost" program is not available
-Windows does not recognize PS3 controller in most cases
++CAUTION: DO NOT USE "MotioninJoy" to connect Windows PC with PS3 controllers -- this software breaks bluetooth driver and disables communication with Phenox! Only when you has external and extra bluetooth receiver, MotioninJoy is useful.

Here we use another program for general PC joystick. Now only 64 bit Windows OS is supported. 32 bit environment is under the construction.
Here we use another program for general PC joystick. Now only 64 bit Windows OS is supported. 32 bit environment is under construction.

1.Download "SlimDX" from http://slimdx.org/download.php
-Choose your OS and ".NET 4.0" version. Though the runtime-only download is enough for this tutorial, SDK is better in that the code rewriting and rebuilding become possible.

2.Prepare a joystick for Windows PC. The joystick must have at least 2 analog sticks (4 axes) and more than 4 buttons. 

3.Connect the joystick through USB and device driver is automatically installed.
-You can check the connection by opening "control panel" and choose "USB game controller setup."

4.Download and unzip host PC program. 

#ref(ZHost_Windows.zip)

5.Follow step 1-7 of [[instruction>#y53f12a8]]

6.Enter /root and execute the script
 cd /root
 ./tutorial_manualsim.sh

7.Exit from terminal application (when using Tera Term, "Alt+i" command executes this) and run host program.
-ZHost_Windows -> bin -> debug -> ZHost_Windows.exe
-GUI window will be shown.


8.The program detects joystick's buttons and axes. Check the correspondence of them.
8.The program detects joystick's buttons and axes. Check the correspondence between them.
-Four axes' meaning are as follows.
--1st(left) : X motion (left and right)
--2nd       : Y motion (forward and backward)
--3rd       : not used
--4th(right): Z motion (upward and downward)
-If you want to change button configuration, do it before opening serial port for safety.
-When analog stick direction is reversed, you have to rewrite and rebuild the program. (This problem is serious when operating real manual control, so modified program will be distributed later.)

#ref(ZHost_Windows.png)

9.After setting baudrate and COM port name, click "Open Port"
-If blue LED is lighting, connection is established. Textbox shows messages from Phenox.

10.In this tutorial, only message "button xxx is pressed" appears and by any command Phenox does not move.
++Press Start "startup button"
++Press Stop -> "stop button"
++Press Yaw Minus -> "yaw button"
++Press Yaw Plus -> "yaw button"

11.After the check, exit controller program, return to your terminal application, and connect again. Press ctrl+c to end this tutorial.
-Phenox onboard program automatically operates shutdown command by ctrl+c.



*Tutorial5:Manual control [#r03ccc6e]
-Users control Phenox manually in this tutorial.

-Steps of this tutorial is almost same as [[Tutorial4>#f43e128a]] other than running different script in step6
-Steps of this tutorial is almost the same as [[Tutorial4>#f43e128a]] except that a different script runs in step 6.
 cd /root
 ./tutorial_manualreal.sh

-Check all propellers don't touch battery cable.
-Also, check the orientation. see "Important knowledge" of [[Hardware and Software Setup]]

-Commands from PS3 controller are defined as follows.

++Press cross and all motors stop immediately in any condition.
---So be careful NOT TO PRESS this button when Phenox flies high.
++Press triangle and robot enters startup sequence for 3 seconds. Then, robot enters weak hovering state.
---Startup sequence occurs only when motors don't rotate. In the hovering state, nothing happens when user press triangle button.
++Left joystick controls horizontal movement. 
++Right joystick controls height movement.

-Users can check how those button reflect order to Phenox without flying it by pushing the battery down(following picture).
#ref(DSC00260.JPG) 

*Tutorial5':Manual control(Windows) [#r4894996]
-This is Windows version of Tutorial 5.

-Steps of this tutorial is almost same as [[Tutorial4'>#f3687dba]] other than running different script in step6
-Steps of this tutorial is almost the same as [[Tutorial4'>#f3687dba]] except that a different script runs in step 6.
 cd /root
 ./tutorial_manualreal.sh

-Check all propellers don't touch battery cable.
-Also, check the orientation. see "Important knowledge" of [[Hardware and Software Setup]]

-Commands from the joystick controller are defined as follows. "Start", "Stop", "YawMinus", and "YawPlus" is the button you defined in ZHost_Windows.exe.
-CAUTION:Check which button is important again here, especially STOP BUTTON!
++Press "Stop" and all motors stop immediately in any condition.
---So be careful NOT TO PRESS this button when Phenox flies high.
++Press "Start" and robot enters startup sequence for 3 seconds. Then, robot enters weak hovering state.
---Startup sequence occurs only when motors don't rotate. In the hovering state, nothing happens by pressing "Start" button.
++Press "YawMinus" or "YawPlus" and robot turns left or right.
++Left analog stick controls horizontal movement. 
++Right analog stick controls height movement.
++Right analog stick controls vertical movement.

-Users can check how those button reflect order to Phenox without flying it by pushing the battery down(following picture).
#ref(DSC00260.JPG) 


*Tutorial6:Automatic hovering [#s69b4266]
-In this tutorial, the robot start hovering by user's whistle, increasing height at some stage(around 1.0m), then enters self position control mode, which uses bottom and range sensor. When the whistle sound is detected in this mode, Phenox goes down and lands.
-Performance depends on the environment. Stable flight means that many feature points are in the environment, and they are detected by bottom and front camera.

+Follow step 1-7 of [[instruction>#y53f12a8]]
+Put Phenox on the ground.
+enter /root and execute the script
 cd /root
 ./tutorial_autohover.sh
--Do NOT move Phenox before "CPU1:all initialization finished" message appears.
+Check following points before flight.
---Check all propellers don't touch battery cable.
---tx,ty of self state (4th and 5th columns of printed messages) is updated smoothly when users move Phenox horizontally. Sometimes this update becomes very slow, and if this happends, shutdown Phenox and try again ([[known issue>Maintainance and Trouble Shooting]])
---Sonar sensor operates normally (7th column of self state message).
+Blow the whistle and the robot enters startup for 3 seconds.
+The robot goes up through some stages and enters automatic hovering based on feature points controllers
+Blow the whistle strongly near the hovering robot. It enters landing mode and then, stop.
--Mic is attached on downside of Phenox, so whistle-blowing from downward is better to stop the machine.
--Mic is attached on the downside of Phenox, so whistle-blowing from downward is better to stop the machine.

-Users can stop Phenox immediately by holding one of legs and tilt over 60 degree (though it is dangerous; Please be careful not to touch the rotating propellers).


Front page   Edit Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes