GorillaBot the 3D Printed Arduino Autonomous Sprint Quadruped Robot

12,454

192

91

Introduction: GorillaBot the 3D Printed Arduino Autonomous Sprint Quadruped Robot

About: 3D printing and programming robots made easy

Every year in Toulouse (France) there's the Toulouse Robot Race #TRR2021

The race consists of a 10 meter autonomous sprint for biped and quadruped robots.

The current record I gather for quadrupeds is 42 seconds for a 10 meter sprint.

So with that in mind I had to come up with a plan of designing a robot that I thought could beat that in order to become the new reigning champion!!!

Seeking a bit of inspiration from a fellow Instructables member "jegatheesan.soundarapandian" and last year's winner of the Toulouse Robot Race "Oracid 1" who both seem to love designing and sharing tutorials on how to build quadrupeds. I got started on basically copying there design and making it a bit bigger!

The design is based on a five bar linkage mechanism for each leg 2 servos power each leg for a total of 8 servos.

The rules state that apart from the start signal the whole race must be carried out by the robot autonomously so I had to come up with a light weight system to keep the robot on track in this case I used a QMC5883L Magnetometer (digital compass) so it could keep true to its orientation, a HC-SR04 Ultrasonic sensor in case the robot really messes up and starts hitting the wall at a 90 degree angle and I just used a step counter in the code to tell it how many steps it should do for 10 meters.

In case your interested in building this robot don't worry this monkey's got everything thought out!

100% Support free 3D printable Body:

Everything apart from the electronics and screws to attach the electronics are 3D printable, the same small cross head screws are the only ones used, all you'll need is a small cross head screwdriver to assemble the robot

Easy plug and play electronics:

no complex soldering required

Reasonable print time:

He may look big and imposing but he's only a 15 hour print (ok a long time for some :D)

Reasonable Build volume requirements:

He can be printed on a relatively small printer requiring a build volume of only L:150mm x W:150mm x H: 25mm

Total robot cost:

The robot alone costs around 75$ to build charger included

A 3D printed controller (optional) is required if you want the same set up as I have.

WARNING:

The 5V 3A power supply that I used isn't the best solution as for this robot to walk all 8 servos must run simultaneously and thus they draw quite a lot of current don't worry I haven't had the robot catch fire or anything but expect the power transistor to heat up quite a bit I would not recommend using the robot for more than 2 minutes at a time letting it cool down between runs to avoid any unwanted damage to the Servo shield.

If any of you have a solution to this problem your input would be greatly appreciated!

Supplies

SUPPLIES FOR THE ROBOT:

      • 8x Tower Pro MG90S analog 180 deg servo (Aliexpress/Amazon)
      • 1x Sunfounder Wireless Servo Control Board (Sunfounder Store/ RobotShop)
      • 1x Arduino NANO (Aliexpress/Amazon)
      • 1x NRF24L01 Transceiver Module(You don't need this if your not using the controller) (Aliexpress/Amazon)
      • 1x Magnetometer (digital compass) QMC5883L GY-273 (Aliexpress/Amazon)
      • 1x Ultrasonic sensor HC-SR04 (Aliexpress/Amazon)
      • 2x 18650 3.7V Li-ion batteries (Aliexpress/Amazon)
      • 1x 18650 dual Battery holder with on off switch (Aliexpress/Amazon)
      • 1x 18650 Li-ion Battery charger (Aliexpress/Amazon)
      • 4x female to female dupont jumper cables 10 cm long (Aliexpress/Amazon)
      • 4x female to female dupont jumper cables 20 cm long (Aliexpress/Amazon)
      • 10x Screws 2mm x 8mm (same as the screws in a pack of servos) (Aliexpress/Amazon)

          CONTROLLER:

          To control this Robot manually you will need the 3D printed Arduino Controller (link here)

          The Robot can also be purely autonomous so the controller is not mandatory.

          PLASTICS:

          The parts can be printed in PLA or PETG or ABS.

          !! Please note a 500g spool is more than enough to print 1 Robot !!

          3D PRINTER:

          Minimum build platform required: L150mm x W150mm x H25mm

          Any 3d printer will do. I personally printed the parts on the Creality Ender 3 which is a low cost 3D printer under 200$ The prints turned out perfectly.

          Step 1: 3D Printing the Parts

          So now it's time for Printing...Yeay!

          I Meticulously designed all of the parts to be 3D printed without any support materials required while printing.

          All the parts are available to download on thingiverse (link here)

          All the parts have been test printed on the Creality Ender 3

          • Material: PETG
          • Layer Height: 0.3mm
          • Infill: 15%
          • Nozzle diameter: 0.4mm

          The parts list is as follows:

          • 1x BASE ELECTRONICS
          • 1x BASE BACK
          • 1x BASE FRONT
          • 8x CIRCULAR PIN L1
          • 4x CIRCULAR PIN L2
          • 4x CIRCULAR PIN L3
          • 4x CIRCULAR PIN L4
          • 8x THIGH SERVO
          • 8x THIGH
          • 8x CALF EXT
          • 8x CALF INT
          • 8x FOOT
          • 4x SQUARE CLIP
          • 44x CIRCULAR CLIP

          The files are available as individual parts and group parts.

          For fast printing simply print every single GROUP.stl file once.

          Step 2: Assembling GorillaBot's Body

          All the assembly instructions are depicted in the assembly video above:

          1. Place a CIRCULAR PIN L1 in the hole of the BASE FRONT front left servo holder
          2. Feed the cable of one of the MG90S servos through the slot in the BASE FRONT front left servo holder
          3. Slot the MG90S servo in place
          4. Secure the MG90S servo in place with 2 screws (do not over tighten as this could damage the BASE)
          5. Repeat the same process for the BASE FRONT back left, front right and back right servo holders
          6. Repeat the same process for the BASE BACK front left, back left, front right and back right servo holders
          7. Secure the Battery holder to the BASE ELECTRONICS with 2 screws diagonally or 4 screws
          8. Secure the Wireless Servo Control Board to the BASE ELECTRONICS with 2 screws diagonally or 4 screws
          9. Clip the Arduino nano and NRF24L01 transceiver to the Wireless Servo Control Board
          10. Slide the BASE FRONT on to the BASE ELECTRONICS through the 2 square holes USB port facing back
          11. Secure in place with 2 SQUARE CLIPS
          12. Slide the BASE BACK on to the BASE ELECTRONICS through the 2 square holes USB port facing back
          13. Secure in place with 2 SQUARE CLIPS
          14. Secure the Magnetometer to the BASE FRONT with 2 screws
          15. Clip the Ultrasonic sensor on to the BASE FRONT
          16. Guide the servo cables towards the Wireless Servo Control Board as shown

          Step 3: Plugging in the Electronics

          All the connections are depicted in the Image above:

          1. Plug the 4 20cm dupont cables in to the wireless servo control boards Ultrasonic pins
          2. Plug the other end of the 4 cables in to the Ultrasonic sensor (Make sure they are the right way around)
          3. Plug the 4 10cm dupont cables in to the wireless servo control boards Magnetometer pins
          4. Plug the other end of the 4 cables in to the Magnetometer (Make sure they are the right way around)
          5. Plug all the servos in to their dedicated pins in the wireless servo control board
          6. Screw the battery VIN and GND wires to the wireless servo control board insure correct polarity

          Step 4: Assembling GorillaBot's Legs

          All the assembly steps are depicted in the assembly video above:

          1. Slide 1 FOOT over 1 CIRCULAR PIN L4
          2. Slide the thicker end of 1 CALF EXT over the CIRCULAR PIN L4 with the sticking out side facing away from the foot
          3. Slide 2 CALF INT over the CIRCULAR PIN L4
          4. Slide the thicker end of 1 CALF EXT over the CIRCULAR PIN L4 with the sticking out side facing towards the foot
          5. Slide 1 FOOT over the CIRCULAR PIN L4
          6. Secure in place with 3 CIRCULAR CLIPS
          7. Slide 1 CIRCULAR PIN L3 through 1 of the assembled CALF EXT
          8. Slide 1 THIGH SERVO over the CIRCULAR PIN L3 with the sticking out side facing towards the CALF EXT
          9. Slide 1 THIGH over the CIRCULAR PIN L3
          10. Slide the CIRCULAR PIN L3 through the other assembled CALF EXT
          11. Secure in place with 3 CIRCULAR CLIPS
          12. Slide 1 THIGH SERVO over 1 CIRCULAR PIN L2 with the sticking out side facing towards the CIRCULAR PIN L2's head
          13. Slide the CIRCULAR PIN L2 through both of the assembled CALF INTS
          14. Slide 1 THIGH through the CIRCULAR PIN L2
          15. Secure in place with 3 CIRCULAR CLIPS
          16. Repeat all processes for the remaining 3 legs bare in mind that when the legs are assembled to the robot the pins heads face outwards and the CALF EXTS are in front of the CALF INTS so assembly will be identical front to back but symmetrical from left to right.

          Step 5: Installing Arduino

          GorillaBot uses C++ programming in order to function. In order to upload programs to GorillaBot we will be using Arduino IDE along with a few other libraries that need to be installed in the Arduino IDE.

          • Install Arduino IDE on to your computer: Arduino IDE (link here)

          In order to install the libraries in to Arduino IDE you must do the following with all the libraries in the links below

          1. Click on the links below (this will take you to the libraries GitHub page)
          2. Click the green button that says Code
          3. Click download ZIP (the download should start in your web browser)
          4. Open the downloaded library folder
          5. Unzip the downloaded library folder
          6. Copy the unzipped library folder
          7. Paste the unzipped library folder in to the Arduino library folder (C:\Documents\Arduino\libraries)

          Libraries:

          And there we have it you should be all ready to go In order to make sure you have correctly set up Arduino IDE follow the following steps

          1. Download the desired Arduino Code below (GorillaBot Controller & Autonomous.ino)
          2. Open it in Arduino IDE
          3. Select Tools:
          4. Select Board:
          5. Select Arduino Nano
          6. Select Tools:
          7. Select Processor:
          8. Select ATmega328p or ATmega328p (old bootloader) depending on which Arduino nano you purchased
          9. Click the Verify button (Tick button) in the left upper corner of Arduino IDE

          If all goes well you should get a message at the bottom that says Done compiling.

          Step 6: Uploading the Code

          Now it's time to upload the code to GorillaBot's brain the Arduino Nano.

          1. Plug the Arduino Nano in to your computer via USB cable
          2. Click the upload button (Right arrow button)

          If all goes well you should get a message at the bottom that says Done Uploading.

          Step 7: Calibrating the Servos

          In order to assemble the legs correctly we must home the servos to their home position.

          1. Insert 2 Li-ion Batteries in to the battery holder
          2. Switch the robot on and wait 5 seconds for the servos to reach their home position
          3. Switch the robot off

          Step 8: Assembling Legs to Body

          Connecting the legs to the servos is pretty straightforward simply remember that the CALF EXT are to be placed in front of the CALF INT during assembly pin heads facing outwards.

          1. Slide the THIGH of the CALF EXT side of one of the legs over the CIRCULAR PIN L1 on the front front left servo holder
          2. Secure in place with 1 CIRCULAR CLIP
          3. Slide the THIGH SERVO of the CALF EXT side of the same leg over the servo head on the front front left servo holder (Make sure the THIGH SERVO is at a 90 degree angle to the body)
          4. Secure the THIGH SERVO in place at a 90 degree angle to the body with a single arm servo horn and small servo screw
          5. Repeat the same process for the front back left servo holder with the remaining THIGH and THIGH SERVO of that leg
          6. Repeat all previous processes for the remaining 3 legs

          Step 9: Ready to Race!!!

          So that's it you should be all ready to go!!!

          Manual mode:

          • Switch the robot and controller on and check that the robot walks properly by using the up down left and right directions of the Joystick.
          • Press the down button and the robot should perform a little dance

          If everything works well the servos are well calibrated and you can now try out autonomous mode.

          Autonomous mode

          Autonomous Sprint mode uses the Magnetometer to keep the robot running in a constant direction for 2.5 meters. You can program the desired position and desired angle of correction using the controller

          1. Switch the robot and controller on
          2. Move the robot in all directions to calibrate the Magnetometer for 5 seconds
          3. Place the robot on the ground in the desired position you would like him to go in
          4. Press the up button to memorise that heading
          5. Turn the robot 30-45 degrees to the left of desired heading
          6. Press the left button to memorise that position
          7. Turn the robot 30-45 degrees to the right of desired heading
          8. Press the right button to memorise that position
          9. Place the robot back in to its desired heading
          10. Press the joystick button to start the robot

          The robot will run in a constant direction for 2.5 meters then stop sit and do a victory dance.

          My robot managed to do the 2.5 meters in 7.5 seconds.

          Which gives me a theoretical time of 10 meters in 30 seconds which hopefully will be enough to give me a good time at the Toulouse Robot Race

          Wish me luck and for those of you who decide to build this robot I would love to hear your feedback and potential improvements that you think could be made!!!

          Robots Contest

          Runner Up in the
          Robots Contest

          3 People Made This Project!

          Recommendations

          • Colors of the Rainbow Contest

            Colors of the Rainbow Contest
          • Make it Real Student Design Challenge #3

            Make it Real Student Design Challenge #3
          • Toys & Games Contest

            Toys & Games Contest

          91 Comments

          0
          B4TheWord
          B4TheWord

          Question 4 months ago

          Hello Sebastian, First, thank you so much for taking the time to put together such a wonderful instructable. I'm curious, you mentioned that batteries ran dead pretty quick and overheated the circuit. Have you tried using the batteries in parallel or in series? I'm just trying to figure out if putting them in series would be a better way to go and then have a regulator to control the incoming amperage (while I'm still in the building phase)?

          0
          Sebastian Coddington
          Sebastian Coddington

          Answer 4 months ago

          Hey thanks! The batteries are 3.7V in series for a total of 7.4V they do last quite a good amount of time depending on if you get good quality 18650 batteries but yes the overheating is a problem, Im currently working on a new version with an arduino uno and 8A UBEC to solve this issue hopefully I'll publish the update soon

          0
          B4TheWord
          B4TheWord

          Reply 4 months ago

          Hmmm edit to my poste earlier today. The ultrasonic sensor seems to be eluding me. I installed a library (https://github.com/ErickSimoes/Ultrasonic) and setup the code in the GorrillaBot code, but I can't seem to get it to recognize the distance correctly. Sebastian, I'll send you a PM regarding this and show you the code I've got, just to see if you have any thoughts.

          0
          B4TheWord
          B4TheWord

          Reply 4 months ago

          Thank you for getting back to me. I actually ended up getting it working great. Also I found when I added in a power regulator (https://www.amazon.com/gp/product/B00LTSC564) and tweaked the output, I didn't have any problems with overheating. I think there was too much amperage being pushed through. But then, I don't know what the amps are on the batteries you were using are. I'm using 2- 3500mAh. Also looking at way to integrate an Adafruit 1000C (https://www.amazon.com/gp/product/B01BMRBTH2) to charge the batteries (although it will have to be done one at a time). 1 Quick question. Why the ultrasonic detector? I don't see anything in the program that uses it? I've actually altered my program so that it does have an autonomous mode (As I didn't build the controller). I'm working on adding in the ultrasonic code now - seems straight forward enough. I just was suprised there were no functions in there given that the Instructable had it.

          Photo Feb 02, 2 58 36 PM.jpgPhoto Feb 02, 2 58 45 PM.jpg
          0
          kjellgnilsson.kn
          kjellgnilsson.kn

          6 months ago on Step 9

          Hi again Sebastian,
          Many questions for you. Here is another one. When the servos has got to its homing start point, 0 or 180° according to your code at start up. Shold the legs be attached to the servos according to my attached picture in a horizontal position?
          Thanks,
          Kjell

          GorillaBot leg start pos.jpg
          0
          Sebastian Coddington
          Sebastian Coddington

          Reply 6 months ago

          Hi Kjell, sorry for late reply for some reason I only just got your message I hope you figured it out both legs need to be attached in the vertical position not horizontal I do hope you managed to get the robot up and running by now let me know how its going!

          0
          kjellgnilsson.kn
          kjellgnilsson.kn

          Reply 6 months ago

          Thanks for your reply. Yes now it's up and "running" but only in auto mode. The remote control works fine, all commands can be read i Serial Monitor. It's strutting around and dancing and take about 6 steps forward and than a victory dance and then repeat it all over again, don't respond to any command. I can see that the RX-TX led flashes when I turn on the remote.
          I can see on line in the Serial Monitor for the GorillaBot when I turn it on but no more code from the remote control.
          What's going on?
          Another issue, the US Sensor HC-SR04, what purpose does it have? I can't see any reference to it in the arduino code.
          Best regards, Kjell

          0
          Sebastian Coddington
          Sebastian Coddington

          Reply 6 months ago

          Hey, Oh dear I don't really know what could be causing that for that I would need to know what messages the gorillabot is receiving in the serial monitor it could be a dodgy connection on the controller side that constantly sends a down button signal in that case the robot would do exactly what your saying over and over again

          try deleting the actions that happen in this section of code

          // BUTTON DOWN
          if (buttonDown == 0)
          {
          delete all code here
          }

          if the robot doesnt do anything afterwards it would mean the controller is sending down command all the time which means either the controller shield is bad or the plastic cover of your controller is slightly pressing the down button all the time

          as for the ultrasonic your right it does nothing in the code I gave you I was planning on have it react to people waving in front of it but never got round to it

          hope this helps!

          0
          kjellgnilsson.kn
          kjellgnilsson.kn

          Reply 6 months ago

          Hi Sebastian,
          I'm glad today, I got him to work. There was nothing wrong with remote, all buttons worked perfect when I were looking at the serial monitor. The problem look to be the NRF24L01 Modules. The "L" led on the Nano was always on steady.
          When I removed the module he did the victory dance all the time. When the module was mounted he was like dead, just did go to the homing position and then just sit there. I study the NRF24L01 in more depth and found out that they were sensitive for external noise. I put a 47µF capacitor across the 3.3 VCC on the NRF24L01 module on both. That seem to be the trick, now he is working as advertised.
          I had to put a heat sink on the SunFounder Servo Shields LM2596 Power Regulator to make it not overcook, but no problem with the digital servo, no jitter. I also just added a simple voltmeter to keep track of battery health.
          Have you any plans for the Ultrasonic sensor HC-SR04 to be implemented in the code?
          Thanks for a very interesting project, Kjell
          Looking forward to the next update of of the GorillaBot
          P1190743.JPGP1190746.JPG
          0
          Sebastian Coddington
          Sebastian Coddington

          Reply 6 months ago

          glad to hear its working!!! yeah Gorillabot 2.0 will have a bigger power supply 8A a movable head and the ultrasonic sensor will be used for scanning it will also use bluetooth and a mobile app for control I don't know when I'll get round to it but hopefully soon!!!

          0
          kjellgnilsson.kn
          kjellgnilsson.kn

          Reply 6 months ago

          Hi Sebastian,
          I'm glad today, I got him to work. There was nothing wrong with remote, all buttons worked perfect when I were looking at the serial monitor. The problem look to be the NRF24L01 Modules. The "L" led on the Nano was always on steady.
          When I removed the module he did the victory dance all the time. When the module was mounted he was like dead, just did go to the homing position and then just sit there. I study the NRF24L01 in more depth and found out that they were sensitive for external noise. I put a 47µF capacitor across the 3.3 VCC on the NRF24L01 module on both. That seem to be the trick, now he is working as advertised.
          I had to put a heat sink on the SunFounder Servo Shields LM2596 Power Regulator to make it not overcook, but no problem with the digital servo, no jitter.
          Have you any plans for the Ultrasonic sensor HC-SR04 to be implemented in the code?
          Thanks for a very interesting project, Kjell
          Looking forward to the next update of of the GorillaBot

          0
          kjellgnilsson.kn
          kjellgnilsson.kn

          Reply 6 months ago

          Thanks for your reply. Yes now it's up and "running" but only in auto mode. The remote control works fine, all commands can be read i Serial Monitor. It's strutting around and dancing and take about 6 steps forward and than a victory dance and then repeat it all over again, don't respond to any command. I can see that the RX-TX led flashes when I turn on the remote.
          I can see on line in the Serial Monitor for the GorillaBot when I turn it on but no more code from the remote control.
          What's going on?
          Another issue, the US Sensor HC-SR04, what purpose does it have? I can't see any reference to it in the arduino code.
          Best regards, Kjell

          0
          davide.plavan
          davide.plavan

          Question 6 months ago

          Hi Sebastian, I built the GorillaBot and it's really interesting. I had two little issues: the servo bracket doesn't fit in the leg housing and in 2 cases the support for the servo broke apart a little when I put the screws. So my request is if you can provide the source CAD design of the parts in order to modify them a little and reprint. Thank you.

          0
          davide.plavan
          davide.plavan

          Reply 6 months ago

          Thank you Sebastian. Meanwhile my son managed to make it walking writing his own code! I will share a video.

          0
          Sebastian Coddington
          Sebastian Coddington

          Reply 6 months ago

          That's great it took me a long time to get the code right for walking well done!

          0
          kjellgnilsson.kn
          kjellgnilsson.kn

          Question 7 months ago on Introduction

          Hi Sebastion,
          I'm already done with my GorillaBot Robot. Unfortunately it's hard to get the Sunfounder Wireless Servo Control Board (in Sweden anyway). Do you have an electronic sketch (Fritz or similar) so I can make a circuit board to hook up the Nano, servos and other components? I'm an electronic engineer so it should not be any problem for me to design a circuit board.
          Thank's for an interesting project,
          Kjell Nilsson

          0
          davide.plavan
          davide.plavan

          Answer 6 months ago

          Hi Kjell, I built the GorillaBot connecting the Nano with the servo on a prototyping board. Just connect the output pins from Nano to the servo control pin and the VCC and GND pin of the servos to 5V and GND from battery. Of course, tie GND from battery and Nano together.
          Or you can use something like this:
          https://www.amazon.it/espansione-sensore-Modulo-Sh...

          0
          kjellgnilsson.kn
          kjellgnilsson.kn

          7 months ago

          Hi Sebastian,
          I struggle to get analog servos. It's a confusinng that they have the same name which doesn't say if they are analog or digital. I don't know what I will get if order a MG90S servo.
          When will your updated version with digital servos be available? Should I wait a while as the problem with analog servos excist for me.
          Thanks for your earlier answer,
          Kjell in Sweden

          0
          Sebastian Coddington
          Sebastian Coddington

          Reply 7 months ago

          Hey! usually the cheap Chinese mg90s servos that you find on Amazon and other known sites for about 4-5 euros a servo are always analog servos so you should be ok I don't know when I will publish the update but even if you end up with digital ones it should be fine even the analog ones overheat a little bit so until I change the board they are both not ideal