Home

Maze Solving by a Humanoid Robot - Introduction

image

Contents

1. essseeseem 33 Figure 21 Right hand wall following exam ple x 33 Figure 22 Flowchart representing the decision making wall following algorithm developed 34 Figure 23 Maze map and robot s route ssssssssssseeeeeeee nene nennen nnne 36 Figure 24 Robot solving the maze essssssssssessseee eene hehehe eher teann 36 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report GLOSSARY Term Meaning Dynamixel This is the basic unit of the Bioloid which acts as a joint or a sensor TTL Time to live CAD Computer Aided Design FIRA Federation of International Robo Soccer Association DOF Degree of Freedom GUI Graphical User Interface LED Light Emitting Diode Nauman Shah Maze solving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 1 Introduction This chapter gives a brief introduction to the project highlighting the main aim of the project and objectives set to achieve the aim The chapter explains the methodologies implemented to accomplish the objectives It then talks about the feasibility study carried out and the cost analysis of the project It talks about the project s marketability and its applications in the practical world 1 1 Introduction In 1923 Karel Capek
2. Checks the sensors and returns 3 bit value J uint8 t CheckSensor uint8 t Obstacle Detection Flag Bit 0 Object detected on left Bit 1 Object detected on center Bit 3 Object detected on right gbpParameter 0 S OBSTACLE DETECTION FLAG gbpParameter 1 1 Read Compare Bit TxPacket SensorID INST READ 2 uint8 t bRxPacketLength RxPacket DEFAULT RETURN PACKET SIZE 4gbpParameter 1 if bRxPacketLength DEFAULT RETURN PACKET SIZE gbpParameter 1 if gbpRxBuf fer 4 0 Obstacle Detection Flag gbpRxBuffer 5 else error return SERVO NOT CONNECTED else error return SERVO NOT CONNECTED return Obstacle Detection Flag Nauman Shah Maze solving by a Humanoid Robot 72 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report KK KKK KK KKK KK KKK KK KK KKK KK KKK KK KKK KK KKK KK KKK KK KKK KK KKK KK KKK KK KKK KK KK KKK KK KKK ck k ko ko ko Main c Maze Solving by a Humanoid Robot Nauman Shah 07155081 Final Year Project University of Hertfordshire koe ke eee e ke e ce e ecce ke eee ce ce eee KKK KK kc ecce ce ke kk ce oe kk ce ke kk ck kc kk cec ce ke cec ce koc ck ck KKK ck ck ko kk x included files s include inttypes h include avr io h include avr interrupt h include avr signal h include ME h include Sens
3. Mode button shown in Figure 7 The Start button starts the program loaded into the memory of the CM 5 and the Mode button switches between the operating modes of the CM 5 Module Serial Cable Jack POWER Status display LED Power JACK l 3 Start button 3 Mode button Direction buttons Mode display LED Top view of the CM 5 Figure 7 CM 5 Module Top View The controller operates in 3 different modes 1 Manage Mode This mode is used when the user wants to monitor the status of the CM 5 unit or the Dynamixels or when a motion is to be tested Program Mode This mode is used for editing the motion of the robot Play Mode This motion is used to run the program loaded in the module The firmware of the CM 5 module provided with the Bioloid Kit allows the charging of the module using the SMPS switched mode power supply connected through the power jack Nauman Shah Maze solving by a Humanoid Robot 11 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The CM 5 module is housed in a sturdy plastic casing which houses the controller as well as the battery pack 19151116 iv Assembly Parts The frames provided with the Bioloid Kit Fes T A te AA 5 include frames made from injection molded L YA NA Lesa Ww CEO ngg WI v y plastic and are designed to firmly hold the Figure 8 Bioloi
4. Reserved 7 O Ox00 86 0x22 Moving RO D Ox00 g7 ox2Fi cock Ox 4940x31 Puncnit ROW c ox00 Nauman Shah Maze solving by a Humanoid Robot 47 University of Hertfordshire School of Electronic Communication and Electrical Engineering Appendix C AX S1 Sensor Control Table Control Table EEPROM Area RAM Area Aoa sauna S owa SOxOSr Return Dear Tine aowa para SICHIE Reserved ROWR 2550F 7I0X07 Reserved RWA 3003 SIDE Reserved ROWR 2550F 910x09 Reserved ROWR 30x03 TUERI ft NDI LLUOXOB KA iheserveg ka 2010X14l Ostacle Detected Compare Value ROWA 320020 210X15 _Liont Detected Compare Value RO WR 320020 2210x161 Reserved ROWR 32 0x20 2910x171 Reserved n amp RD 3003 a fwd pg 2510x191 Reserved Cid 3310x211 Lumnostty Detection Fag ao 3 34 0X22 Reserved CRW 39 0X23 Sound Data n h 5 ROW amp o 96 0X24 Sound Data MaxHold ROWR amp 9 370X25 Sound Detected Count f ROWR 93 3310X261 TEIDE ithenocon Atego KA T 47 0x2F AA A Misi 88 0x301 _IR Remocon RX Data 0 AD 9 4910x311 _IR Remocon RX Datat AD 9 90 0x32 _IR Remocon TX Data 0 ROWR 3 9100x331 _IR R
5. Instruction byte Length of parameters TxPacket return length of Return packet from Dynamixel WA byte TxPacket byte bID byte bInstruction byte bParameterLength Transfers intstruction packet byte bCount bCheckSum bPacket Length Nauman Shah Maze solving by a Humanoid Robot 53 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report gbpTxBuffer 0 Oxff 0xFF OxFF indicate the start of the instruction packet gbpTxBuffer 1 Oxff gbpTxBuffer 2 bID gbpTxBuffer 3 bParameterLength 2 Length Paramter Instruction Checksum gbpTxBuffer 4 bInstruction for bCount 0 bCount lt bParameterLength bCount f gbpTxBuffer bCount 5 gbpParameter bCount bCheckSum 0 bPacketLength bParameterLengtht442 for bCount 2 bCount lt bPacketLength 1 bCountt bCheckSum gbpTxBuffer bCount gbpTxBuffer bCount bCheckSum Writing Checksum with Bit Inversion RS485 TXD for bCount 0 bCount bPacketLength bCount f sbi UCSROA 6 SET TXDO FINISH TxD80 gbpTxBuffer bCount while CHECK TXDO FINISH Wait until TXD Shift register empty RS485 RXD return bPacket Length RxPacket read data from buffer RxPacket need a Parameter Total length of Return Packet RxPacket return Length of Return Packet d d byte RxPacket byte bRxPacket Length define RX TIMEOUT C
6. PARAMETER 1 PARAMETER PARAMETER N CHECK SUM The two OxFF bytes indicate the start of the packet The ID contains the unique ID of the Dynamixel sending the Status Packet The Length field carries the length of the packet Its value is computed by the formula Number of parameters 2 The Error byte contains a value indicating the type of error if any Each bit of the byte represents a specific error shown in the table below Table 2 Status Packet Error Byte Structure P et to 1 if an undefined instruction is sent or an ee ction instruction is sent without a Reg_Write n Checksum Set to 1 if the checksum of the instruction packet is Error incorrect d 1if the instruction sent is out of the defined et to 1 If the Internal temperature of the Dynamixel TD unit is above the operating temperature range as Orinecd if Lg DT D ane Angle Limit Set as 1 if the Goal Position is set outside of the Error range between CW Angle Limit and CCW Angle Limit Input Voltage Set to 1 if the voltage is out of the operating voltage Error range as defined in the control table Parameter carries the additional information needed to carry out the instruction For example if writing to a certain address of a servo the address as well the data to be written is contained in this field of the packet Finally a checksum sum is attached to assure successful transmission of the packet S1 4 2 3 Chapter Summary This chapter det
7. School of Electronic Communication and Electrical Engineering BEng Final Year Project Report LIST OF FIGURES Figure 1 The Bioloid Comprehensive Kit i 8 Figure 2 Dynamixel AX 12 Servo rH ITO 8 Figure 3 AX 12 Servo Movement Range BE copies dena incu Ec EEUU 9 Figure 4 AX 81 Sensor Module Paste oM Ses UM uie Aa 9 Figure 5 AX 81 Module sensor and receiver location ui AKA OS 9 Figure 7 CM 5 Module Top View NT ana tees 11 Figure 6 The CM 5 Main Controller Module 9 11 Figure 8 Bioloid Frame Set uL 12 Figure 9 Behavior Control Screenshot sssssssssesssseeee eene nnne nene 12 Figure 10 Behavior Control program example Hoe 13 Figure 11 Motion Editor Software Screenshot ssesseseee ee 13 Figure 12 Motion Editor Screen Description lt mwamwanaawwnnwanu manana nanazunaaazuna kununa 14 Figure 13 Bioloid s flash memory division wanan kaiiwa wa kakaa ku waka wakuwa akaka kaaa Henn 15 Figure 14 Robot Terminal Screenshot AA PAA 16 Figure 15 Wiring of CM 5 Module with Dynamixels I 17 Figure 16 CM 5 Internal Circuit Diagram NAAGAPAN Wa 17 Figure 17 Bioloid Communication Protocol kaaa ia kawawa ninnaa Hee 18 Figure 18 Bioloid Humanoid Model P 20 Figure 19 WinAVR Comiler Screenshot i WA UA 21 Figure 20 Bioloid Humanoid Sensor Directions
8. Setup l HelptH gf Dyrariel Pose task wind Command gt gt Task informatie area Saved posed window Figure 12 Motion Editor Screen Description The figure shows the Motion Editor screen showing the page information for a walking droid model robot The Pose task window shows the current pose selected to be edited This 3D image of the robot is synchronized with the actual one implementing the pose on the robot as it is edited on the Motion Editor and vice versa Once edited they can be saved in the page by simply dragging the pose down to the Saved Pose Window The Saved Pose window shows the poses in the current page being accessed These poses can be individually accessed edited and played on the robot The Task Information Area shows the Pose Speed and the Pose Pause of the current pose selected The Pose Speed is the speed at which the pose is played on the robot The default value of this parameter is 32 Higher value increases the speed such that a value of 64 doubles the pose speed The Pose Pause value illustrates a time delay to wait for after the pose finishes playing before moving on to the next pose The value specifies a delay of 7 8msec per this value The joint Information window shows the current join positions of the robot These numeric values can be increased or decreased by the user to create a certain pose A torque on off button is also available to turn the to
9. Speed NSpeed 90 degrees Time in Steps Time 7 81 KA ME MoveFinishTime uint16 t float 7 81 Max 3 41 NSpeed 90 128 32 ME PageSpeed Max Servo Speed is the speed of the Servo that has to move at the most distance 135 is the speed value stored for the servo to move at 90 degrees sec Will change if NSpeed changes i e Pages Speed or Pose Speed changes from default 32 MaxServoSpeed NSpeed 135 0 Read Pose PosePause uint16 t float Read Pose PosePause 32 ME PageSpeed for ServoNo 1 ServoNo lt NUM OF SERVOS ATTACHED ServoNo f Difference Read Pose ServoTarget ServoNo Read Pose ServoPos ServoNo if Differencex0 Difference Difference Nauman Shah Maze solving by a Humanoid Robot 64 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Calculate the speed of each servo in reference to the Servo Moving at the Max speed one that has to move the max distance ServoRefSpeed uint16 t float MaxServoSpeed float Difference float Max if ServoRefSpeed MaxServoSpeed ServoRefSpeed MaxServoSpeed SendServoTargetPos ServoNo Read Pose ServoTarget ServoNo ServoRefSpeed Read Pose ServoPos ServoNo Read Pose ServoTarget ServoNo _delay ms ME MoveFinishTime 10 return Read_Pose PosePause Implements the
10. The kit includes 18 Dynamixel series AX 12 servos the Robotis servos 1 Dynamixel AX S1 sensor module a CM5 processor module the main controller and a number of nuts and bolts The kit comes with three software utilities to program the robot A GUI based Motion Editor which allows the users to create 3D motion sequences and play them on your robot Figure 1 The Bioloid Behavior Control Program on the other hand lets you write Comprehensive Kit algorithms in modular forms and design the logic for the robot Last a Robot Terminal software is a command based application for low level management of the robot 2 2 1 Hardware The modular bas ed kit has 3 main building blocks in addition to the simple assembly parts i AX 12 Servo Module The Dynamixel series AX 124 servo from Robotis is one of the most advanced actuators available in the market It is a smart modular servo that incorporates a gear reducer a precision DC motor and a control circuitry with networking functionality all in a single package P The powerful servo despite its compact size can produce high torque and provides the necessary strength to Figure 2 Dynamixel withstand large external forces due to its high quality structural 11 T AX 12 Servo specifications Each AX 12 actuator is equipped with a sensor module which enables it to detect and act upon environmental and internal conditions such as changes in temperature or supply volt
11. 2 uint8 t bRxPacketLength RxPacket DEFAULT RETURN PACKET SIZE 4gbpParameter 1 if bRxPacketLength DEFAULT RETURN PACKET SIZE gbpParameter 1 f if gbpRxBuf fer 4 0 f CenterObstacle gbpRxBuffer 5 else error return SERVO NOT CONNECTED Nauman Shah Maze solving by a Humanoid Robot 70 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report else error return SERVO NOT CONNECTED if CenterObstacle CENTER OBSTACLE THRESHOLD return 1 else return 0 Ee Checks right sensor Returns 1 if an obstacle is detected EL uint8 t CheckRightSensor uint8 t RightObstacle gbpParameter 0 S RIGHT IR SENSOR DATA gbpParameter 1 1 Read Compare Bit TxPacket SensorID INST READ 2 uint8 t bRxPacketLength RxPacket DEFAULT RETURN PACKET SIZE gbpParameter 1 if bRxPacketLength DEFAULT RETURN PACKET SIZE gbpParameter 1 f if gbpRxBuffer 4 0 f RightObstacle gbpRxBuffer 5 else error return SERVO NOT CONNECTED else error return SERVO NOT CONNECTED if RightObstacle 5 RIGHT OBSTACLE THRESHOLD return 1 else return 0 Nauman Shah Maze solving by a Humanoid Robot 71 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report j
12. Final Year Project Report a couple of prototype models finally launched its well known humanoid robot ASIMO in 2000 ASIMO was followed by Sony s small humanoid robot named QRIO and Fujitsu s commercial robot HOAP in 2001 Mainly these robots were used for exhibition and advertisement purposes but some were also sold for research purposes to universities Other companies like Kondo Kagaku introduced its programmable biped humanoid in June 2004 followed by Samsung s humanoid models name MAHRU male and AHRA female in November 2005 Mitsubishi Heaw Industries also developed a domestic robot named Wakamaru primarily intended to provided companionship to elder and disabled people Another research platform HRP 1 developed by AIST National Institute of Advanced Industrial Science and Technology In addition to biped walking most of these robots also exhibited some human characteristics for example the HRP 4C an advanced model of the HRP 1 launched in 2009 is capable of voice recognition and speech synthesis In academia many institutes like University of Tokyo Waseda University University of Munich Beijing University and many others developed their very own humanoid robots for robotics research I Although some of these projects were sold to various universities for research and educational purposes due to the high price they were well out of reach of hobbyists and even some universities Taking advantage of the opp
13. Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Appendix B AX 12 Servo Control Table item Table Model NumberiL RD 12 0x0C 10X01 Mosel Number Ox Version of Firmware O RD T 3 0XO3 OO a t OxOt OXC4 Saud Rate ROR TH Ox 0X06 CW AngletimitiL RDWR Oooo 7 0X07 CW Angle Limit RD WR c oxo0 10 0x0A Reserved fx EEPROM Area the Highest Limit Voitage 15 0X0F MaxTorque HB RDWR 3003 4 0x04 Alarm Shutcown Reserved RDWR o 0x00 20 0K12 DownCslpratnoniz RD 21 0X15 Down Calibration RD Up Calibration L RD Jp Calibration H DNE T rl 24 0X18 Torque Enable RDWR c oxo0 250x19 LEDs s858 RDWR Ox CW Com pilance Siope CCW Compliance Slope Goal Posltlon H Moving SpeeaiL RD WR 0 Jj Moving Speed H RDWR 0 Addr14 value RAM 36 0K24 Present Position L RD Area 37 0X25 Present Positon H RO o J V 36 0X26 PresentSpeest RD J 39 0X27 PresentSpeegin a RO p oj 40 0X28 Present Load L RD F 41 0X29 Presenttoad H RO Present Voltage RD ee AA 43 0X2B Present Temperature RD 44 0X2C s5 0x20
14. The 4 pages of Left Turn ME CurrentPage NextPage er NextPage pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage uint32 t PAGE NEXT PAGE sel 0 doPage ME CurrentPage delay ms 500 doPage 1 _ delay ms 500 if CheckLeftFlag 1 amp amp CheckCenterFlag 0 amp amp CheckRightFlag 0 f NextPage 87 for j 0 j lt 4 j The 4 pages of Right Turn f ME CurrentPage NextPage cliQ0 NextPage pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage uint32 t PAGE NEXT PAGE sei Nauman Shah Maze solving by a Humanoid Robot 76 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report doPage ME CurrentPage doPage 1 _delay_ms 500 NextPage 60 for int i 0 i lt 7 it f ME CurrentPage NextPage cli NextPage pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage uint32 t PAGE NEXT PAGE sei doPage ME CurrentPage delay ms 2 CheckLeftFlag CheckLeftSensor CheckCenterFlag CheckCenterSensor CheckRightFlag CheckRightSensor ExitPage pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage uint32 t PAGE EXIT PAGE delay ms doPage ExitPage delay ms 500 doPage 1 delay ms 1
15. aue d REDI Rd adde i ABSTRACT paanan Aa ma a i ACKNOWLEDGEMENTS AAA i TABLE OF CONTENTS ui Aaaa aa li H 3KS M clic waa iv GLOSSARY ec 1 1 crie leon m rissani gunna Gt aa E dine 2 1 1 igo 8 eti o AA EEE EEEE E E ER 2 1 2 Aims and OD SCtIVES 2 1 2 1 Project Aaa 2 1 2 2 Ui eeeugeed 3 1 9 Methodology saaan tee er eese E EEE EE EAE EEEE E 3 1 4 Feasibility srt 4 1 5 Project Cost Analy Sis naaa 4 16 Product Marketability ene tte ede GG NA Sene eed due Edda Fe Re Sed dae rude 5 1 7 SUMIMANY ERR II 5 2 Subject OVE VOW wis napagana napasin Kannada AE E den NAPADALA AGAD dan NAPAANAK E 6 MEE Aa 6 2 1 1 Humanoid foo c aaa Ka kaaga 6 2 1 2 History of Humanoid Robots and State of Art 6 2 2 The Bioloid Comprehensive Kit eessssssssssssseeen em emen mener 8 2 2 1 TANG WAL 6x E 8 2 2 2 Tr E 12 2 2 3 COMMUNICAUGNS aa 17 2 3 Chapter SUMMARY Aa 19 3 Description and Discussion of Work Done sssessenm ene 20 3 1 The Bioloid Humanoid MOON ener 20 3 2 WInAVR aa 21 3 3 Design and Implementation wi aa enne 21 3 3 1 Example code functions aaa 22 3 3 2 Servo FUNCTIONS AA ASAE RESA 24 3 3 3 Motion Editor Functions Aa 25 9 9 4 Serisor FUNCTIONS essct pana tenen perte patur eR hia Rex te perunt RA 31 3 3 5 Maze SOM
16. command line Once the both the values are entered click Save from the File menu Open the Programmer s Notepad and select the Make All WinAVR option from the Tools menu to compile the developed code 4 Programmer s Notepad File Edit View Tools Wo He Projects 2 New Project Group 2 3 ExampleProject ic Examplec c Window Help Use Tabs WinAVR Make All WinAVR Make Clean WinAVR Program Options Nauman Shah Maze solving by a Humanoid Robot Line Endings gt IC 4C BmpleC c 80 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Once the code is compiled the output should display Errors none If there are errors the code needs to be compiled again after removal of the errors noimt o 8390378 eeprom 0 8454144 debug aranges 20 0 debug pubnames 339 o debug info 1137 o debug abbrev 298 o debug line 1466 0 debug str 587 o Total 7917 Errors none Process Exit Code O lt 1 1 550 ANSI CI Once the code is compiled a hex file will be generated in the same folder as the project This hex file can be downloaded on to the CM 5 module using the Robot Terminal To download open the Robot Terminal and connect it Once connected hold down the key shift 3 and turn the CM 5 module on and press enter Type in the command load and press enter again
17. found that if both these values are set to their default value 32 the speed of the servos would be 90 sec So to make things simpler a normalised speed NSpeed was calculated which took in account the product of both these speeds divided by their defaults values Thus if the Page Speed and the Pose Speed of a motion page are both equal to their default values the value of NSpeed would be 1 Page Speed Pose Speed eee ye AA Normalised Speed 32 a The maximum allowed speed was calculated using this normalised speed The speed of the AX 12 servo ranges from 0 1023 units According to the AX 12 Servo s Manual the maximum value of 1023 makes it move at 114 revolutions per minute To calculate the servo speed the conversion rate from speed in deg sec to servo speed units was calculated 114 1023 servo units 114 rpm So 1 9rps LO x 360 684 sec Since if the NSpeed 1 the servo moves at 90 sec the conversion factor from NSpeed to Servo Speed units is 30 1023 135 684 Nauman Shah Maze solving by a Humanoid Robot 28 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Thus the motor moving at maximum speed was made to move at MaxServoSpeed NSpeed x 135 While the other servo s speeds was programmed to move at a fraction of the MaxServoSpeed depending on how far it has to move comparing to the servo that has to
18. h define F CPU 16000000 include util delay h include ME h int getCurrentServoPos uint8 t ServoNo void SendServoTargetPos uint8 t ServoNo int16 t ThetaTarget uintl16 t OmegaServo POSE ReadPose int Page char Pose int MaxDistance POSE ReadPose uint16 t doPose int page char pose uintl6 t doPage int page void MEInit void void TxD16Hex uint16 t X 2 Gets The Current Position of a Servo int getCurrentServoPos uint8 t ServoNo uintl6 t POS LB 0 POS HB 0 gbpParameter 0 P PRESENT POSITION L Nauman Shah Maze solving by a Humanoid Robot 60 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report gbpParameter 1 2 Read Length 2 byte L and H TxPacket ServoNo INST READ 2 uint8 t bRxPacketLength RxPacket DEFAULT RETURN PACKET SIZE 4gbpParameter 1 if bRxPacketLength DEFAULT RETURN PACKET SIZEtgbpParameter 1 if gbpRxBuf fer 4 0 POS_LB gbpRxBuffer 5 POS HB gbpRxBuffer 6 else error return SERVO NOT CONNECTED else error return SERVO NOT CONNECTED return POS HB 8 POS LB i Sends the Servo to the Target Position void SendServoTargetPos uint8 t ServoNo int16 t Target uint16 t Speed uint8 t servo value LB Target amp Ox00FF uint8 t servo value HB Target amp OxFF00 gt
19. move the maximum distance Distance a servo has to move Servo Reference Speed Maximum Servo Speed x _ Maximum Distance A simple loop was implemented to send the servos to their respective target positions at the appropriate speed calculated for each of them Calculate the speed of each servo in reference to the Servo Moving at the Max speed one that has to move the max distance ServoRefSpeed uint16 t float MaxServoSpeed float Dif ference float Max if ServoRefSpeed gt MaxServoSpeed ServoRef Speed MaxServoSpeed SendServoTargetPos ServoNo Read Pose ServoTarget ServoNo ServoRefS peed Read Pose ServoPos ServoNo Read Pose ServoTarget ServoNo delay ms ME MoveFinishTime 10 Once the command to send the servos was issued the program had to wait for the servos to reach there target positions Otherwise if a new pose is played right after one pose the robot would start playing the new one when its half way through the first one This problem was faced during the function was being implemented A strategy to keep checking if all the servos have reached there target positions and waiting until then was first implemented But the reading the positions of each servo repeatedly added a delay making the motion unsteady Thus to overcome the issue a delay was added to the function waiting till all the servos have reached their res pective target positions Th
20. the same time hence playing a pose This was done by figuring out which servo of all had to move the maximum distance That specific servo would then move at the maximum allowed speed while all the other servos would move proportionally slower at a calculated speed depending on the distance they have to move in respect to the maximum distance Nauman Shah Maze solving by a Humanoid Robot 27 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The maximum distance was figured out by creating a simple function MaxDistance Read Pose that searches through all the servos and calculated the difference of each servos target position defined in the motion pose passed to it and the current position of the servo The function then returned the maximum moved by a servo Once the maximum distance was known a function doPose page pose was written which calculates the appropriate speed for each individual servo and makes them move to their respected target positions at that speed The function takes as arguements the page number and the pose number to play It uses the ReadPose Page Pose function to read the specified pose information It then calls the MaxDistance Read Pose function to calculate the maximum distance and moves on to calculate the speeds for the servos The motion playback is influenced by two values Pose Speed and Page Speed It was
21. used The report explains the procedure undergone in order to achieve the aim and details the outcomes achieved The report concludes with a brief overview of the project and future development recommendations Maze Solving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report ACKNOWLEDGEMENTS Above all would like to thank the Almighty for His endless blessings for giving me the knowledge strength and the opportunity to be where am It is only through His grace that this achievement could truly be accomplished Secondly would like to thank my supervisor Dr David Lee for the patient guidance encouragement and continuous support he has provided have been extremely lucky to have a supervisor who cared so much about my work and inspired me with a positive outlook at every stage would like to express my deep gratitude to him for his invaluable support and time would like to thank my friends Ramiz Ahmed and Talha Khalid for their help and support throughout the period of the project Last but not the least would like to thank my family for their generous and never endi ng support and for teaching me the basic principles of life University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report TABLE OF CONTENTS DECLARATION S TA TEMENT itera reote a E E
22. 000 Nauman Shah Maze solving by a Humanoid Robot 77 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Appendix F Instruction guide to download a C program on the CM 5 The microcontroller on the CM 5 module of the robot is based on the Atmel Atmega128 microprocessor of the AVR series Although many different compilers are available to program the microprocessor the compiler used for this project was a freeware GNU GCC compiler The GCC compiler has a command line interface thus a separate editor is needed to develop the code WinAVR by AVRFreaks is a freeware editor available for download on the internet coupled with the Programmer s Notebook provides an easy to use platform for developing and compiling a C program The WinAVR package can be downloaded from the http winavr sourceforge net website Once the package is downloaded and installed the following instructions can be followed to develop and download a C program to the Bioloid controller From the WinAVR menu select the Programmer s Notebook WinAVR to open the editor as shown below This editor allows the user to create and manage Projects which contain all the source file associated with the program being developed To create a new project select the New in the File menu of the editor Select Project to create a new project or other desired file type 4 Progra
23. 07 http mail fibo kmutt ac th robocup2008 store FUmanoid Germany TDP 01 pdf pdf Date accessed 12 04 09 Nauman Shah Maze solving by a Humanoid Robot 41 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 11 Simpson Michael 2007 Understanding the AX 12 http www antratek nl pdf Understanding A X12 pdf Date accessed 13 04 09 12 _ ROBOTIS 2006 Dynamixel AX S 1 User s Manual 13 Robot Italy 2004 AX S1 Sensor Specifications http www robot italy com product_info pbhp products id 733 Date accessed 14 04 09 14 ROBOTIS 2006 Bioloid User s Manual 15 Roboporium 2004 Bioloid Comprehensive Kit http www roboporium com bioloid comprehensive htm Date accessed 14 04 09 16 Trossen Robotics Date unknown Bioloid CM 5 Control Module http www trossenrobotics com bioloid cm 5 control module as px Date accessed 14 04 09 17 Robot Savw 2009 Bioloid Comprehensive Kit Knowledgebase http robosavvy com site index php 0ption com_content amp task View amp id 8 2 amp lt emid 8 1 Date accessed 15 04 09 18 Crust Crawler Robotics 2007 Bioloid Robotics Kit http www crustcrawler com products bioloid index php prod 59 Date accessed 15 04 09 19 Trossen Robotics Date unknown Bioloid Robot System http www
24. 32 t PAGE SIZE uint32 t Page uint32 t POSE SIZE uint32 t Pose Read Pose PoseSpeed pgm read byte far uint32 t POSE BASE ADR uint32 t POSE OFFSET uint32 t PAGE SIZE uint32 t Page uint32 t POSE SIZE uint32 t Pose uint32 t POSE SPEED ADR ME PageSpeed pgm read byte far uint32 t POSE BASE ADR t uint32 t PAGE SIZE uint32 t Page uint32 t PAGE POSE SPEED sei for ServoNo 1 ServoNo NUM OF SERVOS ATTACHED ServoNo f if Read Pose ServoPos ServoNo SERVO NOT CONNECTED f cli uint8 t servo value LB pgm read byte far Read Pose PoseAdr uint32 t ServoNo 2 i4 uintl6 t servo value HB pgm read byte far Read Pose PoseAdr uint32 t ServoNo 2 1 sei uintl6 t PageFast pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t Page uint32 t PAGE FAST FLAG Nauman Shah Maze solving by a Humanoid Robot 62 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report if PageFast 10 amp amp ME PageSpeed 10 ME PageSpeed 160 if Page 60 Page 69 Page 87 Page 96 Page 67 Read Pose PoseSpeed 10 if Page 1 Read Pose PoseSpeed 10 Read Pose ServoTarget ServoNo servo value HB 8 servo value LB if Read Pose ServoTarget ServoNo 1020 Read Pose ServoTarget ServoNo 1020 return Read_Pose Ret
25. BACHELOR OF ENGINEERING DEGREE WITH HONOURS IN Digital Systems amp Computer Engineering Final Year Project Report School of Electronic Communication and Electrical Engineering University of Hertfordshire Maze Solving by a Humanoid Robot Report by Nauman Shah Report For Project Supervisor Dr David Lee Date 20 April 2009 DECLARATION STATEMENT certify that the work submitted is my own and that any material derived or quoted from the published or unpublished work of other persons has been duly acknowledged ref UPR AS C 6 1 Appendix Section 2 Section on cheating and plagiarism Student Full Name Nauman Shah Student Registration Number 07155081 Sighed anag eite tee ceo I tie iue ue d ege Date 20 April 2009 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report ABSTRACT This report describes the work undertaken in developing software to successfully make a humanoid robot to walk through a simple maze avoiding any obstacles on its way The robot used was built using the Bioloid robot construction kit by Robotis The software written allows the robot to play different motion sequences which are in turn used to implement a simple wall following algorithm The report starts with an introduction to the project aims and objectives followed by a detailed description of the subject background explaining the hardware and software
26. Bit5 0 52 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Bioloid c Functions acquired from the Example c provided with the Bioloid Kit H S s included files xy define ENABLE BIT DEFINITIONS include avr io h include avr pgmspace h include avr interrupt h include avr signal h include inttypes h include lt string h gt include stdio h include Bioloid h void TxD81 byte bTxdData void TxD80 byte bTxdData void TxDString byte bData void TxD8Hex byte bSentData void TxD32Dec long lLong byte RxD81 void void PortInitialize void void SerialInitialize byte bPort byte bBaudrate byte bInterrupt byte TxPacket byte bID byte bInstruction byte bParameterLength byte RxPacket byte bRxLength void PrintBuffer byte bpPrintBuffer byte bLength void PortInitialize void DDRA DDRB DDRC DDRD DDRE DDRF 0 Set all port to input PORTB PORTC PORTD PORTE PORTF PORTG 0x00 PortData initialize to 0 Cbi SFIOR 2 All Port Pull Up ready DDRE BIT RS485 DIRECTIONO BIT RS485 DIRECTION1 set output the bit RS485direction TxPacket send data to RS485 TxPacket needs 3 parameter ID of Dynamixel
27. ER INDEX 40 define S BUZZER TIME 41 define S PRESENT VOLTAGE 42 Nauman Shah Maze solving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering define define define define define define define define define define define define define define define define Nauman Shah Maze solving by a Humanoid Robot define S PRESENT TEMPERATURE S REGISTERED INSTRUCTION S IR S LOC S IR S IR S IR REMCON ARRIVED CON TX DATAO CON RX DATAI CON TX DATAO Bae B S IR REMCON TX DATAI S OBSTACLE DETECTED COMPARE ag LIGHT DETECTED COMPARE LEFT FRONT FRONT LEFT RIGHT LEFT RIGHT FRONT RIGHT FRONT LEFT RIGHT endif SENSOR H Yn oO hb WY H BEng Final Year Project Report 68 School of Electronic Communication and Electrical Engineering 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 University of Hertfordshire Contains the implementation of functions written to operate x included files sy include include include include include include include lt avr io h gt lt avr pgmspace h gt lt avr interrupt h gt lt avr signal h gt lt inttypes h gt lt string h gt lt stdio h gt include lt avr iom128 h gt define F CPU 16000000 include include define LEFT OBSTACLE THRE
28. ES Seu enable interrupts ME TotalTime 0 ME CurrentPose 0 delay ms doPose ME CurrentPage ME CurrentPose ME CurrentPosett while ME CurrentPose lt ME NoOfPoses return ME TotalTime ieu 99 97 Nauman Shah Maze solving by a Humanoid Robot 30 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Playing a Motion Most of the simple motions were implemented by simply playing a single page But complex motions like walking and turning required playing more than one pages in a sequence These motion pages were linked together by the Next Page value in the page settings void doMove int page f iate Nuna paye do f ME CurrentPage NextPage cli disable interrupts NextPage pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage uint32 t PAGE NEXT PAGE sei enable interrupts delay ms doPage ME CurrentPage while NextPage 0 A function doMove page was created which plays the page passed to it and then moves on to play the page pointed by the Next Page of that page The function keeps on playing the pages until the Next Page value is equal to zero The function also implements a delay equal to the Page Pause value of the page Eventually playing a motion designed using the Motion Editor software The complete c
29. Kit and explain its hardware and software operations Nauman Shah Maze solving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 2 Subject Overview This chapter details the background knowledge of the project It starts with giving a brief introduction to the field of Robotics It talks about the importance of humanoid robots and their development history in the industry It then goes on to explain in the detail the architecture and operation of the hardware and the design of the software used in the project It also talks about the communication protocols of the system explaining how data is transferred amongst the hardware and between the hardware and software 2 1 Robois Robot according to Hans Moravec a robotics expert is a mere machine to transcendent human mind For ages the human mind itself has been under the microscope of scientists who have done immeasurable struggles to build a machine capable of achieving human intelligence and physical capabilities To some extents they have been successful to others they soon will be Some even say that robots will soon surpass humans Today a number of different types of robots have been developed and are being used in industries as well as in homes to replace human efforts often without a lot of human intervention Suitable for repetitive precision demanding or even tasks dangero
30. M OF POSES define PAGE POSE SPEED define PAGE ACCEL TIME define PAGE NEXT PAGE define PAGE EXIT PAGE Within a pose define POSE PAUSE ADR define POSE SPEED ADR define SERVO NOT CONNECTED Structure Definitions typedef struct f uint16 t CurrentPage uint16 t TotalTime uint16 t PageSpeed uint16 t MoveFinishTime uint16 t NoOfPoses 0xOEO00 0x00040 0x00040 7 0x200 0x00010 0x0000F 0x00014 0x00016 0x00018 0x00019 0x0001A 0x0003E 0x0003F 9999 Time to wait while move finishes Nauman Shah Maze solving by a Humanoid Robot 59 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report uintl6 t CurrentPose MOTION EDITOR DATA typedef struct uint8 t PoseSpeed ServoNo uint32 t PosePause uint32 t PoseAdr uint16 t ServoPos NUM OF SERVOS ATTACHED uint16 t ServoTarget NUM OF SERVOS ATTACHED POSE endif ME H volatile MOTION EDITOR DATA ME ree A ME c Contains functions to operate the AX 12 for functions to operate the AX 12 servo read the Motion Editor data and play the motion sequences IRSE mI Tn TRIER x define ENABLE BIT DEFINITIONS include avr io h include avr pgmspace h include avr interrupt h include avr signal h include inttypes h include string h include stdio h include avr iom128
31. Motion poses of the Motion page passed in a sequence uintl6 t doPage int page if page 1 f New request ME CurrentPage page cli ME NoOfPoses pgm read byte far uint32_t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage uint32 t PAGE NUM OF POSES sei ME TotalTime 0 ME CurrentPose 0 delay ms doPose ME CurrentPage ME CurrentPose ME CurrentPosett while ME CurrentPose ME NoOfPoses return ME TotalTime return 9999 Nauman Shah Maze solving by a Humanoid Robot 65 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Implements the Motion Pages in a sequence forming a motion void doMove int page uint8 t NextPage page do f ME CurrentPage NextPage cli NextPage pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage uint32 t PAGE NEXT PAGE sei delay ms doPage ME CurrentPage while NextPage 0 jesus EM Prints the passed hex values J void TxD16Hex uintl6 t X uint8 t Lower uint8 t Higher Lower X amp OxOOFF Higher X amp OxFF00 558 TxD8Hex Higher TxD8Hex Lower Nauman Shah Maze solving by a Humanoid Robot 66 University of Hertfordshire School of Electronic Communication and Electr
32. N eee 33 3 4 Testing and Debugging essen eene deei niee 35 coo Feo d SD 36 3 6 Chapter Summary IA 37 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 4 Conclusion and Other ASPpeCtS w wwaamamwnnaananaanunana nuna wanu nne nhe en nnne nnn 37 Ais erii c etlenscadanaee ceretdeaesdaghaakinntasaeenneieads 37 4 2 Review of Objectives eeesssssssssseessseseeenen nennen wa NAG ehh hss nennen estet h nnns nnn nns 38 4 3 Time Management 0 cece ee cece cece cece teen eeea ee ieee areni ieee 39 4 4 Further Development cece eeeeeeeeceeeeeeceeeeeeeeeeaeeeeceaaeeeeceaaeeeaeaaeeeeaeaaeeeeaaaa tees 39 4 5 Chapter Summary Aaa AANE 39 aisidsiisezsccm T 41 BIBLIOGRAPHY Pc 44 APPENDIGES e 45 Appendix A Project Time PIAN ww wamwaamananaaww manana na nanu meme nennen rhen nnn ens 46 Appendix B AX 12 Servo Control Table wwwmmaamamanawanna nuna nanwnana mee 47 Appendix C AX 51 Sensor Control Table eese 48 Appendix D Instruction Set for Dynamixel sesesse m 49 Appendix E Software Listings ccccecceeeeceeeeeee E EN 50 Appendix F Instruction guide to download a C program on the CM 5 78 University of Hertfordshire
33. Now choose the Transfer File from the Files menu and open the hex file Type in go in the robot terminal and the file will be downloaded Press the start button on the CM 5 module and the program will run on the CM 5 Nauman Shah Maze solving by a Humanoid Robot 81
34. OUNT2 3000L define RX TIMEOUT COUNT1 RX TIMEOUT COUNT2 10L unsigned long ulCounter byte bCount bLength bChecksum byte bTimeout bTimeout 0 for bCount 0 bCount lt bRxPacketLength bCount ulCounter 0 while gbRxBufferReadPointer gbRxBufferWritePointer if ulCounter gt RX TIMEOUT COUNT1 Nauman Shah Maze solving by a Humanoid Robot 54 University of Hertfordshire School of Electronic Communication and Electrical Engineering bTimeout 1 break if bTimeout break BEng Final Year Project Report gbpRxBuffer bCount gbpRxInterruptBuf fer gbRxBufferReadPointer bLength bCount bChecksum 0 if gbpTxBuf fer 2 if bTimeout amp amp bRxPacketLength 255 TxDString r n CLEAR_BUFFER BROADCASTING ID Error RxD Timeout if bLength 3 if gbpRxBuffer 0 TxDString r n checking is available Oxff gbpRxBuffer 1 Error Wrong Header CLEAR_BUFFER return 0 if gbpRxBuffer 2 f gbpTxBuffer 2 TxDString r n Error TxID RxID CLEAR BUFFER return 0 if gbpRxBuffer 3 bLength 4 TxDString r n Error Wrong Length CLEAR_BUFFER return 0 for bCount 2 bCount lt bLength bCount if bChecksum Oxf f TxDString r n Error Wrong CheckSum CLEAR_BUFFER return 0 return bLength Nauman Shah Maze solving by a Humano
35. S ATTACHED uint16 t ServoTarget NUM OF SERVOS ATTACHED The data was then read and stored in the relevant variables using the function described below Reading the Motion Pose Data This function ReadPose Page Pose was written to read the motion data from the flash memory of the CM 5 and save it in the appropriate variables of the structures discussed above The base address of the Motion Editor data in the flash memory is OxE000 Each motion page of size 512 bytes contained 7 poses each of 64 bytes each The first 64 bytes of the page contained page settings Each pose contains Pose Pause and Pose Speed followed by the Target positions of each servo of the robot Table 4 Offsets of page settings within a Page L 0x00010 Page Fast Flag 0x0000F Page Play Count 0x00014 Number of Poses in Page 0x00016 Page Speed 0x00018 Page Acceleration 0x00019 Next Page Number 0x0001A Exit Page Number Table 5 Offsets of pose settings within a Pose 0x0003F Pose Speed Nauman Shah Maze solving by a Humanoid Robot 26 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The function first declares a variable Read Pose of type POSE The pose read is stored in this variable The function first reads the current positions of the servos connected in a loop and saves them in the Read Pose ServoPos array The funct
36. SHOLD define RIGHT OBSTACLE THRESHOLD define CENTER OBSTACLE THRESHOLD util delay h Sensor h void SensorInit uint8 t Compare Value send servo value gbpParameter 0 S OBSTACLE DETECTED COMPARE gbpParameter 1 Compare Value TxPacket SensorID INST WRITE 2 Checks left sensor uint8 t CheckLeftSensor uint8 t LeftObstacle gbpParameter 0 S LEFT IR SENSOR DATA gbpParameter 1 TxPacket SensorID INST READ 2 uint8 t bRxPacketLength Nauman Shah Maze solving by a Humanoid Robot BEng Final Year Project Report the AX S1 sensor Returns 1 if an obstacle is detected 1 Read Compare Bit RxPacket DEFAULT RETURN PACKET SIZEt gbpParameter 1 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report if bRxPacketLength DEFAULT RETURN PACKET SIZE gbpParameter 1 if gbpRxBuf fer 4 0 LeftObstacle gbpRxBuffer 5 else error return SERVO NOT CONNECTED else error return SERVO NOT CONNECTED if LeftObstacle gt LEFT OBSTACLE THRESHOLD return 1 else return 0 Ma Checks center sensor Returns 1 if an obstacle is detected YA uint8 t CheckCenterSensor uint8 t CenterObstacle gbpParameter 0 S CENTER IR SENSOR DATA gbpParameter 1 1 Read Compare Bit TxPacket SensorID INST READ
37. SR1B 7 RxD interrupt enable UCSRIC 0x06 UDR1 OxFF Sbi UCSR1A 6 SET TXD1 FINISH Note set 1 then 0 is read Nauman Shah Maze solving by a Humanoid Robot 56 University of Hertfordshire School of Electronic Communication and Electrical Engineering TxD8Hex print data seperatly ex Oxla gt 1 a void TxD8Hex byte bSent Data byte bTmp bTmp byte bSentData gt gt 4 amp 0x0f byte 0 if bTmp gt 9 bTmp 7 TxD8 bTmp bTmp byte bSentData amp OxOf byte 0 if bTmp gt 9 bTmp 7 TxD8 bTmp TxD80 send data to USART 0 KU void TxD80 byte bTxdData f while TXDO READY TXDO DATA bTxdData TXD81 send data to USART 1 vy void TxD81 byte bTxdData f while TXD1 READY TXD1 DATA bTxdData TXD32Dec change data to decimal number system i void TxD32Dec long lLong byte bCount bPrinted long lTmp lDigit bPrinted 0 if lLong lt 0 lLong lLong TxD8 tyz lDigit 1000000000L Nauman Shah Maze solving by a Humanoid Robot BEng Final Year Project Report 57 University of Hertfordshire School of Electronic Communication and Electrical Engineering for bCount 0 bCount lt 9 bCount lTmp byte lLong lDigit if 1Tmp TxD8 byte 1Tmp 0 bPrinted 1 else if bPrinted TxD8 byte lTmp 0 lLong long 1Tmp lDigit lDigit lDigi
38. STACLE THRESHOLD 7 CENTER OBSTACLE THRESHOLD 35 Figure 20 Bioloid Humanoid Sensor Directions The complete code for the Sensor functions explained above is attached in Appendix E and is contained in the Sensor c source file 3 3 5 Maze Solving Once the functions to play a motion as well as the functions able to sense distance were implemented the next task was to implement a simple maze solving technique which would enable the robot to find its way out of a simple maze Although there are number of automated maze solving methods the technique chosen for the project was the wall following technique Figure 21 Right hand wall following algorithm example Wall following is a simple yet effective technique to solve a simple maze The strategy is to keep contact with on of the wall of the maze either left or right and follow it and until the exit is found The technique works only if all of the walls of the maze are connected together Since the project was based on solving a simple loop this Nauman Shah Maze solving by a Humanoid Robot 33 Figure 22 Right hand wall following example P University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report technique was chosen to be the best option The figure on the right shows an example of a traversal of a simple maze using the right hand wall following technique 21 Sin
39. a Czech writer coined the term robot in his play Rossum s Universal Robots as a derivative of the word robota meaning serf labour Robots today built for tedious and dangerous for human tasks are still far from achieving the fictional human like intelligence and physical capabilities depicted in the play Various companies all over the world have devoted fortunes for research in the field and are working hard to make robots one step closer to their fictional counterparts and with the show of effective results are gaining the increasing interest of many Even though building a humanlike robot requires a combination of complex hardware and software potentials but with the technological facilities provided by companies like Robotis the subject can be pursued by educational institutes at a lower simpler and cheaper scale The project detailed by this report is based on such a task of building a human oid robot able to walk avoid obstacles on its way and solve a maze 1 2 Aims and Objectives 1 2 1 Project Aim The main aim of the project was to design and implementa program in C programming language which allowed the Bioloid robot to walk its way out of a simple maze The software was to be developed using C programming language correlating it with the existing software packages available with the Bioloid Development Kit in order to achieve an optimum package utilising both the user friendly GUI of the provided software the Mot
40. ach of these sensors allows two types of measurements distance and luminosity sensing The former is measured by emitting a high frequency Infrared by an integrated emitter and measuring the amount of the rays return after bouncing off an object The luminosity is measured using the similar technological concept but without the emitting source Thus this sensor only measures the amount of infrared emitted from a source of illumination sensing the brightness of the light These values can range from 0 1023 and the input is compared to a preset compare value setting or resetting the relevant flags Obstacle Detection Flag or Luminosity Detection Flag accordingly Refer to the table below for bit representation of each sensor flag Bit Representation Bit 2 An object is detected on the Right Sensor Light Detected Bit 1 An object is detected on the Center Sensor Light Detected Bit 0 An object is detected on the Left Sensor Light Detected Table 1 AX S1 Sensor Obstacle Detection Flag Description The AX S1 also has some other features that will not be discussed in detail since they are not relevant to the project The features include a built in remote control sensor which makes it possible to send and receive Infrared data between sensor modules There is also an internal microphone which allows it to detect the current sound levels and maximum loudness making it possible to count the number of sound instances that has oc
41. age which are all handled by the actuator s own built in microcontroller An alarming system and a status LED alerts the user when parameters deviate from user defined ranges Nauman Shah Maze solving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The servo also has the ability to track and report back its speed shaft position and load placed on it which allows functionality to constantly monitor the device These parameters can be accessed through a single bus high speed serial communication protocol The bus is used for both data and power supply and hence can be used to daisy chain several servos together allowing the construction of an extendable network of motors which can be individually accessed and controlled by the main controller module 150 Goal Position 0x1ff Each servo can move to a 300 degree range in 1024 increments as shown in the figure 3 or can be set in continuous mode for full rotation The speed and maximum torque can also be controlled by their respective parameters ranging from 0 1023 f 300 360 P n T z ff tion Appendix B inclu des the control table containing thoai Poston ee MAMANG the information on the status and the operation of the Figure 3 AX 12 Servo Movement Range Dynamixel servo The servo is operated by writing values in the appropriate address of the required p
42. ailed the background knowledge of the project It started with giving a brief introduction to the field of Robotics It emphasized the importance of humanoid robots and their development history in the industry The chapter looks into the details of the architecture of the Dynamixel AX 12 servo the AX 1 Sensor and the CM 5 module of the Bioloid Kit It described the software development kit provided with the Bioloid Kit The Behaviour Control the Motion Editor and the Robot terminal It then talked about the communication protocols of the CM 5 module and the Dynamixels The next chapter will detail the development and implementation of C programming to control the robot Nauman Shah Maze solving by a Humanoid Robot 19 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 3 Description and Discussion of Work Done This chapter gives a detailed explanation of the software developed in order to meet the objectives of the project The chapter begins with a brief introduction to the Bioloid Humanoid model and looks in to its assembly It then gives a brief introduction to the compiler used to implement the software developed Further on it explains the software developed in C language to achieve the project aim It gives a detailed explanation of the design and working of each function developed and states why they were important It then looks in to the step
43. al Year Project Report define P TORQUE ENABLE 24 define P LED 25 define P CW COMPLIANCE MARGIN 26 define P CCW COMPLIANCE MARGIN 27 define P CW COMPLIANCE SLOPE 28 define P CCW COMPLIANCE SLOPE 29 define P GOAL POSITION L 30 define P GOAL POSITION H 31 define P GOAL SPEED L 32 define P GOAL SPEED H 33 define P TORQUE LIMIT L 34 define P TORQUE LIMIT H 35 define P PRESENT POSITION L 36 define P PRESENT POSITION H 37 define P PRESENT SPEED L 38 define P PRESENT SPEED H 39 define P PRESENT LOAD L 40 define P PRESENT LOAD H 41 define P PRESENT VOLTAGE 42 define P PRESENT TEMPERATURE 43 define P REGISTERED INSTRUCTION 44 define P PAUSE TIME 45 define P MOVING 46 define P LOCK 47 define P PUNCH L 48 define P PUNCH H 49 Instruction define INST PING 0x01 define INST READ 0x02 define INST WRITE 0x03 define INST REG WRITE 0x04 define INST ACTION 0x05 define INST RESET 0x06 define INST DIGITAL RESET 0x07 define INST SYSTEM READ 0x 0C define INST SYSTEM WRITE Ox 0D define INST SYNC WRITE 0x83 define INST SYNC REG WRITE 0x84 define CLEAR BUFFER gbRxBufferReadPointer gbRxBufferWritePointer define DEFAULT RETURN PACKET SIZE 6 define BROADCASTING ID Oxfe define TxD8 TxD81 define RxD8 RxD81 Hardware Dependent Item define define DEFAULT BAUD RATE 34 57600bps at 16MHz F CPU 16000000 Nauman Shah Maze solving by a Humanoid Robot 51 University of Hertfo
44. alking and turning stable The demo pages provided with the kit were very unstable and th e robot kept falling backwards when played This was overcome by configuring the offset settings of the pages through the Motion Editor software Each pose of the walking and turning pages were individually tuned to make the motion more stable Although the task was tedious the results were worth the effort The walking pages were satisfying the turning pages however still need some adjustments and can be made much more stable Also when the walking motion was initiated from a standing position of the robot the robot s inertia would make the robot fall This was overcome by modifying the ReadPose function and decreasing the speed of the first page of each motion This made the motion start smoothly and in the final run the robot walked efficiently Another problem faced was caused by the timing issue The delay function created was not working properly since the compiler would automatically skip through the loop implemented in the function Thus a built in function from the AVRLib library was acquired But even with the new delay function the desired delay could not be produced The User Guide mentions that each unit of Pose Pause and Page Pause results in a delay of 7 8m seconds Implementing the same concept a delay of the same amount of time was given but resulted in an unstable playback of the motion pages Through experi ment it was disco vere
45. arameter and the status is read by reading the values off the appropriate address nant ii The AX S1 Sensor Module The AX S1 sensor module by Robotis is compact yet smart sensor module which allows the functionality to detect light measure distance receive and transmit infrared remote control signals and detect sound Not only that it also has built in buzzer which allows the playback of musical notes and other special note effects The casing of the AX S1 sensor module is very similar to that of the AX 12 servo module hence is also made with high quality materials which provide the necessary resilience to endure large Figure 4 AX S1 Sensor Xternal forces Module Like the servo module this module too detects subtle changes such as the internal temperature and the input voltage in response to which the module s microcontroller adapts different strategies An alarming system detects and alerts the user of any out of range values of the internal temperature and voltage Na A ag GA Figure 5 AX S1 Module sensor and receiver location Nauman Shah Maze solving by a Humanoid Robot 9 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The module is embedded with 3 Infrared sensors mounted on the front left and the right side of the module as shown in Figure 5 making it possible to sense from all three directions E
46. bot In order to program the controller using C language an appropriate C compiler had to be used Since the CM 5 module is based around the Figure 19 WinAVR Comiler Screenshot Atmel Atmega1 28 microprocessor the best option for a programming environment was discovered to be the WinAVR package available by AVRFreaks Although many different compilers can be used to write and compile programs to the ATmega128 microprocessor the WinAVR environment was chosen for its various advantages The biggest advantage of it is that it is freeware and can be downloaded and installed on as many computers as desired WinAVR consists of a suite of executable open source software development tools for the Atmel microprocessors It includes a GCC compiler coupled with a freeware editor Programmers Notepad which allows programmers to write edit and debug codes Not only that it comes with a free utility mfile which can be used to generate the project makefiles Makefiles specify how to derive a target program from a number of sources it is depended upon The WinAVR environment also includes AVRLib a collection of function libraries which can be used by simply calling them and hence will not have to be written from scratch H70 Appendix F gives a detailed guide of how to use the compile the code and download it on the robot s main controller 3 3 Design and Implementation In order to accomplish the aim a C program was develop
47. c Communication and Electrical Engineering BEng Final Year Project Report 3 6 Chapter Summary This chapter gave a detailed explanation of the software developed in order to meet the objectives of the project After giving a brief introduction to the Bioloid Humanoid model and how it was assembled it introduced the WinAVR compiler used for writing the C language code It explained why this compiler was chosen for the project It then moved on to detail the C functions implemented throughout the project describing the work done It explained the design and operation of each function The chapter then described the testing process by looking into the limitations of the system the problems faced and the actions taken to counter them It then presented the results and the outcomes of the software developed The next chapter will present a summary of the project and review the status of the objectives 4 Conclusion and Other Aspects This chapter concludes the project work and gives a summary of the report It looks in to the objectives laid down at the start of the project and the status to which each of those objectives were met It then looks into the future development possibilities of the project and gives examples of how it could be further improved 4 1 Conclusion In conclusion the project completed a great deal The project achieved the main goal to program the Bioloid humanoid robot in C language to make it solve a simple maze T
48. ce the functions to play motion pages had already been implemented they could be used to make the robot walk or turn in either direction using the motion pages created from the Motion Editor software The wall following algorithm was thus implemented based on the right hand rule by writing a function which calls the doMove function to make the robot take the appropriate route depending on the input from the sensors The flow chart below shows the operation of the function Check Sensor IF object on right Turn Right IF object infront Turn Left Walk Straight Ahead Figure 23 Flowchart representing the decision making wall following algorithm developed The complete code for the Wall Following function explained above is attached in Appendix E and is contained in the Main c source file Nauman Shah Maze solving by a Humanoid Robot 34 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 3 4 Testing and Debugging Once the all the required functions to achieve the objectives of the project were implemented they were carefully tested and debugged to achieve optimum results Initially each function was separately tested and the result was analysed Although most of the functions produced pleasing results some had to be adjusted to achieve the best results One of the major problems faced was making the motion pages for w
49. curred The built in piezo electric buzzer can play musical notes and produc e beeping sounds Appendix C contains control table containing the control information on the status and the operation of the Dynamixel sensor The sensor is operated by writing values in the appropriate address of the required parameter and the status is read by reading the values off the appropriate address 12 13 Nauman Shah Maze solving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report ii The CM 5 Controller Module The CM 5 module shown in Figure 6 is the brain and the heart of the Bioloid robotics system The module based around the powerful and flexible Atmel Atmega 128 microcontroller offers the functionality to store and execute pau programs to control the Dynamixel sensor and servos The es NG mm BE module communicates with the Dy namixels via a TTL Serial Q 5 9 Network through its four Dynamixel serial ports The figure shows the 3 wire dropped serial network The CM 5 communicates with the servos and the sensors va this network Figure 6 The CM 5 Main using their unique Network ID s programmed in their non volatile Controller Module memory The Bioloid is connected with the PC using a serial connection via a Serial Cable Jack The CM 5 features 4 programmable control buttons a power switch a Start button and a
50. d Frame Set Dynamixels together and with the CM 5 controller These frames are designed excellently to allow configuration of various different robot models There are also a number of bolts and screws provided to connect these frames together 2 2 2 Software The Bioloid Comprehensive Kit is supplied with three different software packages i The Behavior Control The Behavior Control Program is a simple yet efficient program which allows the user to design simple flowchart structures telling the robot what actions to take for a given state The icon based interface allows the functionalities accessible within the CM 5 include playing the motion sequences external control buttons and using the CM 5 s timer It has an intuitive modular GUI which enables the programmers to create logical statements which controls the behavior of the robot according to the input from the sensors T Figure 9 Behavior Control The graphical sequencer interface allows the ability to define Screenshot rules and link them with a defined action or with a series of motions created in the Motion Editor Software discussed later within a loop or a branch statements in order to implement the required algorithm Nauman Shah Maze solving by a Humanoid Robot 12 University of Hertfordshire U EF School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Figure 10 B
51. d Magic Folder Open All Files Active Project Save Project X Remove Project Properties Projects Browse to the created C file and select Open The added file will now show in the Projects Panel under the name of the project The program code can now be written in the window Other source and header files can be added similarly by clicking the project name in the Projects Panel Once the C program is written it needs to be compiled Since the WinAVR does not has an internal compiler it uses a separate Makefile to compile the source code The Makefile contains the necessary information to derive a target program from a number of sources it is depended upon The Makefile needs to be in the same folder as the project and the source files thus first a Makefile is to be copied in the project folder before the program can be compiled The Makefile can be found in the Nauman Shah Maze solving by a Humanoid Robot 79 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report CD provided with the Bioloid Kit in the Examples CM5 makefile directory Once this file is copied in the same folder run the mfile program from the WinAVR menu This program is used to edit the Makefile Thus to edit it open the Makefile by selecting Open option in the File menu and browse to the Makefile Once the file is open select the option Enable Edit
52. d that by adding an extra delay of 10m sec the best results were achieved Thus a modification was made in the doPose function and the extra delay time was added With these problems resolved and some other minor adjustments made all the functions work ed fined These functions were finally put together and tested by running the wall following program designed Nauman Shah Maze solving by a Humanoid Robot 35 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 3 5 Outcomes Once the testing of the program was complete the final version of the program was run To accomplish the aim of the project a simple of the shape UH representing the University of Hertfordshire maze was made out of cardboard and the robot with the wall following program loaded in to it was left to solve it The robot implementing the right hand rule followed the wall on its right and successfully solved the traversed the maze finding its way out to the exit The maze designed is shown in the figure below The arrowed line shows the path taken by the robot while solving the maze Figure 24 Maze map and robot s route The pictures shown below show the maze made up of simple cardboard boxes and the robot solving it Figure 25 Robot solving the maze Nauman Shah Maze solving by a Humanoid Robot 36 University of Hertfordshire School of Electroni
53. e Bioloid Users Guide provides the formula to calculate the time it takes for a pose to finish playing 32 Move Finish Time 7 8msec x Time x PageSpeed Di Max Di J SinceTime Mum Normalise Speed x 90 Speed 341 Where 3 41 is servo distance units 1 Nauman Shah Maze solving by a Humanoid Robot 29 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The function returns the value of the time to pause after the pose has been performed This time is calculated by the formula given in the User s Guide Pose Pause msecs 7 8ms x Pose Pause Value x Playing a Page Once the function to play a pose was done a function name doPage page was implemented The function takes the Page Number as an argument and simply plays the poses in the page The function first reads the total number of poses in the page and then runs a loop till that value The function calls the doPose page pose function to play each pose in the page in a sequence The function implements the pose pause by calling a delay function which waits for the Pose Pause time returned by the doPose page pose function uint16 t doPage int page f if page 1 ME CurrentPage page iub Dg disable interrupts ME NoOfPoses pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE e uint32 t ME CurrentPage uint32 t PAGE NUM OF POS
54. e CM 5 module with AX 12 servos and the AX S1 sensors using a single 3 wire serial bus as shown in the figure above Only a single line on the bus is used for both receiving and transmitting data A 74HC126 quad buffer is used to multiplex the RxD receive and TxD transmit data onto the data line This enables a Half Duplex multi dropped serial network configuration to be implemented with 3 wires The main controller needs to convert its UART signals to half duplex type The figure below shows a circuit diagram of the internal circuit of the CM 5 module which enables it to do the required operation DIRECTION_PORT DATA PIN3P VDD PIN2 GND PIN1 CM 5 internal circuit HALF DUPLEX UART Figure 16 CM 5 Internal Circuit Diagram P The status of the DIRECTION PORT determines the direction of the data signals When the DIRECTION PORT is High the signal TxD is output as Data Otherwise the signal Data is input as RxD BINA Nauman Shah Maze solving by a Humanoid Robot 17 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report ii Protocol Instruction Packet IDZN Jop eee Main Controller Status Packet ID N Figure 17 Bioloid Communication Protocol The CM 5 controller communicates with the Dynamixels through asynchronous serial communication by sending and receiving digital packets The CM 5 uses the unique Network IDs
55. e speed of the motion of the whole page The overall motion speed is hence a product of both the Page Speed and the Pose Speed Acceleration Time shows the acceleration and deceleration time for each servo when it moves The Next Page No points to the next page number to be executed when the current page is finished being played This feature can be used to join pages together to create a complex motion that single page cannot hold Exit Page No points to the page to execute if an external signal indicates the robot to stop The motion stops after executing this page to smoothly finish off the motion it is performing Page Save Button can be used to save the page into the memory Page Play Button plays the current page on the robot Page Header page name page number speed accel time Step0 Pose data Max 31joint Step1 Pose data Max 31joint The Bioloid s memory can store up to 127 motion s Step2 Pose data Max 31joint pages with each page containing up to 8 blocks 26e Step3 Pose data Max 31joint The first block contains the page information while i 383 384 Step4 Pose data Max 31joint Step5 Pose data Max 31joint 447 448 Step6 Pose data Max 31joint Figure 13 Bioloid s flash memory division Nauman Shah Maze solving by a Humanoid Robot 5 University of Hertfordshire School of Electronic Com
56. ed A modular approach was adapted to complete the program and hence it was divided into a number of smaller functions The table below lists these functions stating their input and output arguments and gives a brief description of each Each function is explained in detail later on in the chapter The Appendix E contains the relevant source codes explained Nauman Shah Maze solving by a Humanoid Robot 21 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Table 3 List of Functions mo Wo 5 Port Initialize Initialises the ports of the CM 5 s microprocessor Seriallnitialize Port Baud Rate Interrupt Initialises the Serial port connection TxPacket ID Instruction Parameter Packet Sends the instruction specified to a specified Length Length servo RxPacket Packet Length Packet The function reads the buffer for a status packet Length for the packet length specified un getCurrentServoPos ServoNo Current Reads the current position of a specified servo Position endservo largetPos ervoNo Target Position None ends aspectied servo to the target speed Speed passed at the Speed value passed ReadPose Page No Pose No Pos Reads the motion pose saved on the flash memory of the CM 5 module ax Distance Pose Max alculates the maximum distance a servo has to move amongst all the servos to play a pose Page No Pose No Sends the robot to specified pose of a
57. efines the global variables used rr ME G ff ifndef BIOLOID H define BIOLOID H define cbi REG8 BITNUM REG8 amp _ BV BITNUM define sbi REG8 BITNUM REG8 BV BITNUM typedef unsigned char byte typedef unsigned int word define ON 1 define OFF 0 define ON 0 define OFF 1 Control Table Address EEPROM AREA define define define define define define define define define define define define define define define define define define define define define define define define P MODEL NUMBER L P MODOEL NUMBER H P_VERSION P_ID P BAUD RATE P RETURN DELAY TIME P CW ANGLE LIMIT L CW ANGLE LIMIT H CCW ANGLE LIMIT L CCW ANGLE LIMIT H P P P P P P P P P P MAX TORQUE H RETURN LEVEL SYSTEM DATA2 LIMIT TEMPERATURE DOWN LIMIT VOLTAGE UP LIMIT VOLTAGE MAK TORQUE L P ALARM LED P ALARM SHUTDOWN P OPERATING MODE P DOWN CALIBRATION L P DOWN CALIBRATION H P UP CALIBRATION L P UP CALIBRATION H Cc TY Dn oO A UU N FP O 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Nauman Shah Maze solving by a Humanoid Robot 50 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Fin
58. ehavior Control program example ng The figure shows an example program running in a simple loop which turns the auxiliary LED on or off depending on the input state of the control buttons na ii Motion Editor The Motion Editor software allows the user to create unique motion sequences for your robot through CAD rendering The 3D GUI interface allows you to monitor and finely tune the servo positions by simply incrementing decrementing or even entering the desired target position Not only that the software also allows the ability to set the position of the servos manually by hand Once all the servos of the robot are in the desired position each servo s positions a motion instance can be saved as a motion Pose The motion pose can then be saved and executed whenever Figure 11 Motion Editor Software called Several of these poses can then be called in a Screenshot sequence to make up a short motion called a Page 7 poses make up a single page The motion Pages are downloaded in the flash memory of the CM 5 using the Behavior Control or the Robot Terminal software and further be called using their specific page number in a sequence of their own to make the robot perform more complex motions Nauman Shah Maze solving by a Humanoid Robot 13 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Page information Motion EditorfBioloid Star S
59. emocon TX Datat ROWR 3 92 0x34 Obstacle Detected Compare ROWR 3 53 0x35 Lignt Detected Compare kpwa amp 92 Nauman Shah Maze solving by a Humanoid Robot BEng Final Year Project Report 48 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Appendix D Instruction Set for Dynamixel Sus Number of PING No acton Used for obtaining a Status Packet ZEE READ DATA Reading values in the Control Table WRITE DATA Writing values to the Control Table REG WRITE Similar to WRITE DATA but stays in standby mode until the ACION instruction is given Triggers the action registered by the ACTION REG WRITE instruction Changes the contro table values of the RESET Dynamixel actuator to the Factory Default Value settings Used for controlling many Dynamixel actuators SYNC WRITE at the same time Nauman Shah Maze solving by a Humanoid Robot 49 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Appendix E Software Listings lj M Bioloid h Acquired from Example c provided with the Bioloid Kit Defines the control table addresses ports and other hardware dependent items Also d
60. f Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 4 3 Time Management The time management plan made at the start of the project attached in Appendix A was completely followed although the initial research done was completed before the planned time and the report writing took more time than planned Overall all deadlines were met and the original plan had not to be changed much 4 4 Further Development The project lays down the basics of programming the CM 5 module using C programming and could be further developed and enhanced in many aspects Since the motion sequences developed for the walking and the turning were not very stable further work could be done on them to make them stable enough for the robot to move without falling A gyroscopic sensor module could be installed which would measure the stability of the robot and a program could be designed to make the robot automatically adjust its stance in order to prevent itself from falling A pressure sensor could be installed on the foot of the robot for it to be able to detect the different textures of the surface it is walking on and enable it to adjust its walking patterns appropriately Also a camera module could be installed instead of the AX S1 sensor making it able to recognize different colours and detect objects This will allow wide number of possibilities to be implemented A wireless controller such as
61. gt 8 send servo value gbpParameter 0 P GOAL POSITION L gbpParameter 1 servo value LB Writing Data P GOAL POSITION L gbpParameter 2 servo value HB Writing Data P GOAL POSITION H gbpParameter 3 Speed amp Ox00FF Writing Data P GOAL SPEED L gbpParameter 4 Speed amp OxFF00 558 Writing Data P GOAL SPEED H TxPacket ServoNo INST WRITE 5 uint8 t bRxPacketLength RxPacket DEFAULT RETURN PACKET SIZE a c aa Initialises Motion Editor Data 9 9 oce void MEInit void ME CurrentPage 1 ME CurrentPose 0 Nauman Shah Maze solving by a Humanoid Robot 61 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report aaa ere ce Read Pose Information from the Flash 22525454258 POSE ReadPose int Page char Pose POSE Read Pose uint8 t ServoNo 0 for ServoNo 1 ServoNo lt NUM OF SERVOS ATTACHED ServoNo Reads the current positions of all the servos Read Pose ServoPos ServoNo getCurrentServoPos ServoNo cli Disable Interrupts Read the values of the Pose Speed Page Speed and Pose Pause Read Pose PosePause pgm read byte far uint32 t POSE BASE ADR uint32 t POSE OFFSET uint32 t PAGE SIZE uint32 t Page uint32 t POSE SIZE uint32 t Pose uint32 t POSE PAUSE ADR Read Pose PoseAdr uint32 t POSE BASE ADR uint32 t POSE OFFSET uint
62. he robot to read the motion data stored in the flash memory This objective will allow motion sequences for the movement of the robot to be created using the software development kit provided and play these motions on the robot using the functions created before iv Implement a simple wall following algorithm to make the robot find its way out of a simple maze This objective will enable the robot to find its way out of a simple maze by executing a simple maze solving strategy 1 3 Methodology In order to achieve the objectives certain steps were carried out Beginning with the literature research the documentation provided with the Bioloid Comprehensive Kit were thoroughly studied and a comprehensive study was done to discover new ways to program the robot besides using the software development kit provided The example C language code provided in the Bioloid manual was studied and some basic functions were extracted from it Nauman Shah Maze solving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Further functions were implemented using the WinAVR compiler by AVRFreaks coupled with the Programmer s Notepad The Motion Editor software was used to create walking and turning motion sequences which were downloaded on to the flash memory of the main controller module of the robot using the Robot Terminal software p
63. he set objectives were met successfully and performed the required tasks Initially a comprehensive research was done about the background of the topic and the design and operation of the hardware and software used for the project A design layout was then laid which was accomplished by writing C functions to operate the Dynamixel servos and sensor by sending simple instructions through the main controller module Further on functions were implemented which were used to play the motion sequences created through the Motion Editor software on the robot Finally a maze solving algorithm was coded which adapted the wall following strategy to enable the robot to find its way out of a simple maze created Besides the minor issues of the instability of the robot s movements the overall performance of the project was satisfying Nauman Shah Maze solving by a Humanoid Robot 37 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 4 2 Review of Objectives This section will review the project objectives highlighting their finished states and performances Research and study the hardware components existing software development kits and the communication protocol s This broadened the understanding of the operation design architecture and control of the servos sensors and the microprocessor used to build the robot Th e knowledge gained in this stage was used
64. heckLeftFlag 1 amp amp CheckCenterFlag 1 amp amp CheckRightFlag 0 CheckLeftFlag 1 amp amp CheckCenterFlag 0 amp amp CheckRightFlag 0 for i20 i 2 i f NextPage 87 for j 0 4 lt 4 3 The 4 pages of Right Turn f ME CurrentPage NextPage er NextPage pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage uint32 t PAGE NEXT PAGE sei doPage ME CurrentPage delay ms 500 doPage 1 delay ms 500 NextPage 60 for i20 i lt 7 it f ME CurrentPage NextPage cli NextPage pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage uint32 t PAGE NEXT PAGE sei doPage ME CurrentPage delay ms 2 Nauman Shah Maze solving by a Humanoid Robot 75 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report ExitPage pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage uint32 t PAGE EXIT PAGE delay ms doPage ExitPage delay ms 500 doPage 1 delay ms 1000 pee Turn Left if CheckLeftFlag 0 amp amp CheckCenterFlag 1 amp amp CheckRightFlag 1 CheckLeftFlag 1 amp amp CheckCenterFlag 1 66 CheckRightFlag 1 for i 0 i lt 2 i NextPage 96 for j 0 4 lt 4 j
65. ical Engineering BEng Final Year Project Report Sensor h Defines the constants and control table addresses for the AX S1 Sensor Module Also contains the function prototypes of the functions designed to operate the sensor nM ifndef SENSOR H define SENSOR H include inttypes h include avr io h include avr interrupt h include avr signal h include Bioloid h include led h define SensorID 100 Control Table Address EEPROM AREA define S MODEL NUMBER L 0 define S MODOEL NUMBER H I define S_VERSION 2 define S_ID 3 define S BAUD RATE 4 define S RETURN DELAY TIME 5 define S LIMIT TEMPERATURE 11 define S DOWN LIMIT VOLTAGE 12 define S UP LIMIT VOLTAGE 13 define S RETURN LEVEL 16 define S OBSTACLE DETECTED COMPARE VALUE 20 define S LIGHT DETECTED COMPARE VALUE 21 define S LEFT IR SENSOR DATA 26 define S CENTER IR SENSOR DATA 27 define S RIGHT IR SENSOR DATA 28 define S LEFT LUMINOSITY 29 define S CENTER LUMINOSITY 30 define S RIGHT LUMINOSITY 31 define S OBSTACLE DETECTION FLAG 32 define S LUMINOSITY DETECTION FLAG 33 define S SOUND DATA 35 define S SOUND DATA MAX HOLD 36 define S SOUND DETECTED COUNT 37 define S SOUND DETECTED TIME L 38 define S SOUND DETECTED TIME H 39 define S BUZZ
66. id 82 Date accessed 08 04 09 2 Jea Kweon Han In Yong Ha and Byoung Soo Kim 2008 Educational Robotic Construction Kit Bioloid http www nt ntnu no us ers skoge prost proce edi ngs ifac 2008 dat a papers 1 723 pdf Date accessed 08 04 09 3 Wolf Joerg 2008 The secrets of Robot Football http www swrtec de swrtec research publications Secrets of RobotFootball pdf Date accessed 08 04 09 4 Azonano Technology 2007 US Navy Academy to Acquire 50 Robotis Bioloid Humanoid Robot Kits from KumoTek http www azonano com News asp News ID 4498 Date accessed 08 04 09 5 Nordin P and Nordahl M date unknown An Evolutionary Architecture for Humanoid Robot http humanoid fy chalmers se text cuba pdf Date accessed 08 04 09 6 Wikipedia 2009 Humanoid Robot http en wikipedi a org wiki Humanoid robot Date accessed 10 04 09 7 Kwoon Woong Kim Hyun K Park Joong K Roh Chang H Lee Jawoo Park Jaeho Kim Won Kuk and Roh Kyungshik Biped Humanoid Robot Mahru III http planning cs cmu edu hum anoids0 7 p 18 pdf Date accessed 12 04 09 8 Biped Robots 2007 Biped Robots http www bipedrobots co uk Date accessed 12 04 09 9 ROBOTIS 2006 Dynamixel AX 12 User s Manual 10 Moballegh Hamid R Guilbourd Roman Hohl Gretta Oertel Michael and Rojas Raul 2007 FUmanoid Team Description 20
67. id Robot Oxff bChecksum gbpRxBuffer bCount 55 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report PrintBuffer print data in Hex code PrintBuffer needs two parameter name of Pointer gbpTxBuffer gbpRxBuf fer xf void PrintBuffer byte bpPrintBuffer byte bLength byte bCount for bCount 0 bCount lt bLength bCount TxD 8Hex bpPrintBuffer bCount UxD8 TxDString LEN TxD8Hex bLength TxD8 Print value of Baud Rate void PrintBaudrate void TxDString r n RS232 TxD32Dec 16000000L 81L long UBRRIL 1L TxDString BPS TxDString RS485 TxD32Dec 16000000L 8L long UBRROL 1L TxDString BPS S SerialInitialize set Serial Port to initial state Vide Megal28 Data sheet about Setting bit of register Seriallnitialize needs port Baud rate Interrupt value 7 void SerialInitialize byte bPort byte bBaudrate byte bInterrupt f if bPort SERIAL PORTO f UBRROH 0 UBRROL bBaudrate UCSROA 0x02 UCSROB 0x18 if bInterrupt amp RX INTERRUPT sbi UCSR0B 7 RxD interrupt enable UCSROC 0x06 UDRO OxFF sbi UCSROA 6 SET_TXDO FINISH Note set 1 then 0 is read else if bPort SERIAL PORT1 f UBRR1H 0 UBRRIL bBaudrate UCSRIA 0x02 UCSRIB 0x18 if bInterrupt amp RX INTERRUPT sbi UC
68. ightFlag CheckRightSensor Check right sensor j fee Walk Straight ss s NextPage 60 if CheckLeftFlag 0 amp amp CheckCenterFlag 0 amp amp CheckRightFlag 1 CheckLeftFlag 1 amp amp CheckCenterFlag 0 amp amp CheckRightFlag 1 while CheckLeftFlag 0 amp amp CheckCenterFlag 0 amp amp CheckRightFlag 1 CheckLeftFlag 1 amp amp CheckCenterFlag 0 amp amp CheckRightFlag 1 ME CurrentPage NextPage cli NextPage pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage t uint32 t PAGE NEXT PAGE sei doPage ME CurrentPage _ delay ms 2 CheckLeftFlag CheckLeftSensor CheckCenterFlag CheckCenterSensor CheckRightFlag CheckRightSensor Nauman Shah Maze solving by a Humanoid Robot 74 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report ExitPage pgm read byte far uint32 t POSE BASE ADR uint32 t PAGE SIZE uint32 t ME CurrentPage uint32 t PAGE EXIT PAGE _ delay ms doPage ExitPage delay ms 500 doPage 1 delay ms 1000 55 2 Turn Right if CheckLeftFlag 0 amp amp CheckCenterFlag 0 amp amp CheckRightFlag 0 CheckLeftFlag 0 amp amp CheckCenterFlag 1 amp amp CheckRightFlag 0 C
69. ing of the Makefile in the Makefile menu on the top This allows the Makefile to be edited Once the option is selected two values needed to be changed Enter the name of the resultant hex file to be created next to TARGET and enter the names of all the source files next to SRC as shown in the figure below Makefile File Makefile Ele Makefile Save Sayo As Op b an be 0 1 2 3 s ition oplimize for size lys the best opimeaton level See avr List any extra dieclories lo look fcr include files here Each drectory mus be seperated by a space EXTRAINCDIRS Compiler flag to set the C Standard level 3c89 ANSI C gnu83 c89 plus GCC extensicns c39 SU C33 standard not yet lullp implemented 31 gauss C93 plus GCC estensicns CSTANDARD std gru93 MCU name MCU atmega128 Output format can be srec ihex binary FORMAT ihex ile name without extension Modified items ere C dependencies are automatically generated List Assembler source files here Make them always end in a capital 5 Files ending in a lowercase s will not be considered source files but generated files assembler output from the compiler and will be deleted upon make clean t Even though the DOS Win filesystem matches both s and 5 the same it will preserve the spelling of the filenames and gcc itself does care about how the name is spelled on its
70. ion Editor to easily create motion sequences for the robot and to gain the complete control over the robot using C programming language Nauman Shah Maze solving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 1 2 2 Objectives In order to achieve the main aim it was broken down into a number of objectives for each of which a separate work stage was designated The different objectives have been listed below along with the details of why the objectives were chosen and the potential benefits their completion will provide i Research and study the hardware components existing software development kits and the communication protocols Through this objective extensive knowledge about the basic concepts and background of robotics will be gained It will highlight the basic operations design and architecture of the hardware used to build the robot ii Devise functions in C programming language for the main controller module of the robot to send simple commands to servos and read information from the servos and the sensor This will enable the main controller module of the robot to read and write data to the servos allowing the ability to send a servo to a desired target position at a specified speed and monitor its current position iii Implement functions in C programming language for the main controller module of t
71. ion then uses a pgm read byte far to read the data off the flash memory using the calculated addresses after disabling the interrupts of the system Interrupts are disabled to disable them from interrupting the system while memory is being accessed They are enabled back on after reading the memory Pose Pause Address Pose Base Address Pose Offset Page Size x Page Number Pose Size x Pose Number Pose Pause Offset Pose Speed Address Pose Base Address Pose Offset Page Size x Page Number Pose Size x Pose Number Pose Speed Offset The function also reads the Page Speed of the Page and stores it into the global variable ME created discussed earlier in the chapter A Page Fast value is also read which determines if this page should be played at a higher speed than specified This value is not visible in the Motion Editor software If this flag value is set the function sets the Page Speed to a value of 160 Once the pose settings are read the function moves on to read the target positions of each servo to be moved to The values are read in a loop and saved in the Read Pose ServoTarget array The function in the end returns the Read Pose Playing a Pose To make the robot play a motion pose all the servos of the robot had to be moved to the target positions specified in the pose simultaneously Also a strategy had to be implemented in order to make all the servos reach their target positions at
72. mmer s Hotepad File Edit View Tools wir Default CtreN New gt Project E3 Open Ctrl 0 Project Group Open Project s Plain Text Revert Ada Assembler AVR Assembler Batch Files Give the project an appropriate name and specify the location of the Folder to save the project file in After a project is created a new C file is to be created to start writing the program To do so go to the New menu in the File menu as done before Then select C C option from the menu which will open a new editor window Nauman Shah Maze solving by a Humanoid Robot 78 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 4 Programmer s Notepad File Edit view Tools wir Defaut Ctri N New gt Project Al Open ctrl o Project Group Ga Open Projects Plain Text Revert Ada Assembler Save As AVR Assembler ID Save Al Ctrl Shift 5 Batch Files CI Cr C Save Workspace As Encoding Export Save the file with an appropriate name by selecting the Save As option in the File menu Once the file is file is saved it can be added to the current project by right clicking on the project name in the Projects Panel on the left and selecting the Add New option 4 Programmer s Notepad File Edit View Tools Window Help BA ade Projects Example Proje Add Files F Add New Folder Ad
73. munication and Electrical Engineering BEng Final Year Project Report the rest contain 7 poses each being 64 bytes The page size thus is 512 bytes na iii Robot Terminal The Robot Terminal software is a command based application provided for low level management of the Bioloid robot It connects the computer to the CM 5 through a serial link and can be used to transmit specific commands to the CM 5 module monitor its status and setup configurations for the Dynamixels The terminal is a very useful tool for debugging purposes and can be used to monitor Ezzzz i the output of the CM 5 on the screen The software can also be Figure 14 Robot Terminal user developed programs onto the robot Screenshot used to replace the default firmware and download files and load The Robot Terminal can also be used to access and edit the Motion Pages in the flash memory with simple commands hence providing nearly all the functions of Motion Editor Software but in textual interface H7 1909 Nauman Shah Maze solving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 2 2 3 Communications i Wiring Ola t O cues 6 Ya Ll QE qm wo Control Box CM 5 Figure 15 Wiring of CM 5 Module with Dynamixels P The Bioloid is based on a simple UART serial network connecting th
74. nce of motion Poses In order to implement this sequence three separate function doPose doPage and doMove were written The motion poses and pages were created using the Motion Editor software These pages were downloaded on the flash memory of the CM 5 module using the Behaviour Control program To make the robot play the pages this data was to be read from the flash memory Before this data was read the relevant information of the poses was grouped together as a single structure and was defined as MOTION EDITOR DATA in the Bioloid h A typedef struct global variable of this structure type was defined RT CurrentPage with the name of ME This was used to handle d TotalTime the sequence of the pages to be played q pag play PageSpeed MoveFinishTime NoOfPoses CurrentPose MOTION EDITOR DATA The information contained by a pose was similarly grouped in a structure POSE struct shown below The ServoPos stored the current positions of all the servos of the robot and the ServoTarget stored the target positions the servo had to move to in order to implement the motion pose Nauman Shah Maze solving by a Humanoid Robot 25 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report typedef struct uint8 t PoseSpeed ServoNo pm M MESES vimes i Poso uint16 t ServoPos NUM OF SERVO
75. ode for the Motion Editor functions explained above is attached in Appendix E and is contained in the ME c source file 3 3 4 Sensor Functions Keeping the aim of the project in focus the next objective to tackle was implementing functions to operate the AX S1 Sensor module The humanoid had three pair of sensors one on each side left right and front Each sensor senses automatically senses the distance from the object in front of it and stores a value ranging from 0 1023 Higher the value closer the object is In order to read this value the address of the location of this value was defined in a header file Sensor A Nauman Shah Maze solving by a Humanoid Robot 31 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Initially a function was implemented to read the Obstacle Detection Flag of the sensor module discussed in Chapter 2 2 1 but the flag is only set comparing to a single compare value for all three sensors This was overcome by implementing three separate functions for each side s sensor which read the value of the sensor compared it with a set threshold and returned 1 if the value was greater than the threshold indicating that an object is close to that side of the robot CheckLeftSensor function sends a READ instruction to the sensor module specifying the address of the left Infrared sensor data After verifying the returned val
76. or c Hardware Dependent Item define TXD1 READY bit is set UCSRIA 5 UCSRIA Bit5 define TXD1 DATA UDR1 define RXD1 READY bit is set UCSRIA 7 define RXD1 DATA UDR1 define TXD0 READY bit is set UCSR0A 5 define TXD0 DATA UDRO define RXD0 READY bit is set UCSROA 7 define RXD0 DATA UDRO define SERVO NOT CONNECTED 9999 define NUM OF SERVOS ATTACHED 19 int main void PortInitialize Port In Out Direction Definition Initialisation RS485 RXD Set RS485 Direction to Input State Seriallnitialize SERIAL PORTO 1 RX INTERRUPT RS485 Initializing RxInterrupt Seriallnitialize SERIAL PORT1 DEFAULT BAUD RATE 0 RS232 Initializing None Interrupt SensorInit gbRxBufferReadPointer gbRxBufferWritePointer 0 RS485 RxBuffer Clearing Nauman Shah Maze solving by a Humanoid Robot 73 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report sei Enable Interrupt Compiler Function doPage 1 delay ms 1000 doPage 25 delay ms 1000 WallFollowing int WallFollowing uint8 t NextPage uint8 t ExitPage uint8 t CheckLeftFlag uint8 t CheckCenterFlag uint8 t CheckRightFlag int i 0 int 3 0 doPage 1 7 delay ms 1000 while 1 f CheckLeftFlag CheckLeftSensor Check left sensor CheckCenterFlag CheckCenterSensor Check center sensor CheckR
77. ortunity of the high demand by robot enthusiasts Kondo a Japanese company developed and launched the first biped humanoid robot kit the KHR 1 allowing consumers to design build and program robots at a smaller and cheaper scale With it being a great success other companies such as Hitec with its RobotNova 1 and Robotis with its Bioloid Edutainment Kit expanded the market These development kits besides their remarkable educational and research application supported a new field which resulted in a whole community of robot enthusiasts and students all over the world designing and building their very own robots Global events such as Robo One FIRA Federation of International Robot soccer Association and Wonderful Robot Carnival allows these students and hobbyists from all over the world to present and compete their robots against each others 8 Nauman Shah Maze solving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 2 2 The Bioloid Comprehensive Kit The project detailed by this report was based on one of such earlier discussed development kits The Bioloid Comprehensive Kit by a Korean company Robotis The Bioloid Comprehensive Kit is the first of its kind to be built around smart serially controlled servo technology This allows users to construct a wide variety of autonomous robots and configure them using one controller board
78. page eckLeftSensor None Reads the value of the left sensor and returns a Boolean flag depending on the value CheckCenterSensor None Flag Reads the value of the front sensor and returns a Boolean flag depending on the value CheckRightSensor None Flag Reads the value of the Right sensor and returns a Boolean flag depending on the value 3 3 1 Example code functions In order to accomplish the aim the first objective was to implement functions to send instruction packets to the Dynamixels and receive status packets from them Fortunately the User Guide to the AX 12 sero provided an example C code which included the basic define directives defining the AX 12 servo s control table addresses It also included functions to configure the serial communication between the CM 5 microcontroller and the Dynamixels Also the code included functions to transmit instruction packets and receive status packet from the Dynamixels A few other functions to print the from the CM 5 module to the Robot Terminal screen were also included These functions were acquired from the Nauman Shah Maze solving by a Humanoid Robot 22 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report example code and used for the project The functions taken from the example code are in the Bioloid c files of the project attached in the Appendix E The operation of the functions used is b
79. rdshire School of Electronic Communication and Electrical Engineering For CM 5 define define define define define define define define define define define define define define define RS485 TXD PORTE amp BV PE3 PORTE BV PE2 485 DIRECTION 1 RS485 RXD PORTE amp BV PE2 PORTE BV PE3 PORT 485 DIRECTION SET TxDO FINISH sbi UCSR0A 6 RESET TXDO FINISH cbi UCSR0A 6 CHECK TXDO FINISH bit is set UCSR0A 6 SET TxDl FINISH sbi UCSR1A 6 RESET TXD1 FINISH cbi UCSR1A 6 CHECK TXD1 FINISH bit is set UCSRIA 6 RX INTERRUPT 0x01 TX INTERRUPT 0x02 OVERFLOW INTERRUPT 0x01 SERIAL PORTO 0 SERIAL PORTI 1 BIT RS485 DIRECTIONO 0x08 Port E BIT RS485 DIRECTION1 0x04 Port E Hardware Dependent Item define TXD1 READY bit is set UCSRIA 5 define TXD1 DATA UDR1 define RXD1 READY bit is set UCSRIA 7 define RXD1 DATA UDR1 define TXD0 READY bit is set UCSROA 5 define TXD0 DATA UDRO define RXD0 READY bit is set UCSROA 7 define RKDO DATA UDRO define SERVO NOT CONNECTED 999 define NUM OF SERVOS ATTACHED 19 Global Variable Number volatile byte gbpRxInterruptBuffer 256 byte gbpParameter 128 byte gbRxBufferReadPointer byte gbpRxBuffer 128 byte gbpTxBuffer 128 volatile byte gbRxBufferWritePointer endif BIOLOID H Nauman Shah Maze solving by a Humanoid Robot BEng Final Year Project Report UCSRIA
80. riefly explained below void Portlnitialize void This function initialises the ports of the microprocessor to implement half duplex communication void Seriallnitialize byte bPort byte bBaudrate byte blnterrupt This function initialises the serial port the function is called for to the initial state byte TxPacket byte bID byte binstruction byte bParameterLength This is function assembles the arguments passed to it in the format of the instruction packet discussed in chapter 2 2 3 and sends it to the Dynamixel with the network ID equal to the bID argument passed The function assembles these values in the specific format in a global buffer gbpTxBuffer The value OxFF is stored in the first two locations of the buffer indicating the start of the Instruction Packet The unique network ID of the Dynamixel is stored in the third location followed by the length of the packet in the fourth location If there are any additional parameters to be sent the length of these parameters are passed in the function as bParameterLength and this value is added to the packet length The instruction to be sent bInstruction is stored in the fifth location of the buffer Finally the checksum is calculated and stored in the end of the buffer The value of the direction port is then inverted to send the instruction to the specific Dynamixel The function returns the length of the packet calculated byte RxPacket byte bRxPacketLength This f
81. rovided The functions developed were then used to implement these motions in sequence to implement wall following and were tested in a simple maze created with cardboard pieces 1 4 Feasibility Study Before the implementation of the project work was done a feasibility study was carried out and a report was generated to establish an understandi ng between the student and the supervisor on the formal title of the project as well as the objectives and goals set out to be achieved The report looked in to the aims and objectives set out for the project and gave a brief overview of the entire project giving a short description of the apparatus used It explained the various stages of work involved in order to achieve the required goal A detailed action plan was projected showing how the project work is to be undertaken together with planned time scales for the successful completion of the project The project time plan is attached in the Appendix A 1 5 Project Cost Analysis The project cost was mainly based on the Bioloid Comprehensive Kit itself which was provided by the university The Bioloid Comprehensive Kit is available in the market at a current price of 625 31 M The software development kit provided with the Kit is freeware and hence can be installed on as many computers as per required The compiler used was a freeware GNU GCC compiler WinAVR coupled with Programmer s Notepad by AVRFreaks Nauman Shah Maze sol
82. rque of the servos off and set the robot into a desired pose manually by moving each servo by hand This allows more complex poses to be created easily Nauman Shah Maze solving by a Humanoid Robot 14 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report The Page Information window shows the information of the selected page Page name 1 0x0000E200 1 1 Page number Data address Play count Number of pose Motion speed 32 Accel time 32 Next page No 0 Exit page No 0 The Page Name field is used to name each pose for convenience and to easily recognize the function of each page The name is empty as default Page number is a unique number for each page saved in the CM 5 flash memory The memory can store up to 128 pages at one time so the page number range from 0 127 Data address shows the physical address of the page in the robot s memory Play Count depicts the number of times the page is supposed to be played Increasing this value from 1 will make the robot loop through the page that number of times before moving on the next page or ending the motion Number of poses depicts the number of poses in the specific pose Motion Speed is the speed of the page s speed This value allows the user to adjust the play speed of the whole page The default value is 32 and similar to the Pose Speed doubling the value will double th
83. s taken to test the system developed and debug the problems that occurred It finally ends by presenting the results and outcomes of the system developed 3 1 The Bioloid Humanoid Model As stated earlier the project represented by this report was based on the humanoid robot model built from the Bioloid Comprehensive Kit The robot was built according to the instructions provided in the Assembly Manual Guide provided with the Kit 24 The robot was built using 18 AX 12 servos hence have 18 DOF Each servo operates as a joint of the robot The AX S1 sensor is mounted on the top as the head of the robot such that the IR sensors can sense from the front left and right of the robot The diagram below shows the configuration of the robot Figure 18 Bioloid Humanoid Model P The humanoid model was already built and provided by the University and the project work was then implemented on it Nauman Shah Maze solving by a Humanoid Robot 20 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 3 2 WinAVR Compiler As the focus of the project presented was to program the Bioloid using C programming language comprehensive research had to be done in order to understand the technique Although programming the robot using C language is much more complex than simply using the software development kits provided it allows complete control over the ro
84. sends a READ instruction to the servo using the earlier discussed TxPacket function The servo in return saves the current position of the servo in the gbpRxBuf fer which are read off it and returned by this function Sending a Servo to a Target Position The function SendServoTargetPos ServoNo Target Speed Written sends the servo to a target position at the specified speed The function is passed in the servo s unique network ID the target position and the speed The function loads the address P GOAL POSITION L 0x32 where to write these specific values these values and the parameters passed into the gbpParameter buffer The function then sends the servo a WRITE instruction using the TxPacket function Once the values are written in the specific location the servo s microcontroller automatically moves the motor to the target position The complete code for the Servo functions explained above is attached in Appendix E and is contained in the ME c source file Nauman Shah Maze solving by a Humanoid Robot 24 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 3 3 3 Motion Editor Functions Once the functions to operate the servos were completed the next objective was to implement function to read and play the motion editor pages The motion created by the Motion Editor plays in a sequence of motion Pages which in turn is played by a seque
85. t 10 lTmp byte lLong lDigit if LTmp TxD8 byte 1Tmp 0 TxDString prints data in ACSII code wy void TxDString byte bData while bData TxD8 bDatat RxD81 read data from UART1 RxD81 return Read data vy byte RxD81 void f while RXDI1 READY return RXD1 DATA SIGNAL UARTO Rx Interrupt write data to buffer ua SIGNAL SIG UARTO RECV gbpRxInterruptBuffer gbRxBufferWritePointert4 RXDO DATA Nauman Shah Maze solving by a Humanoid Robot BEng Final Year Project Report 58 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report ME h Defines the constants control table addresses and structures for functions to operate the AX 12 servo read the Motion Editor data and play the motion sequences f define ENABLE BIT DEFINITIONS include inttypes h include avr io h include avr interrupt h include avr signal h include Bioloid h include led h ifndef ME H define ME H Constants define POSE BASE ADR define POSE OFFSET define POSE SIZE define NO OF POSES PER PAGE within a page define PAGE SIZE define PAGE FAST FLAG define PAGE PLAYCOUNT define PAGE NU
86. the RC 100 and the ZIG 100 could also be incorporated for wireless control of the robot This would enable the robot s motion to be controlled by sending wireless commands through the controller There is also an option to install more servos to the humanoid model giving it more degree of freedom For example adding a servo at the waist of the model would allow the robot to turn its torso allowing a whole new range of motion sequences to be implemented 4 5 Chapter Summary This chapter concluded the report by giving a brief summary of the project It looked into the objectives that were set in the beginning of the project and explained to what extent each of those has been completed Nauman Shah Maze solving by a Humanoid Robot 39 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report It discusses the time management required during the project discussing the time plan designed at the beginning of the project It then looked into the future development possibilities of the project and gives examples of how it could be further improved Nauman Shah Maze solving by a Humanoid Robot 40 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report REFERENCES 1 Robot Savw 2009 Bioloid Comprehensive Kit Information http robosavvy com store product info php products
87. throughout the project and helped in implementing the project Devise functions in C programming language for the main controller module of the robot to send simple commands to servos and read and write information from the servos and the sensor The getServoPosition function was implemented which allowed the CM 5 module to send a READ instruction to the servo reading the current position of the servo The function allowed the ability to monitor the positions of each servo The SendServoTarget function was implemented which allowed to CM 5 module to send a WRITE instruction to the servo in order to send the servo to a target position The function was a basic part of the project allowing the ability to move the servo as required Implement functions in C programming language for the main controller module of the robot to read the motion data stored in the flash memory and play the motion sequences on the robot This allowed the ability to read the motion pages developed using the Motion Editor Software and play those motion sequences on to the robot This allowed the ability to move the robot as desired making it walk turn and stand Implement a simple wall following algorithm to make the robot find its way out of a simple maze Finally the last objective was met which made the robot successfully traverse a simple maze and find its way out to the exit Nauman Shah Maze solving by a Humanoid Robot 38 University o
88. to address the desired Dynamixel and sends an instruction packet with the set ID and an instruction Only the Dynamixel with that specific ID will respond to the packet and send back a Status Packet with the required parameters requested as depicted in the figure above 9 The structure of the Instruction packet is shown in the figure below Instruction Packet OXFF ID LENGTH INSTRUCTION PARAMETER PARAMETER N CHECK SUM The two OxFF bytes indicate the start of the packet The ID contains the unique ID of the Dynamixel being addressed The Length field carries the length of the packet Its value is computed by the formula Number of parameters 2 The Instruction byte carries the required instruction to be carried out by the Dynamixel Parameter carries the additional information needed to carry out the instruction For example if writing to a certain address of a servo the address as well the data to be written is contained in this field of the packet Finally a checksum sum is attached to assure successful transmission of the packet The instruction set of the AX 12 servo is given in the Appendix D The status packet shown in the figure below has a structure very similar to the instruction packet Nauman Shah Maze solving by a Humanoid Robot 18 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Status Packet LENGTH ERROR
89. trossenrobotics com bioloid robot system aspx Date accessed 16 04 09 20 San Jose State University 2008 Introduction to Atmel Atmega1 28 Microcontroller http www engr sjsu edu bjfurman courses ME 1 06 ME 1 06pdf intro atmel pdf Date accessed 16 04 09 21 Wikipedia 2009 Maze Solving Algorithm http en wikipedia org wiki Maze solving algorithm Date accessed 16 04 09 Nauman Shah Maze solving by a Humanoid Robot 42 University of Hertfordshire School of Electronic Communication and Electrical Engineering 22 ROBOTIS 2006 Bioloid Quick Start Assembly Guide Nauman Shah Maze solving by a Humanoid Robot BEng Final Year Project Report 43 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report BIBLIOGRAPHY 1 ROBOTIS 2006 Bioloid User s Manual 2 ROBOTIS 2006 AX 12 User s Manual 3 ROBOTIS 2006 AX S 1 Users Manual 4 Robot Savw 2009 Bioloid Comprehensive Kit Knowledgebase http robosavvy com site index php 0ption com_content amp task View amp id 8 2 amp lt emid 81 Date accessed 15 04 09 5 Simpson Michael 2007 Understanding the AX 12 http www antratek nl pdf Understanding A X12 pdf Date accessed 13 04 09 Nauman Shah Maze solving by a Humanoid Robot 44 University of Hertfordshire School of Hectronic Comm
90. ues status and if no error had occurred in the transmission the function compares the value with a preset threshold value for the sensor and returns 1 if the value is greater than the threshold depicting that there is an object on the left side of the robot A 0 is returned if the value is smaller than the threshold or an constant error value SERVO NOT CONNECTED is returned in case of an error uint8 t CheckLeftSensor uint8 t LeftObstacle gbpParameter 0 S LEFT IR SENSOR DATA gbpParameter 1 1 Read Compare Bit TxPacket SensorID INST READ 2 uint8 t bRxPacketLength RxPacket DEFAULT RETURN PACKET SIZE gbpParameter 1 if bRxPacketLength DEFAULT RETURN PACKET SIZE gbpParameter 1 f if gbpRxBuffer 4 0 LeftObstacle gbpRxBuffer 5 eset error return SERVO NOT CONNECTED error return SERVO NOT CONNECTED if LeftObstacle gt LEFT OBSTACLE THRESHOLD return NA else return 0 Nauman Shah Maze solving by a Humanoid Robot 32 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Similarly CheckRightSensor function checks the right sensor and CheckCenterSensor function checks the front sensor Appropriate values for the thresholds for each side s sensors were chosen through the hit and trial method RIGHT OBSTACLE THRESHOLD 7 LEFT OB
91. unction reads the status packet returned from a Dynamixel after it has been sent an instruction packet The function implements a simple while loop and reads the data off a buffer gbpRx InterruptBuffer and stored it in gpbRxBuffer Once the data is read the function verifies the packet checking if any errors have occurred in the transmission void TxD8Hex byte bSentData This function prints the data passed to it on the Robot Terminal screen as separate hexadecimal numbers void TxDString byte bData The function prints the data passed to it on the Robot Terminal screen as a string of characters Nauman Shah Maze solving by a Humanoid Robot 23 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 3 3 2 Servo Functions To accomplish the aim of the project the first objective to overcome was to implement C language functions to get the current position of the AX 12 servo and to move it to a target position These functions are displayed in detail below Reading a Servo s Position The getCurrentServoPos ServoNo function reads the current position of a servo The function loads the address of the location where the current position P PRESENT POSITION L 0x37 is saved in the servo and the number of bytes to read in this case 2 lower and higher byte of the current position into the gbpParameter buffer The function then
92. unication and Electrical Engineering BEng Final Year Project Report APPENDICES Appendix A Project Time Plan Appendix B Control Table for Dynamixel AX 12 Servo Appendix C Control Table for Dy namixel AX S1 Sensor Appendix D Instruction Set for Dynamixel Appendix E Software Listings Appendix F Instruction guide to download a C program on the CM 5 Nauman Shah Maze solving by a Humanoid Robot 45 6038S 30 70 UO UOISS3S 131804 TUN jog voy Aep UOISSIWANG BUIZ 92 185 Wan skepp JOS1AJ30NS oj uoeJjsuoue RU J 3 185 mean skep sg poday eui Bum iz NL jipan gshep WON E99 6Jg IJE JO LOYAAWOY IL 9n son skep 2 Uogenjge3 pue unsa palosg Azs Goons skepp yaa wex son Q0zbip7 PAN Sep ss vogeuawajdw 9 BEng Final Year Project Report p 6 6 60 bi bi 6 6 9 icm eucusou skepog 020 0 g pue suoneoiunuuuo Gupugjssapup PN UKA skepp Apnjs syvavodwos 2JBMPJBH IA UJ Uri U4 GAWD ogoji ouo jeJOIABYaG sabeyagg Guwwesbosg Ir ud WOWOE MUL skepsi 28882 3Jn83 2NSU2U3 0W09 VOUS PAM 8010115 PAN SABp pnis Ayyqisea4 Jepu 90 0 60 20 C 60107 6032 ugly ues uoyeung AWEN YSE Ree Sz Pai E5 w 2P cw major School of Electronic Communication and Electrical Engineering Appendix A Project Time Plan 46 Nauman Shah Maze solving by a
93. urns the maximum distance a servo has to move in a particular pose int MaxDistance POSE Read Pose f uint8 t ServoNo 0 int16 t Difference uint16 t Max 0 int temp 1 for ServoNo 1 ServoNo lt NUM OF SERVOS ATTACHED ServoNo f Difference Read Pose ServoTarget ServoNo Read Pose ServoPos ServoNo if Differencex0 Difference Difference if Difference Max f Max Difference temp ServoNo return Max Nauman Shah Maze solving by a Humanoid Robot 63 University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report Sends the robot to the servo positions specified in a Pose of the Page eu eg UPS POE pas DO y Ss DeL uintl6 t doPose int page char pose float NSpeed POSE Read_Pose uint8 t ServoNo 0 uint16 t MaxServoSpeed ServoRefSpeed int16 t Difference Read Pose ReadPose page pose Read Pose Information int Max MaxDistance Read Pose Calculate the max distance to be moved NSpeed is the Normalised Page Pose Speed If both Page n Pose Speeds are 32 the speed of servo is 90 degrees sec Thus NSpeed 1 32 x 32 1024 NSpeed float ME PageSpeed Read Pose PoseSpeed 1024 0 Each servo can move a max of 300 degrees Its position values can range from 0 1023 Thus a change of 3 41 units moves 1 degree Since Time Dist Speed Distance Max 3 41
94. us for humans robots have been and even more will be an essential innovation serving the mankind in incomprehensible ways 2 1 1 Humanoid Robots The field of autonomous robotics is rapidly growing and attracts an accelerating interest Although the various robot model designs have been designed in the field of robotics be it hobby or commercial the holy grail has been the production of the humanoid biped model The humanoid model not only has the overall appearance resembling that of a human body it also is designed to imitate the human behaviour and motion capabilities Its autonomous nature allows it to adjust strategies based on the surroundings and adapt to new surroundings hence requiring high performance in both software and hardware It is argued that if these requirements and successfully fulfilled humanoid robots could be the next dominating mechanical industry 2 1 2 History of Humanoid Robots and State of Art Since the launch of the first human size biped humanoid Wabian by the Waseda University in Japan in 1995 many humanoid robots have been built in both industry and academia for variety of purposes Many companies such as Honda Sony Samsung Toyota and Fujitsu have been working for year on the development of humanoid robots Honda after developing Nauman Shah Maze solving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng
95. ving by a Humanoid Robot University of Hertfordshire School of Electronic Communication and Electrical Engineering BEng Final Year Project Report 1 6 Product Marketability Even though there are no direct applications of the project carried out in the market it is an excellent educational platform and can be used for various research purposes Famous for its flexibility in the mechanical design of the robot and its low cost many educational institutes are using the Bioloid platform for engineering education The easily programmable modular based design of the kit can allow students to understand the concepts of robotics and mechanic al engineering 2 The platform is also known to be very popular in the international robotics competitions such FIRA Federation of International Robo Soccer Association 3 Also the Bioloid platform is currently being used by the U S Naval Academy in their Mechanic al Engineering courses 4 1 7 Summary This chapter gave a brief introduction to the project highlighting the main aim of the project and detailed the objectives set to achieve them It looked in to the methodologies undertaken to accomplish each aim of the project It talked about the feasibility study carried out and the cost analysis of the project The chapter ends by talking about the projects marketability its importance in the market and the applications in the practical world The next chapter will talk about the Bioloid

Download Pdf Manuals

image

Related Search

Related Contents

Samsung GT-E2220 Korisničko uputstvo  AISLAFOAM ACUSTIC  FPSTHB2800 & FPSTHB2801  Spray-MountTM 7043  User's Guide - TRS  Spirostik    Smartdop 45 Service Manual  紫外・可視分光光度計による飲料中の鉄の濃度計算  User Manual  

Copyright © All rights reserved.
Failed to retrieve file