Total Pageviews

Saturday, September 13, 2014

Jetson TK1 : boot problem - issue with libglx.so

You know something went wrong when things goes too smoothly. After flash the board for a few time to fix WiFi driver and install ROS Indigo my screen black out went I try to reboot it. Screen show streams of text while booting, then Nvidia logo show up and then went blank after that.

Don't to flash it once again, I search some more and found that I am not the only one and this (luckily). Problem, figure out by this guy, is that file libglx.so being replace by some update or process causing the board can't display properly. The fix is easy, go back to your host computer's download folder where you download Tegra124_Linux_R19.3.0_armhf.tbz2 package when to prepare to compile The Grinch kernel.
  • Unpack Tegra124_Linux_R19.3.0_armhf.tbz2
    • You we get Linux_for_Tegra folder.
  • Find Linux_for_Tegra/nv_tegra/nvidia_drivers.tbz2 and unpack it.
  • Navigate to usr/lib/xorg/modules/extensions/ there you will have the original libglx.so file.
  • Copy the original libglx.so file from host computer to the TK1 board, place it in the same usr/lib/xorg/modules/extensions/ folder. You may backup the TK1's libglx.so file first by change its name to something like libglx.so.bak
  • Cross your finger and reboot. 
  • If you boot into Ubuntu GUI screen then you're done! better to keep the new libglx.so file just in case we need it again. By copy and rename it to libglx.so.original.
 I hope all the smart guys at Nvidia will figure out the cause and way to get around this soon.

Jetson TK1, day2


https://devtalk.nvidia.com/default/topic/747574/embedded-systems/jetson-tk1-boot-issue/?offset=17#4308726

The problem is that after I move to The Grinch kernel and do some update & upgrade I can't reboot back to the Ubuntu screen. I tried ssh into it and its seem to working just fine. No choice, I decided to flash the board again, but I got a message "flash fail" and hence process to follow the Hint #1. After 2 times of flashing the board, problem still persist.

I then try to undo the Hint #1 by (follow this link for instructions)

remove
losetup --find --show system.img
And replace with
losetup /dev/loop0 system.img > /dev/null 2>&1
And flash it one more time. This time I able to update & upgrade and install ROS indigo (for ARM, bare-bone package) while able to reboot back to Ubuntu screen.

PS: I also tried to install ROS Indigo from source, which went fine, but actually someone (up there?) make an installation for Ubuntu-ARM architecture already, you can follow a link here.

Things went too smoothly, what else can go wrong? ... my Ubuntu screen gone again :(

Friday, September 12, 2014

Jetson TK1, day1



I recently got this new, cheap development from Nvidia called Jetson Tk1. The main highlight of these board is that its contain 192 GPU core inside. Unlike another microcomputer board like Raspberry Pi or BeagleBone black, TK1 is able to run Ubuntu 14.04 (ARM version) with decent graphic and response.

I got my board from newEgg website for around 300 SGD, for some reason you cannot buy the board from Nvidia's website if you are not in the US.
 
First boot-up went fine, just plug-in the 12 volt power supply that come with the board and it will boot into command-line screen. There you will see Nvidia driver install script, just execute that and it will restart and land you to Ubuntu's GUI screen.

Unfortunately, the kernel that chipped with TK1 (at least the one I got) doesn't support WiFi dongle. Searching around the web gave me 2 options.

Option 1:
Download RTL8192CU here and follow the procedure in comment #9 to include the driver into current kernel.

Option 2:
Follow an instruction from Nvidia development forum to upgrade kernel to The Grinch which added support for Wifi dongle and many more device.

I don't think totally wipe out an original kernel (option 2) since day 1 is not a very good idea, so I go for option 1, which went smoothly. After reboot the TK1 detect my WiFi dongle and able to connect to WiFi network with ease of Network manager with GUI.

After a while (like 10 minutes) I thought move on to The Grinch (option 2) might be a better ideal because I am planing to install ROS and OpenCV onto it, upgrade a kernel after will not be so easy.

That's when problems start to come up ...

Friday, July 12, 2013

Configure ROS package rosserial on Ubuntu

Some commonly missing step after install arduino IDE is forget to add yourself into "dialout" and "tty" group. You can do so by the following command.

$sudo usermod -a -G tty yourUserName
and
$sudo usermod -a -G dialout yourUserName

To use rosserial, after you have done everything in the rosserial's tutorial and try to complie (or verify) your code you might got an error message like the following :

In file included from /Users/kevin/Documents/Arduino/libraries/ros_lib/ros.h:39,
             from HelloWorld.cpp:6:
  /Users/kevin/Documents/Arduino/libraries/ros_lib/ArduinoHardware.h:38:22: error: WProgram.h: No such file or directory

You fix it by go to the mentioned file, in this case, located at "/Users/kevin/Documents/Arduino/libraries/ros_lib/"

$cd /Users/kevin/Documents/Arduino/libraries/ros_lib/
$gedit ArduinoHardware.h

Replace the line "#include WProgram.h" with the following

  #if defined(ARDUINO) && ARDUINO >= 100
 #include "Arduino.h"
 #else
 #include "WProgram.h"
 #endif

Go back to the IDE and compile the code again, and it should be fine. 

Thursday, July 11, 2013

Setup Canon iRC2380i printer on Linux Ubuntu

Canon-Europe website provide Linux driver for Canon iRC2380i printer. Just download CQue 2.0.5 Linux Driver DEB (32 bits or 64 bits version, depend on your machine) from the link. After download, double-click on the DEB file and Ubuntu Software Center should come up and you can install it from there.

After driver is installed successfully, go to System Settings -> Printing -> Add -> Click on Network Printer and wait for a while. Canon C2380/2550 should be on the list and you are done.


However, SMART need to set up  a department account (department ID and password) to protect the printer from unauthorized users. Unfortunately, the driver doesn’t support department account directly from GUI. The following guide will show how to do just that.


After you install the CQue Linux driver as mentioned above, you should have PPD folder locate at /opt/cel/ppd.

  • In terminal
$cd /opt/cel/ppd
$ls

  • Here you will see a long list of supported drivers, our Canon iRC2380i’s driver is named “cel-irc1028-pcl-en.ppd.gz” we need to unzip (using gzip) and modify it.
still in the /opt/cel/ppd folder
$gzip -d cel-irc1028-pcl-en.ppd.gz

  • Now you should have unziped file named “cel-irc2380-pcl-en.ppd” which we need to modify.
$sudo gedit cel-irc2380-pcl-en.ppd

  • Locate a line similar to (you can use find function (Ctrl+f) in gedit to find this line)
*NickName: "Canon iR C2380/2550 PCL
And modify it to
*NickName: "Canon iR C2380/2550 PCL SMART”

  • And also locate line
*ShortNickName: "Canon iR C2380/2550 PCL"
And modify it to
*ShortNickName: "Canon iR C2380/2550 PCL SMART"

  • Next locate line
*DefaultUserID: None
And modify “None” to your department’s ID, for example
*DefaultUserID: 12345

  • Last Locate line
*DefaultUserPassword: None
And modify “None” to your department’s password, for example
*DefaultUserPassword: 6789

  • You are done! Save the file and exit.

  • Back to System Settings -> Printing you should see the Canon iRC2380i icon there. Right-click -> Properties -> Settings -> Make and Model -> Change -> Choose “Provide PPD file” -> on the sidebar click on “File system” -> opt -> cel -> ppd -> chose the cel-irc2380-pcl-en.ppd we just edited. -> Select option “Use the new PPD … as is”

  • Now you will be back to Printer Properties window, in Settings you should see the Make and Model field is now write “Canon iR C2380/2550 PCL SMART”, which indicate that the printer are now using the PPD file we just edited.

  • Everything’s done … go try to print something.


Reference : XIN.at
Tested on Ubuntu 12.04 on 11 Jul 2013.

Wednesday, July 10, 2013

Fix an error when run apt-get update

I got an error after run an apt-get update recently, the error message look like these

W: Failed to fetch http://ppa.launchpad.net/jonls/redshift-ppa/ubuntu/dists/precise/main/source/Sources  404  Not Found

To fix it you can run the following command

gksu software-properties-gtk

and remove the problematic package (ppa.launchpad.net in this case), and then try apt-get update again.

Tuesday, July 9, 2013

Remove lengthly word from command promtp

There are many kind of script out there,but this is what suite me best. The script limit a command prompt to 30 character, if longer than that its will show only the first 12 and last 15 characters. The "\h" in the last line is added to show a hostname, convenient if you often work on remote machine.

To use, just put the following text in ./bashrc file. 

#--- Custom terminal, cutout lengthly word ---
PROMPT_COMMAND='DIR=`pwd|sed -e "s!$HOME!~!"`; if [ ${#DIR} -gt 30 ]; then CurDir=${DIR:0:12}...${DIR:${#DIR}-15}; else CurDir=$DIR; fi'
PS1='[\h:$CurDir] \$ '

Launch GNOME session from terminal


  • Switch to a second terminal by pressing: ctrl + alt + F2, and provide an current machine login information
  • start a new X-session: 
$xinit -- :1
  • ssh to target machine with -X option
$ssh -X username@targetmachineIP
  • once logged in, start a new gnome-session
$gnome-session

If you want to switch back to your current machine, just press: ctrl + alt +F7

Friday, June 28, 2013

Joystick on Groovy

Get a package from aptitude

sudo apt-get install ros-groovy-joystick-drivers

Follow this tutorial, start from topic "1.2 Configure the Joystick" onward, to configure a permission.

To start using the node, just run

rosrun joy joy_node

When node is running, you should be able to see topic named "/joy". To see data flow, just run

rostopic echo /joy

Tested using Xbox360 joystick for Window, on Ubuntu 12.04 running ROS Groovy.

Wednesday, March 6, 2013

Backup script


To make life a bit easier a backup script is attached here (at the end of this page) to make a full-system backup. The script will do the following:

  • It will empty your trash.
  • make an list of files and folder that to don't want to backup (an exclude_file mentioned as above). Files ended with .bag, .mpg, .mpeg, .avi, .png will be exclude and also everything in /tmp and /download folder.
  • then it will create a destination folder at your argument directory.

Usage of the script

chmod +x fullbackup.sh 

and then (assumed that you want to put a backup file at /home/golfcar)

./fullbackup /home/golfcar  

After backup finish, you will see a folder named like golfcart-master-010313.tgz where "golfcart-master" is your hostname and "010313" is a backup date (01/03/2013).

The script can be download from here

 link

Reference:
https://help.ubuntu.com/community/BackupYourSystem/TAR
https://sites.google.com/site/fmautonomy/private/documentation/backups

Thursday, December 13, 2012

DBSCAN

I was looking for the way to cluster a points, grouping a neighbourhood points together, but since I don't know number clusters in the data and therefore the k-mean clustering can't be use. After do some search on Google and our good friend Wikipedia I come across this alternative clustering algorithm.

DBSCAN is short from Density-Based Spatial Clustering of Application with Noise (reference from wiki : DBSCAN)

Explanation in plain english
DBSCAN requires two parameters: \varepsilon (eps) and the minimum number of points required to form a cluster (minPts). It starts with an arbitrary starting point that has not been visited. This point's \varepsilon-neighborhood is retrieved, and if it contains sufficiently many points, a cluster is started. Otherwise, the point is labeled as noise. Note that this point might later be found in a sufficiently sized \varepsilon-environment of a different point and hence be made part of a cluster.
If a point is found to be a dense part of a cluster, its \varepsilon-neighborhood is also part of that cluster. Hence, all points that are found within the \varepsilon-neighborhood are added, as is their own \varepsilon-neighborhood when they are also dense. This process continues until the density-connected cluster is completely found. Then, a new unvisited point is retrieved and processed, leading to the discovery of a further cluster or noise.

Here is a code in Python
 #! /usr/bin/python  
 from math import sqrt, pow  
   
 class DBSCAN:  
 #Density-Based Spatial Clustering of Application with Noise -> http://en.wikipedia.org/wiki/DBSCAN  
   def __init__(self):  
     self.name = 'DBSCAN'  
     self.DB = [] #Database  
     self.esp = 4 #neighborhood distance for search  
     self.MinPts = 2 #minimum number of points required to form a cluster  
     self.cluster_inx = -1  
     self.cluster = []  
       
   def DBSCAN(self):  
     for i in range(len(self.DB)):  
       p_tmp = self.DB[i]  
       if (not p_tmp.visited):  
         #for each unvisited point P in dataset  
         p_tmp.visited = True  
         NeighborPts = self.regionQuery(p_tmp)  
         if(len(NeighborPts) < self.MinPts):  
           #that point is a noise  
           p_tmp.isnoise = True  
           print p_tmp.show(), 'is a noise'  
         else:  
           self.cluster.append([])  
           self.cluster_inx = self.cluster_inx + 1  
           self.expandCluster(p_tmp, NeighborPts)     
       
   def expandCluster(self, P, neighbor_points):  
     self.cluster[self.cluster_inx].append(P)  
     iterator = iter(neighbor_points)  
     while True:  
       try:   
         npoint_tmp = iterator.next()  
       except StopIteration:  
         # StopIteration exception is raised after last element  
         break  
       if (not npoint_tmp.visited):  
         #for each point P' in NeighborPts   
         npoint_tmp.visited = True  
         NeighborPts_ = self.regionQuery(npoint_tmp)  
         if (len(NeighborPts_) >= self.MinPts):  
           for j in range(len(NeighborPts_)):  
             neighbor_points.append(NeighborPts_[j])  
       if (not self.checkMembership(npoint_tmp)):  
         #if P' is not yet member of any cluster  
         self.cluster[self.cluster_inx].append(npoint_tmp)  
       else:  
         print npoint_tmp.show(), 'is belonged to some cluster'  
   
   def checkMembership(self, P):  
     #will return True if point is belonged to some cluster  
     ismember = False  
     for i in range(len(self.cluster)):  
       for j in range(len(self.cluster[i])):  
         if (P.x == self.cluster[i][j].x and P.y == self.cluster[i][j].y):  
           ismember = True  
     return ismember  
       
   def regionQuery(self, P):  
   #return all points within P's eps-neighborhood, except itself  
     pointInRegion = []  
     for i in range(len(self.DB)):  
       p_tmp = self.DB[i]  
       if (self.dist(P, p_tmp) < self.esp and P.x != p_tmp.x and P.y != p_tmp.y):  
         pointInRegion.append(p_tmp)  
     return pointInRegion  
   
   def dist(self, p1, p2):  
   #return distance between two point  
     dx = (p1.x - p2.x)  
     dy = (p1.y - p2.y)  
     return sqrt(pow(dx,2) + pow(dy,2))  
   
 class Point:  
   def __init__(self, x = 0, y = 0, visited = False, isnoise = False):  
     self.x = x  
     self.y = y  
     self.visited = False  
     self.isnoise = False  
   
   def show(self):  
     return self.x, self.y  
       
 if __name__=='__main__':  
   #this is a mocking data just for test  
   vecPoint = [Point(11,3), Point(10,4), Point(11,5), Point(12,4), Point(13,5), Point(12,6), Point(6,10), Point(8,10), Point(5,12), Point(7,12)]  
   
   #Create object  
   dbScan = DBSCAN()  
   #Load data into object  
   dbScan.DB = vecPoint;  
   #Do clustering  
   dbScan.DBSCAN()  
   #Show result cluster  
   for i in range(len(dbScan.cluster)):  
     print 'Cluster: ', i  
     for j in range(len(dbScan.cluster[i])):  
       print dbScan.cluster[i][j].show()  


Sunday, November 25, 2012

tele-operate the Pioneer

I make some write-up about tele-operation code I have found somewhere I can't remember. May come handy later I guess.

https://sites.google.com/site/poonweb/robotics/tele-operation

I don't know how to put a code nicely on blogger, so I put it at my (long untouched) Google site.

Nice ROS installation guide

I have come across this site showing guide on ROS installation made easy, which really made it easy with step-by-step to install ROS. Should be very useful for anyone who looking for a "sure way" to install ROS on Ubuntu.

There site also have many interesting articles as well!

Tuesday, October 2, 2012

NASA Select Advanced Robotics Projects for Development



NASA ได้เลือก 8 โปรเจกต์ที่เกี่ยวข้องกับเทคโนโลยีหุ่นยนต์เพื่อที่จะนำไปใช้ในภารกิจการสำรวจอวกาศในอนาคต  โปรเจกต์ที่ได้รับการคัดเลือกมามีตั้งแต่โปรเจกต์ที่จะพัฒนาความสามารถของหุ่นยนต์สำรวจ (robotic planetary rovers) ไปจนถึงหุ่นยนต์เสมือนมนุษย์ (humanoid robotics systems)
ตัวอย่างหนึ่งของหุ่นยนต์ที่ทำงานเคียงข้างและคอยช่วยเหลือมนุษย์ในอวกาศก็คือ Robonaut หุ่นยนต์คล้ายมนุษย์ที่มีร่างกายแค่ส่วนบนของ NASA เป็นหุ่นยนต์ซึ่งนับเป็นหนึ่งในสมาชิกบนสถานีอวกาศนานาชาติที่ได้รับการทดสอบการใช้งานจริง และเริ่มช่วยเหลือการทำงานของนักบินอวกาศแล้ว ทำให้นักบินอวกาศมีเวลาที่จะนำไปใช้กับงานในห้องทดลองซึ่งมีความซับซ้อนและสำคัญกว่านานขึ้น 
จุดมุ่งหมายของ NASA ที่ต้องการพัฒนาขีดความสามารถของหุ่นยนต์นั้นก็เพื่อต้องการให้หุ่นยนต์สามารถทำงานเคียงข้างกับมนุษย์ทั้งบนโลกและในอวกาศ ซึ่งจะทำให้มนุษย์ทำงานได้อย่างมีประสิทธิภาพสูงสุด ลดข้อจำกัดด้านความสามารถของมนุษย์ และปรับปรุงเรื่องความปลอดภัยในการทำงานให้มากขึ้น
รายชื่อ 8 โปรเจกต์ที่ได้รับการสนับสนุนโดย NASA มีดังต่อไปนี้

  • หุ่นยนต์อวตาร (หุ่นยนต์ที่เคลื่อนไหวตามมนุษย์ผู้ควบคุมระยะไกล),  ”Toward Human Avatar Robots for Co-Exploration of Hazardous Environments,” J. Pratt, principal investigator, Florida Institute of Human Machine Cognition, Pensacola
  • ระบบขาเทียม,  ”A Novel Powered Leg Prosthesis Simulator for Sensing and Control Development,” H. Herr, principal investigator, Massachusetts Institute of Technology, Cambridge 
  • ระบบทำนายลักษณะพื้นผิวที่มีความอันตรายต่อหุ่นยนต์สำรวจ, “Long-range Prediction of Non-Geometric Terrain Hazards for Reliable Planetary Rover Traverse,” R. Whittaker, principal investigator, Carnegie Mellon University, Pittsburgh 
  • ผิวจำลองที่มีความสามารถในการรับรู้สำหรับหุ่นยนต์,  ”Active Skins for Simplified Tactile Feedback in Robotics,” S. Bergbreiter, principal investigator, University of Maryland, College Park 
  • ระบบส่งกำลังสำหรับหุ่นยนต์เสมือนมนุษย์, “Actuators for Safe, Strong and Efficient Humanoid Robots,” S. Pekarek, principal investigator, Purdue University
  • ระบบควบคุมหุ่นยนต์ระยะไกล,  ”Whole-body Telemanipulation of the Dreamer Humanoid Robot on Rough Terrains Using Hand Exoskeleton (EXODREAM),” L. Sentis, principal investigator, University of Texas at Austin 
  • หุ่นยนต์แบบบาง ๆ ยาว ๆ, ”Long, Thin Continuum Robots for Space Applications,” I. Walker, principal investigator, Clemson University, Clemson, S.C. 
  • ระบบควบคุมสำหรับหยิบจับวัตถุอ่อนนิ่ม,  ”Manipulating Flexible Materials Using Sparse Coding,” R. Platt, principal investigator, State University of New York, Buffalo 
NASA มีประวัติอันยาวนานในการพัฒนาเทคโนโลยีล้ำสมัยสำหรับการใช้งานในอวกาศ นอกจากนี้ NASA ยังได้ร่วมมือกับภาคเอกชนภายในสหรัฐฯ มหาวิทยาลัย และภาครัฐฯ ในการถ่ายทอดเทคโนโลยีเหล่านี้กลับสู่ภาคอุตสาหกรรมของสหรัฐฯ เพื่อเพิ่มความสามารถด้านการผลิต และการแข่งขันด้านเศรษฐกิจอีกด้วย
จากข่าวนี้เราจะเห็นได้ว่า NASA ได้เน้นความสำคัญไปที่การรับรู้และการควบคุมระยะไกลนั่นเอง

อ้างอิง

NASA


Wednesday, September 19, 2012

Set maximum screen size, Ubuntu 12.04

I just setup my work station at my new workplace and found out that my Ubuntu 12.04 with ATI graphic card cannot output dual screen (two 1600x900) with message indicate that it exceed maximum screen size (1600x1600). After doing some search I found a fix.

I have to configure file xorg.conf in ~/etc/X11/ folder by adding subsection "display" part is section "screen" as follow (character in green):

[~/etc/X11/xorg.conf] 
Section "Screen"
Identifier "Default Screen"
DefaultDepth 24
    SubSection "Display"
        Virtual 3600 3600
    EndSubSection

EndSection
Section "Module"
Load "glx"
EndSection
Above code will change maximum size to 3600x3600 larger than what I really want (but it's fine). Save and reboot the system and I can use dual-monitor as I want.




Monday, July 9, 2012

Curiosity's 7 Minute Of Terror



หลังจากเดินทางมุ่งหน้าไปยังดาวอังคารมาแล้วถึง 7 เดือน ตอนนี้ก็เหลือเวลาอีกเพียงไม่ถึงเดือนที่หุ่นยนต์สำรวจดาวอังคาร Curiosity ที่เดินทางไปกับจรวด Atlas V จะเดินทางถึง Gale Crater จุดหมายของมัน และเริ่มทำการสำรวจ ซึ่งมีวัตถุประสงค์ที่ต้องการศึกษาว่าสภาพแวดล้อมบนอังคารทั้งในอดีต และปัจจุบัน สามารถเกื้อหนุนให้มีสิ่งมีชีวิตบนดาวอังคารหรือไม่ แต่อย่างไรก็ตามช่วงเวลาที่อันตรายที่สุดของภารกิจนี้จะเริ่มขึ้นในช่วงเวลา 7 นาทีก่อนที่เจ้า Curiosity จะลงสัมผัสพื้นต่างหาก!
ถึงแม้ว่า Curiosity จะได้รับการออกแบบ และทดสอบเป็นอย่างดีโดยกลุ่มวิศวกรจาก NASA ซึ่งร่วมมือกับบริษัท Boeing และ Lockheed Martin ในการพัฒนา อีกทั้งมีประสบการณ์จากการส่งหุ่นยนต์สำรวจอวกาศคู่แฝด Spirit และ Opportunity มาแล้ว ขั้นตอนการลงจอดของ Curiosity ก็ยังถือว่าเป็นอะไรที่ "สุดโต่ง" มาก ๆ เลยทีเดียว
การส่งหุ่นยนต์ขนาดใหญ่อย่าง Curiosity ซึ่งมีขนาดใหญ่พอ ๆ กับรถ mini Cooper หนึ่งคัน มีน้ำหนักมากกว่าเจ้า Spirit และ Opportunity ถึง 5 เท่า ย่อมเป็นอะไรที่ไม่ธรรมดาแน่นอน นาย Bobby Braun อดีต Chief Technologist ของ NASA ได้กล่าวเอาไว้ในเอกสารทางวิชาการในหัวข้อชื่อ Mars Exploration Entry, Descent, and Landing Challenges ว่า ด้วยเทคโนโลยีที่มีอยู่ในปัจจุบัน เราไม่สามารถส่งอะไรที่มีขนาดใหญ่ หรือน้ำหนักที่มากไปกว่านี้ได้อีกแล้ว รวมถึงโครงการที่จะส่งมนุษย์ไปเหยียบดาวอังคารซึ่งต้องบรรทุกสัมภาระไปด้วยเยอะกว่านี้มาก ดังนั้นภารกิจในครั้งนี้ก็ถือเป็นจุด "สุดขีด" ของเทคโนโลยีสำรวจอวกาศในขณะนี้แล้วด้วยนั่นเอง! ความยากลำบากแทบทั้งหมดของภารกิจนี้เป็นผลจากการที่ชั้นบรรยากาศของดาวอังคารที่น้อยกว่าโลกถึง 100 เท่า ทำให้การลดความเร็วเพื่อเข้าสู่พื้นผิวดาวอังคารเป็นไปได้ยากมาก
ด้วยความที่สัญญาณวิทยุที่ส่งจากดาวอังคารต้องใช้เวลาถึง 14 นาทีกว่าจะเดินทางมาถึงโลก ในขณะที่ขั้นตอนการลงจอดทั้งหมด หรือที่เรียกว่า EDL (Enter, Descent, Landing) ใช้เวลาเพียง 7 นาทีเท่านั้น ซึ่งเท่ากับว่า  NASA จะไม่สามารถสื่อสารกับ Curiosity ในขณะที่อยู่ในขั้นตอน EDL ได้เลย กระบวนการทั้งหมดจะต้องทำด้วยระบบอัตโนมัติ และข้อผิดพลาดเพียงเล็กน้อยที่เกิดขึ้นในช่วงเวลาดังกล่าวจะสร้างผลกระทบอย่างรุนแรงต่อภารกิจ  รายละเอียดขั้นตอนการลงจอดจะอธิบายโดยละเอียด แบ่งเป็น 4 ส่วนหลัก ๆ ดังต่อไปนี้ครับ

ขั้นที่ 1 : การเข้าสู่วงโคจร
ในขั้นตอนการลงจอด Curiosity จะบรรจุอยู่ใน aeroshell เกราะกันความร้อนที่เกิดจากการเสียดสีกับชั้นบรรยากาศของดางอังคารที่ความเร็ว 5.3 - 6 กิโลเมตรต่อวินาที หรือประมาณ 19,080 - 21,600 กิโลเมตรต่อชั่วโมง ทำให้เกิดความร้อนสูงถึง 871 องศาเซสเซียส ที่ผิวภายนอก เทคโนโลยี aeroshell นี้ถือว่าเป็นเทคโนโลยีที่ใช้กันมาตั้งแต่ NASA ส่งหุ่นยนต์สำรวจดาวอังคารตัวแรก Viking  (รูปที่ 10 จากเอกสารทางวิชาการ ของนาย Bobby Braun) โดย aeroshell ที่ใช้ในภารกิจนี้มีขนาดใหญ่ที่สุดเท่าที่เคยสร้างมาเช่นกัน  การแก้ไขเส้นทางการลงจอดที่ผิดพลาดไปเนื่องจากการเสียดสีกับชั้นบรรยากาศอย่างรุนแรงในขั้นตอนนี้ จะใช้ไอพ่นขนาดเล็ก (reaction control system) จำนวนสี่ตัวที่ติดอยู่รอบ aeroshell ในการเปลี่ยนทิศทางของแรงยกที่เกิดจาก aeroshell เอง ให้ไปในตำแหน่งลงจอดตามต้องการ

หลังจากขั้นตอนนี้ ชิ้นส่วนที่เป็นฉนวนกันความร้อนด้านหน้าที่อยู่ด้านหน้าของ aeroshell จะถูกปลดออก และมีความเร็วลดลงเหลือเพียงสองเท่าของความเร็วเสียง หรือประมาณ 680 กิโลเมตรต่อชั่วโมง และอยู่สูงจากพื้นผิวดาวอังคาร 10 กิโลเมตร

ขั้นที่ 2 : ปล่อยร่มชูชีพอีกครั้งหนึ่งที่ขนาด และน้ำหนักของ Curiosity ได้เข้ามาทำให้การปล่อยร่มชูชีพเพื่อชะลอความเร็วลงไปอีกมีความยุ่งยากมากขึ้น  ในภารกิจที่ผ่านมาน้ำหนักของหุ่นยนต์ (Viking, Spirit, Opportunity) มีน้ำหนักน้อยกว่ามาก ทำให้ร่มชูชีพช่วยลดความเร็วก่อนที่จะลงสู่พื้นผิวได้  แต่สำหรับ Curiosity ที่มีน้ำหนักมากกว่า Opportunity ถึง 5 เท่าทำให้ร่มชูชีพที่ใช้ต้องมีขนาดใหญ่เป็นพิเศษ ถ้าจะใช้ร่มชูชีพที่ใช้เทคโนโลยีแบบเดียวกันกับภารกิจก่อนหน้านี้ ร่มชูชีพของ Curiosity อาจจะต้องมีขนาดใหญ่ถึง 19.7 เมตร มากกว่าสองเท่าที่ใช้ในภารกิจ MER (Mars Exploration Rover, Spirit และ Opportunity) ที่ใช้ร่มชูชีพขนาด 8.9 เมตร  นอกจากนี้ร่มชูชีพแบบดังกล่าวได้รับการทดสอบถึงความเร็วที่ 1.8 เท่าของความเร็วเสียงเท่านั้น (ใช้งานจริงที่ 1.2 เท่าของความเร็วเสียง) สรุปก็คือ ด้วยเทคโนโลยีเก่านี้ NASA จะต้องใช้ร่มชูชีพที่ใหญ่กว่าเดิมมาก และเริ่มการปล่อยร่มชูชีพที่ระดับต่ำกว่าเดิม (เพราะต้องปล่อยตอนที่ความเร็วจากขั้นตอนแรกลดลงถึง 1.8 เท่าของความเร็วเสียง แทนที่จะเป็น 2.0 เท่า) ซึ่งจะเพิ่มความซับซ้อน และความเสี่ยงของภารกิจมากขึ้นไปอีก

NASA จึงร่วมมือกับบริษัท ILC Dover เพื่อพัฒนาร่มชูชีพที่ใช้เทคโนโลยี IAD (Inflatable Aerodynamic Decelerator) ซึ่งต่างจากวัสดุของร่มชูชีพธรรมดาที่เป็นฟิล์มบาง ที่อุปกรณ์ IAD นี้จะแข็งตัวเมื่อกางออก มีความทนทานและแข็งแรงพอที่จะทนความร้อนของขั้นตอนการลงจอดในส่วนนี้ได้ โดยอุปกรณ์ที่นำมาใช้ในภารกิจนี้จะเป็นเทคโนโลยีที่เรียกว่า SIAD (Supersonic Inflatable Aerodynamic Decelerator) เพราะสามารถที่จะใช้งานที่ความเร็วสูงสุดที่ 2.2 เท่าของความเร็วของเสียงได้ นอกจากนี้ขนาดของร่มชูชีพก็จะสามารถลดขนาดลงเหลือเพียง 16 เมตร เท่านั้น ขณะที่ร่มกาง aeroshell จะต้องรับแรงกระแทกที่มากถึง 9 เท่าของแรงดึงดูดโลก ก่อนที่จะเริ่มสำรวจพื้นผิวดาวอังคารเพื่อยืนยันจุดลงจอดโดยใช้อุปกรณ์เรดาร์ สแกนด้วยความถี่ 5 เฟรมต่อวินาที ที่ระดับความสูงตั้งแต่ 3.7 กิโลเมตรจากพื้นผิว เป็นระยะเวลาสองนาที

ขั้นที่ 3 : ลดความเร็วโดยใช้จรวดขับดันตอนนี้ความเร็วของ Curiosity ลดเหลือเพียง 6 กิโลเมตรต่อวินาที ที่ความสูง 1.8 กิโลเมตร แต่ความเร็วก็ยังสูงเกินไปสำหรับการลงจอด ในขั้นตอนนี้ aeroshell จะถูกปลดออก เหลือเพียงอุปกรณ์ช่วยลงจอดที่ติดอยู่กับ Curiosity ซึ่งประกอบด้วยจรวดขับดัน 8 ตัวที่ใช้ชื่อว่า Mars Landing Engine (MLE)  แต่ละตัวสามารถให้แรงขับตั้งแต่ 400 ถึง 3,100 นิวตัน ช่วยลดความเร็วของ Curiosity ลงจนอยู่ในระดับความเร็วที่มันสามารถควบคุมทิศทางได้ ในขณะที่มันลอยอยู่นั้นมันก็จะเริ่มหย่อน Curiosity ที่ตอนนี้ได้เปลี่ยนจากท่าทางที่มันคุดคู้อยู่ใน aeroshell มาอยู่ในท่าที่เตรียมจะลงสัมผัสกับพื้นผิวดาวอังคารแล้ว

ขั้นที่ 4 : การลงสัมผัสพื้นด้วยลักษณะของ Curiosity ที่ถูกห้อยลงมาจากอุปกรณ์ช่วยลงจอดที่กำลังลอยตัวอยู่ทำให้ อุปกรณ์ช่วยลงจอดในขั้นตอนนี้ถูกเรียกว่า Sky Crane หรือ "ปั้นจั่นลอยฟ้า" นั่นเอง ในขั้นตอนนี้ Sky Crane ยังทำหน้าที่แก้ไขความผิดพลาดของตำแหน่งลงจอดให้น้อยที่อยู่  เมื่อถึงตำแหน่งที่สามารถลงจอดได้แล้ว Sky Crane จะลดระดับความสูงลงเหลือประมาณ 7.5 เมตร และเริ่มหย่อน Curiosity ลงจนสัมผัสพื้น หลังจากที่ Curiosity ได้ส่งคำสั่งยืนยันว่าตัวมันได้ลงถึงพื้นแล้ว Sky Crane จะรออยู่อีกประมาณ 2 วินาที ก่อนที่มันจะตัดสายที่ใช้หย่อน Curiosity ลงมา และสายส่งสัญญาณอื่น ๆ ออกโดยใช้อุปกรณ์ pyro ซึ่งเป็นวัตถุระเบิดขนาดเล็ก ก่อนที่จะบอกลา และบินออกไปให้ไกลจาก Curiosity ให้ได้มากที่สุดเพื่อความปลอดภัย

หลังจากขั้นตอนนี้ Curiosity ก็อยู่บนพื้นผิวดาวอังคารและพร้อมที่จะสำรวจสภาพแวดล้อมของดาวอังคาร เพื่อวิเคราะห์ว่าสภาพแวดล้อมทั้งในอดีต และปัจจุบันของดาวอังคารสามารถเกื้อหนุนสิ่งมีชีวิตได้หรือไม่ และยังเป็นการเก็บข้อมูลเพื่อที่จะเตรียมความพร้อมสำหรับภารกิจการส่งมนุษย์ไปเหยียบพื้นผิวดาวอังคารในอนาคตอีกด้วย

แม้ว่านี่ไม่ใช่ครั้งแรกที่ NASA จะส่งหุ่นยนต์ไปถึงดาวอังคาร อีกทั้งระบบ และอุปกรณ์หลาย ๆ อย่างที่ใช้ในภารกิจนี้ก็พัฒนาต่อขึ้นมาจากสมัยของภารกิจ Viking แต่ระบบ Sky Crane นี้เป็นระบบที่ไม่เคยมีการใช้งานจริงมาก่อนและกำลังจะได้รับการพิสูจน์ในอีกไม่กี่วันข้างหน้านี้แล้ว

เพื่อความไม่สับสน ตามไปดู clip video อธิบายขั้นตอนการลงจอดแบบ animation กันเลยดีกว่าครับ



อ้างอิง :
Wired Science : Landing on Mars
NASA : NASA news

Friday, June 15, 2012

Raspberry Pi! anyone?

I just got my long awaited Raspberry Pi, super small and cheap computer, from element14 at S$48. The Pi equipped with everything you will need for typical computer, USB, Ethernet port, HDMI, SD card slot and audio output.


List of additional hardware:

  • HDMI - to - DVI cable : because my monitor not support HDMI :(
  • USB with external powered hub : I plan to use WiFi- USB device later which power supply from USB alone is not enought.
  • SDHC (hi-speed SD card) class 6 : from information I can find, the Pi only support SD or SDHC card, not micro-SC card with adapter, with class 4 or more (speed issue I guess?).
This three item cost me about S$82, hope I can learn a lot from it. Let's try ...

First, prepare your SD card

I used the "Easy way" from this link which in short include just two step. First, download Win32DiskImager which is a tool to copy your image file (will get to this in step 2) into your SD card. Step two, download image file, the Debain "squeeze" is recommended one.

Two, connect your hardware

Next obvious step is to connect a required hardware - keyboard, mouse, screen and SD card (you prepared in the first step). For power port, I use my phone charger which luckily a micro USB and provide 1A maximum. Power from USB port alone is not enough for the Pi because its need 700mA while USB 2.0 can provide 0.5A maximum.


Last step, hold your breadth and power it up

When you plugged power cord in you will see a red and green LED onbord the Pi start to blink and (hopefully) your screen flushing with output like this,


And after awhile, it will ask you to input login name (default: pi) and password (default: raspberry). When that's done, you are ready to go! use command "startx" to launch an X window system and you got this


Hoorey! you just got yourself a brand new tool to learn lots of new things!

Tuesday, June 5, 2012

LabView diagram for H-bridge control

Well, after wiring all the cable it's time for programming! My tools of choices for this quick jobs is LabView from National Instrument.

Setting up serial communication in LabView can be done using just 4 block, Open port, Send data, Receive data and Close port. Put everything in While-loop adds a few button and even-case and we are good to go!

My code is shown below :


Well, what the point of seeing my code? would it be nice if you can just copy + past and run above code without having to drag and drop everything yourself? Here is another thing I love about LabView, you can just copy above picture (it is .png file) then open your newly open LabView windows and drop the picture on the window, then tada~~~ there is a ready to run VI for you.

Some useful tip
Do not change direction of your motor abruptly, stop a motor first then change. This is to prevent current surge in your circuit especially when you don't have any current protection circuit like mine!

Warning!
Before connect your motor to power source, it would be wise to test the H-bridge circuit first! Relay of the same side must not close (current able to pass through) at the same time, otherwise current will pass from source (say 24Volt.) directly to Ground which will burn all of your cables and relays.

Quick jobs : H-Bridge circuit to drive a motor

To day my supervisor just pop in and throw me 8 solid-state-relay (SSR) and ADAM-4068 (Serial-I/O device) and ask me to wire a circuit to control a motor for his robot.

ADAM-6048 is a handy device that let you control digital input and output via RS-485, serial communication given a protocol in its manual. Output of ADAM is rated at 0.5 ampere so I use it to control the SSR which can operate up to 40 ampere each.

Circuit diagram is as follow, bigger line means high current cable :


Note :
RL0 NO -- Relay channel 0 of ADAM, Normally Open pin
RL0 COM -- Relay channel 0 of ADAM, Common pin

When output set to "high", current will able to flow from COM to NO. Best to imagine it as a simple switch, when push both pin will connect and let a current flowing. Then pin 1 and pin 2 of SSR will connect and let a (high) current pass through the motor.

Warning!
Unlike normal relay, SSR let current pass in only one direction, from pin 2 to pin 1 and from pin 4 to pin 3 as I indicate + and - sign in above diagram. I blown 2 SSR because of this ignorance!


SSR I'm using are Maxwell's MS-DD6040.

Sunday, June 3, 2012

Getting start with ROSARIA

After get ROS installed, let's get ARIA working. ARIA is an open-source software to communicate with ACOS (low-level control of our Pioneer3-AT). ROSARIA is name of ARIA package in ROS.

I came across this post about how to get ROSARIA install,
http://answers.ros.org/question/11962/require-help-using-rosaria/

I follow the recommended answer and got ROSARIA install successfully. There are some points that I would remind you, before you install the package as mentioned in the post you should go to your working folder first. If you follow the ROS tutorial as I recommended, your working folder is the "ros_workspace" folder in "home" directory. After ROSARIA package is installed, make sure you don't miss the "rosmake" part!, you will get folder "hg" in "ros_workspace".

Also note that the "teleop_base" path will not work as it is no longer support in ROS Electric, but don't worries we will talk about it later.

When everything is ready, let's try it out!

Step1: Safety first!

The most important thing in working with everything with moving part is safety! Take a look around and grab anything that can fit underneath your bot's belly to lift it up, all the wheels should not contact the ground and move freely. This is important because we don't know what gonna happen after we powered our robot for the first time or after we run a new piece of code.

Step2 : Connect to the robot

Now that your robot hang helplessly above ground it's a time to bring it to life! Get you RS-232 ready and plug it to the Pioneer DB9 socket, then plug another end to your computer (of course). Then power your bot up and release the emergency switch (the red button switch).

Step3 : First contact

First thing first, you need to figure out which communication port you are using. ROSARIA default value of port is ttyUSB0, for those USB-to-Serial converter. In my case it's old-school serial port ttyS0.

Bring up you terminal and go to your ROS workspace folder.
$ cd ros_workspace 

In first terminal, bring ROS up to work
$ roscore 

Leave the first terminal untouch and open another terminal and go to your workspace again, now run.
$ rosrun ROSARIA RosAria _port:=/dev/ttyS0

In above code, you may change the "/dev/ttyS0" part to your connected port such as "/dev/ttyUSB0", "/dev/ttyUSB1" or "/dev/ttyS1".

When you press enter, your robot should make a beep-beep sound and have something show-up in your terminal.

Congratulation! you just bring your robot up to life for the first time!