Introduction: Robot Cat
This instructables show somethings about building a robot cat.
M5Stack PSRAM Camera Module: https://m5stack.com/products/esp-32-camera-psram
Adafruit 16-Channel 12-bit PWM/Servo Driver: https://www.adafruit.com/product/815
13 of EMAX ES08MA II Servo: https://emaxmodel.com/es08ma-ii.html
8.4 v Lipo Charger: https://www.aliexpress.com/wholesale?SearchText=8....
DC regulator for System: https://www.aliexpress.com/item/4000016331112.html
DC regulator for Servo: https://www.aliexpress.com/item/32912982626.html
Grove to 4 pin Female Jumper Conversion Cable: https://www.seeedstudio.com/Grove-4-pin-Female-Jum...
Step 1: Why Build My Own Robot Cat?
Two years ago, I start saw many robot cats and dogs projects on the web. They works, walk well and can do some pose. The only shortcoming is it does not look like a cat or dog.
So I try to build my own robot cat. The main target are look like a cat, act like a cat.
Step 2: Bionics
In order to build a robot look like a cat, we need first study the cat skeleton.
Cat is a digitigrade, that means they stands or walks on its digits, or toes. So cat have noticeable 3 joints for the back legs while human(Plantigrade) only have 2 joints. For the cat front legs, the metacarpals is relatively too short. So it is noticeable 2 joints for the front legs. So the robot cat have 2 joints on the front legs and 3 joints on the back legs, i.e. 10 servos. (most other robot cats and dogs only have 2 joints for the back legs)
Head and neck should have many moving parts, turning, nodding and also ears, eyes and month motions; Tail motion is actual most difficult to imitate, it actually combined by tens of joints and muscles. In first phase, I would like concentrate on the 4 legs movement first. For simplicity, I just use 2 servos for turning and nodding the head and 1 servo to make some simple tail turning. Cat tail normally point to the ground, but I found a long tail pointing up make it look vitality, so it always tail up.
Step 3: 3D Printing
The robot cat 3D print prototype is already at the third iteration and may be more iteration later on.
Please download and print all the parts at thingiverse: https://www.thingiverse.com/thing:4164643
Step 4: Servo Driver Board
The first phase of robot cat reduced many moving parts, but it still requires 13 servos. In my previous experience, direct driver servos with MCU GPIO is not a good choice. The frequency signal may vary while MCU doing another job at the same time and the servo may become unstable or introduce unexpected behavior. Dedicate an individual driver board generate servo signal is much better.
PCA9685 driver board is a common solution, MCU simply use I2C interface communicate with the driver board and it can control 16 servos at the same time continuously.
Step 5: Robot Brain
Various MCU able to control a servo robot, here are some preference when I choose among them:
- built-in vision sensor for future development
- small enough to fit in the robot cat head
- wireless connective
- I2C interface to communicate with servo driver board
I have a M5Stack Camera Module in hand and it can fulfill all the above requirements.
Step 6: Measure & Adjust DC Regulators
Like most dev device, M5Stack Camera Module operate in 5 V.
Most tiny servo operate in 5-6 V and each servo normal operate can draw 200 mA and more, operate 13 servos at the same time are over 2.6 A. In order to avoid the robot brain affected by power shortage, it is better dedicate an individual DC regulator for the brain and servos.
The output voltage of both DC regulators in hand are adjustable, sticky remember adjust the output voltage to 5V and 6 V respectively before using it or the components may be burnt.
Step 7: Servo Tester
In my experience, servo is very easy to damage. It is better buy few more spares in same order. Before using it, you can use a servo tester to check it can works normal: http://media.nbcmontana.com/id/Servo-Tester-2/
Step 8: FSBrowserPlus
ESP32 have a bundled example called FSBrowser. It is a simple web server that host the web source files copied to SPIFFS, it have a simple web editor for amend the source over WiFi and also it have a simple API to read the GPIO values.
I have enhanced this example to FSBrowserPlus:
- Added PCA9685 Servo Board API
- Added a WebSocket server
- Added Robot Cat Pose Design web page
Step 9: Program
Download and install Arduino IDE if you are not yet do it:
Follow the Installation Instructions to add ESP32 support if you are not yet do it:
Arduino ESP32 filesystem uploader
Follow the installation steps to install Arduino ESP32 filesystem uploader if you are not yet do it:
Download FSBrowserPlus: (press "Clone or Download" -> "Download ZIP")
ESP Async Web Server Library
Download latest ESPAsyncWebServer libraries: (press "Clone or Download" -> "Download ZIP")
Import libraries in Arduino IDE. (Arduino IDE "Sketch" Menu -> "Include Library" -> "Add .ZIP Library" -> select downloaded ZIP file)
Compile & Upload
- Connect the M5Stack Camera Module with USB cable
- Open Arduino IDE
- Open FSBrowserPlus
- Edit the ssid and password to your own WiFi AP credential
- Press Arduino IDE "Upload" button
- Select "Tools" menu -> ESP32 Sketch Data Upload
Step 10: Install Power Circuit
Here are the power connect summary:
Lipo Battery plug +ve pin -> 5V DC regulator INPUT +ve pin 6V DC regulator INPUT +ve pin -ve pin -> 5V DC regulator INPUT -ve pin 6V DC regulator INPUT -ve pin PCA9685 Servo Driver Board GND pin -> 5V DC regulator OUTPUT -ve pin 6V DC regulator OUTPUT -ve pin Grove cable black pin SCL pin -> Grove cable yellow pin SDA pin -> Grove cable white pin VCC pin -> 5V DC regulator OUTPUT +ve pin Grove cable red pin V+ pin -> 6V DC regulator OUTPUT +ve pin
Use M2 screws and double adhesive tape to fix all boards under the robot cat body.
Step 11: Servo Position & Connection
The FSBrowserPlus program have a servo initial process, it will set all the servos to the middle position of the turning range. Before install the servos, it is better connect the servos to the driver board, connect the grove connector to the M5Stack Camera Module and plug in the battery to reset all the servo position to the middle.
Here are the servo connection list:
Port 0: Left Front Leg Joint 1 Port 1: Left Front Leg Joint 2 Port 2: Left Back Leg Joint 1 Port 3: Left Back Leg Joint 2 Port 4: Left Back Leg Joint 3 Port 5: Head Turn Port 6: Head Nod Port 7: Not connected Port 8: Not connected Port 9: Not connected Port 10: Tail Port 11: Right Back Leg Joint 3 Port 12: Right Back Leg Joint 2 Port 13: Right Back Leg Joint 1 Port 14: Right Front Leg Joint 2 Port 15: Right Front Leg Joint 1
Step 12: Paw Friction & Protection
3D printed paws are easy to worn out and not enough friction to the ground. Simply add some rubber band on it can fix these problems.
Step 13: Install Joint
Use a 6 mm M3 screw to connect the joint. Insert a nylon or PET ring in the middle can reduce the friction.
Step 14: Install Servo
There are few type of nylon arm included in the servo package. Insert the shortest nylon arm to the servo, except head turn require a cross arm.
- insert the servo into the joint start from the arm side
- push the other side in carefully
- plug in the battery to ensure the servo position is in the middle of the turning range
- unplug the battery
- screw up 2 screws on both side
- screw up the black screw together with the joint
Repeat Install Joint and servo steps for all 10 leg joints.
Step 15: Install Head & Tail
The head turn servo can install from the upper side or lower side depends on you would like to have a longer or shorter neck.
The head nod servo install method is the same as the leg joint.
Then you can install the M5Stack Camera Module with two 12 mm M4 screws
The tail servo must install from the lower side and then you can use a 8 mm M2 screw to fix the tail.
Step 16: Fix Battery
Fix the Battery on the Robot Cat back with some double adhesive tape.
Step 17: Tidy Up Wires
There are a hole near the head, the battery, Grove and head nod servo wires can pass though this hole to the power or servo board.
There are reserved some rooms between front legs and the servo board, all wires can tidy up to this area.
Step 18: Robot Cat Pose Design
- plug in the battery to power on the robot cat
- browse to http://fsbrowserplus.local/pose.htm
- adjust the slider for each joint
- robot cat will have real time response
- servos continuous draw the power for keeping the pose, you may press the Rest button to let the robot cat take a rest
Step 19: Gallery
Step 20: What's Next?
This project is started over 2 years, but it still at the beginning. Much more I want to do...
The first phase of hardware just start to work, it's time to work with software part:
Simply edit the HTML and Javscript:
- add a pose sequence design web page, combine a number of pose in sequence to make some motion
And more for modifying the Arduino program:
- store motion sequence data to flash
- vision sensor, add some AI factor to make environment interaction
- web remote control interface with camera image stream
- reduce weight
- better weight balance design especially when only 2 legs touch the ground
- add foot touch sensor to ensure touched the ground
- add balance sensor to avoid unexpected falling (cat should have good balance)
- add microphone for listening and even response from speech recognition
- more head and tail joints for more motions
- add speaker for MEOW!
Follow my twitter for the latest news: https://twitter.com/moononournation
Second Prize in the