Introduction: Spherical Quadruped Arduino Robot

Welcome,

Two years ago, by curiosity, I ordered an Arduino starter kit without background on electronics and code. I do not know what happened to me...

I battled during the first two weeks to simply blink a led....

Weeks and months later, projects after projects, the pleasure to play with Arduino did not fade away, quite the contrary.

I made tangible progress using internet publications, now it is time for me to share my own experience.

I am pleased to present my first Instructable.

The present Instructable describes a spherical quadruped robot. The base of the robot is a quadruped platform with two articulations by leg and all integrated into a spherical frame. On standby mode, the robot looks like a sphere and transforms itself into quadruped to move. An ultrasonic sensor is used to avoid clash during motion.

  • Weight : 440 g
  • Dimensions : Ø 130 mm / 5.12 in
  • Running Time (battery life) : 15 Min
  • Programming Language : Arduino C/C++

Step 1: Parts List

Electronics :

  • 1 x Arduino Nano
  • 1 x Servo Driver : Adafruit 16-Channel 12-bit PWM
  • 10 x Right Angle Male Header
  • 10 x Servomotor : MS-12016
  • 1 x NIMH battery pack : 4.8v - 1800 mAh
  • 1 x Ultrasonic sensor : SRF05
  • 4 x NeoPixel : Adafruit breadboard-friendly RGB Smart NeoPixel
  • 1x 470 ohm resistor (for NeoPixel)

Mechanical Parts :

  • 18 x Self-tapping Phillips screw : Ø1x6 - (Servo Arm vs Structure Parts)
  • 10 x Standard screw (Servo Arm vs Servomotor)
  • 17 x Self-tapping Phillips screw : Ø1.6x6 - (Structures fixation)
  • 2 x Self-tapping Phillips screw : Ø2x8 - (Ultrasonic Sensor fixation)
  • 20 x Head screw DIN 84 : Ø2x10 - (Servomotors fixation)
  • 5 x Self-tapping Philips screw : Ø2x8 - (Electronic boards fixation)
  • 4 x Anti-slip pad
  • 4 x Cable clamp

3D Model :

All the structural parts were designed for 3D printing.

Download the files from Thingiverse

Step 2: Doors

Presentation :

The doors hide the legs when in retracted position as well as the free space area for the legs motion. So when the robot is in standby mode with the doors closed, it looks like a sphere.

Description :

All the doors are piloted by one servomotor placed in a central position. The doors are actuated by means of an extension cross. The doors are guided with two pins engaged in rails on the body. The rails impose a double motion to the door, one for retracting inside the body and a second one for turning it.

The servomotor speed is too fast leading to sudden movement, the speed is reduced by means of loop with delays on the code.

Step 3: Legs

Presentation :

Obviously the legs are used for walking but they must also permit to raise & lower the robot.

The legs must be invisible in standby mode.

Description :

  • Design

There are several possible concepts for the legs. Due to little space available in the retracted area (Inside the body) the solution with 2 servomotors by leg was preferred. One for the forward & backward motions and one for the up & down motions.

To compensate for the missing third servomotor (the “classic” quadruped has three servo per leg, Hip, Knee, Ankle) and to ensure the lifting motion of the robot without legs sliding, a parallelogram kinematic motion was added to the up & down servomotors i.e. two functionalities with one servomotor, the up & down motion and the legs parallelism.

In order to optimize the space, the tibia structure is part of the head shape in a retracted position.

  • Electronic

Two servomotors per leg and 4 legs mean 8 servomotors, plus one for the head and one for the doors = 10 servomotors. To minimize the number of Arduino board pins used & cables, the servomotors are controlled by a servo driver with I2c interface i.e. only two pins used.

Tutorial on the Adafruit Servo Driver

  • Walk

There are several walking patterns, one leg after another, two opposite legs at the same time, four legs at the same time and several parameters like the motion amplitude & the movement speed. Conclusion : many possibilities.

This Instructable describes only one solution (it is up to you to explore others), two opposite legs at the same time. The walking diagram can be seen below.

The legs motion are not complex, there are no transformation matrices. Constant variables impose the position of each servomotors.

Special attention must be paid to the legs sliding effect, good friction between the legs and the ground is essential to ensure regular walking. To minimize this phenomenon some anti-slip pads were added on legs bases.

Step 4: Head

Presentation :

The head supports the ultrasonic sensor and allows its rotation in order to enlarge the inspection zone.

The head is also the robot lid. The head is easily removable and gives access to the electronics, Arduino connections & battery recharging.

Description :

The shape of the servo arm is replicated on the head, so it is simply embedded on it with a minimum gap. The head turns at the same time as the servomotor. Just lift it to give access to the electronics.

The ultrasonic sensor is connected by means of JR connectors to the Arduino board to ease the dismantling.

Again, to avoid a sudden movement of the servomotor, a delay loop is added in the code to slow down the rotation.

Step 5: Lights

Presentation :

That clearly is not an essential functionality so this is why it is indispensable. Lights simply mean more fun.

Description :

4 RGB leds are equally spaced all around the body. The lights are visible between the gap of the bottom fixed part and the top rotating part (head). The RGB leds allow to create some light animations by color changing or blinking during the robot events.

Tutorial on the Adafruit NeoPixels

Step 6: Ultrasonic Sensor

Presentation :

The ultrasonic sensor is used to check if there is an obstacle in front of the robot and to avoid it.

The sensor is also used as a switch to start and stop the robot.

Description :

  • Obstacle Detection

The sensor emits an ultrasound which travels through the air and bounces back to the sensor if the signal meets an obstacle. The sensor provides the travel time of the signal. With the signal speed (know value) it is possible to calculate the distance to the obstacle.

If an obstacle is detected, the robot stops, turns its head to right side to measure the free distance and repeats the measurement on the left side. The robot rotates towards the side with the greatest free distance.

You can find on the diagram below the robot legs strategy for the rotation, again it is only one possibility among many others.

This Instructable does not detail the ultrasonic sensor operation, there are already so many details on the internet.

Tutorial on SRF05 Ultrasonic sensor

  • Switch

To keep a spherical aspect, there is no physical switch on the robot, so the ultrasonic sensor is used as such. If an obstacle is detected very close in front of the sensor, the robot will start or stop.

The ultrasonic sensor does not switch off electrically the robot. To shut off the power you need to lift up the lid (Head) and disconnect the battery.

Step 7: Assembling

Nothing complicated, no traps. The pictures speak for themselves.

Minor comments :

  • Do not forget to give some slack to the leg servomotor cables, the servomotors must be free to move. Same for the ultrasonic sensor cables.
  • Some cable clamps were added to ensure that all the cables are locked on the central structure of the robot and do not disturb the motions.
  • Right Angle Male Headers are used with the servo motor driver board. There is not enough space available vertically so the connections are oriented horizontally.

  • For the legs articulations, the functional gaps are 0.1mm axially & 0.1mm radially. You could obtain these values directly with the FDM 3D printers. You may need to update them depending on your own 3D printer performance/accuracy.

  • The structural parts were assembled together by means of self-tapping screws.

Step 8: Wiring

The servo driver board I2C interface impose to connect the SDA & SCL ports to A4 & A5 pins on Arduino Nano. No more constraints.

Otherwise, follow the lines.

Step 9: Source Code

The code is structured as a state machine.

The servomotors are piloted with constant variables. All these variables are in the global.h file which must be placed in the same folder as the Spherical Quadruped Robot.ino file.

All the servomotors must be calibrated and the displacement/rotation values must be redefined according to your settings.

Step 10: Conclusion

At project end, there are always some satisfying things and some things that could have been done differently. Assessing the pros and cons or the project success is not relevant. The aim is to enjoy yourself while doing it.

I truly hope this Instructable will inspire you & give you the desire to be creative.

Special thanks to the French Arduino community, the French Arduino blog from Eskimon & the Instructable publications.

Do not hesitate to contact me if you have any questions.

ENJOY !

First Time Author Contest

First Prize in the
First Time Author Contest