2013年11月24日 星期日

Robot Arm + Arduino + Chrome App


Control Robot Arm using Chrome App and Arduino.

  我先從最簡單的軟體(Chrome App) 和 韌體(Arduino) 開始, 去控制有五個 Servo 馬達的機械手臂. 我會一點點的去修改。現在的階段,動作看起來是有點不順暢連續.

   Based on previous Chrome App to servo demo. I modify a little bit to control 5 servo motors. Then it's time to give the robot arm "life". All the parts of the robot arm are bought from mainland China. I assemble many months ago, I also write a console mode Python program under linux to "talk" to Arduino in order to control the robot arm, then I think I really need a GUI. When I start writing Chrome App, the first thing I want to do is controlling that robot arm.
   Well, I want to see it "move" as soon as possible before I spend too much time for the design of the communication protocol or even algorithms, so I start everything as simple as possible.
   In order to be simplest, a two-byte-protocol is used, that is, only two bytes is sent from Chrome App to Arduino (through Serial API) everytime.The first byte is the Id of the servo motor, second byte is the position. The range of position of each servo motor is only 10, so I only need to send character 0 to 9, and in the Arduino, it can be converted to integer easily. In Arudino, there is a simple switch-case to determine which servo motor to be controlled.
  There are a lot to be modified, the first thing is the protocol, may be I will also modified the mechanical part because I think the arm is "too short".

You can find the source code of the Chrome App and Arduino in here.
https://github.com/winghackerspace/chromeapp_sample/tree/master/arduino_robotarm

A short demo video


The electronics parts is just and Arduino UNO with a sensor shield, no extra hardware.

沒有留言:

張貼留言