Preface About SunFounder SunFounder is a technology company focused on Raspberry Pi and Arduino open source community development. Committed to the promotion of open source culture, we strive to bring the fun of electronics making to people all around the world and enable everyone to be a maker. Our products include learning kits, development boards, robots, sensor modules and development tools. In addition to high quality products, SunFounder also offers video tutorials to help you build your own project.
Contents Components List ..................................................................................................................................................... 3 Acrylic Plates ............................................................................................................................ 3 Calibration Chart ..................................................................................................................... 4 Threaded Fasteners ...................................
Battery Holder ........................................................................................................................ 40 SunFounder Servo Control Board ......................................................................................... 41 Lower Plate............................................................................................................................. 42 Servo Wiring ................................................................................................
Components List Su nF o un d er Acrylic Plates 3
Su nF o un d er Calibration Chart 4
Threaded Fasteners Name Quantity M1.
Electronic Accessories Name Quantity nRF24l01 Module 2 er Accessory 2 Su nF o un d SunFounder Nano Board SunFounder Mobile Robot Remote Controller 1 SunFounder Servo Control Board 1 6
2 SunFounder Micro servo 12 un d er 2x18650 Battery Holder Su nF o USB Data Cable 1 Wire Harness Tube (80cm) 1 Ribbon (50cm) (Divided into four equal parts) 1 Calibration Chart 1 Name Quantity Tools Accessory 7
Screwdriver 1 Self-provided Components The following components are not included in this kit. Accessory Name Quantity 18650 Rechargeable Li-ion Battery (3.7V) 4 Note: You are recommend to use 18650 batteries without a protective board. Otherwise, the er 1. car may be cut power and stop running because of the overcurrent protection of the 2. un d protective board.
1. Introduction The SunFounder Crawling Quadruped Robot kit is a great learning tool for Arduino and robotics enthusiasts. With the knowledge in mechanic structure and electronic design, you can take it as a functional stepping stone into the amazing coding world! This interesting "creature" is a four-leg mobile robot, and each leg has three joints driven by a servo. It is powered by two 18650 rechargeable Li-ion batteries, compatible with Arduino Nano V4.
2. Getting Started Note: Before starting your own project, you must download the file Quadruped Crawling Robot Kit V2.0 for Arduino.zip on our official website by visiting LEARN -> Get Tutorials -> Quadruped Crawling Robot Kit V2.0 for Arduino and unzip it. Arduino Description Arduino is an open source platform that applies simple software and hardware. You can get it in a short even when you know little of it.
list on the right side under Download the Arduino Software. un d er Note: the IDE version shown in the figure is Arduino 1.8.1, which may not be the latest version now. Please go to the Arduino page to get the latest IDE. Su nF o Find the one that suits your operation system and click to download. There are two versions of Arduino for Windows: Installer or ZIP file. You're recommended to download the former. Just download the package, and run the executable file to start installation.
Add Libraries 1. Libraries are a collection of code that makes it easy for you to connect to a sensor, display, module, etc. In this kit, you will need to add two libraries to the Arduino libraries folder: FlexiTimer2 and RF24. un d er 1) Select Sketch -> Import Library -> Add Library. 2) Find the FlexiTimer2.zip library under the Quadruped Crawling Robot Kit V2.0 for Su nF o Arduino\libraries. Click Open.
un d er 3) Import the RF24.zip library from the libraries folder in the same way. 4) Here you should see the library added to your libraries. Click Sketch-> Include Library and Su nF o the libraries just imported now appears on the list.
Servo Description Servo is a set of automatic control system composed of DC motors, reduction gear set, sensors and control circuits. The output shaft can be rotated to a certain angle by sending signals. The servo can only rotate in a certain range, for example, 180°. It cannot rotate any circles like the DC motor. The servo enables you to easily rotate an object in a certain angle, so it is widely used in model planes and robot joints.
name of the pins and the color of the wires are marked on two sides of all the pins. Su nF o un d er Connect to the red wire of the battery holder to “+” of the power switch, the black wire to the “-”. Pay attention not to connect them inversely; otherwise it may cause a short circuit and burn the board. Do not mount the battery inversely. Servo “+” and “-” are Brown to GND marked inside the Red to VCC Power Switch battery holder.
4) Open the Arduino Software (IDE), Select File->Open. On the pop-up window, go to the Quadruped Crawling Robot Kit V2.0 for Arduino\code\1.Servo\Servo directory and find Servo.ino. Click it to open. Su nF o un d er 5) Select a board. Here we select Arduino Nano. 6) Go to Tools -> Serial Port to select the port. Your serial port may be different from what's shown here (right-click My Computer on desktop, click Properties>Device Manager>Ports).
7) Click the following button to upload. 8) Wait for a moment until the following information appears at the bottom of the window, un d er which indicates it is uploaded successfully. Su nF o 9) Remove the USB cable, switch on the power. Now, the rocker arm will sway continuously. So the servo test is done. Test all the 12 servos in the same way if necessary. If you find some jitters at 0 degree of a few servos, it's fine. The point here is to check whether the servo can work.
nRF24l01 Description The nRF24L01 is a single-chip wireless transceiver chip, which is manufactured by NORDIC and works in the 2.4 GHz ~ 2.5 GHz ISM frequency band. The wireless transceiver includes frequency generator, enhanced ShockBurst mode controller, power amplifier, crystal oscillator, modulator and demodulator. nRF24l01 Test er 1. Cross the ribbon through the following acrylic plate. The ribbon enables you to easily remove the battery. Also you can skip this step.
Su nF o un d er 3. Connect the following components with two M3*18 countersunk screws and two M3 nuts.
4. Plug SunFounder Nano board and nRF24l01 module into the SunFounder Mobile Robot un d er Remote Controller board. 5. Connect the remote controller with the battery holder. Make sure the power source is Su nF o wired correctly and the power is kept off. 6. Mount two 18650 batteries (please pay attention not to mount it inversely). Check to see whether the battery holder and the battery are wired correctly.
7. Connect the SunFounder Mobile Robot Remote Controller to PC with a USB cable. If everything looks good, switch it on. Then the blue LED on SunFounder Nano board will light up. 8. Upload the Transmit.ino under Quadruped Crawling Robot Kit V2.0 for Arduino\code\2.nrf24l01\Transmit directory for the SunFounder Mobile Robot Remote Controller according to the method in the previous section. Then Remove the USB cable after upload, and keep the power on. 9.
3. Assembly Upper Plate + Rocker Arm un d er 1. Assemble the rocker arm (packaged with the servo) of the servo to the following acrylic plate. Su nF o 2. Fasten the rocker arm to the acrylic 3. Connect the two components with an plate. M1.4*6 self-tapping screw. 4. Tighten the screw. 5. Tighten the other 7 screws.
Su nF o un d er 6. Assemble the other 3 rocker arms.
Thigh + Rocker Arm Su nF o un d er In the same way, connect the rocker arms and the thighs with M1.4*6 self-tapping screws.
Crus + Servo 3. Connect these two components with an M2*10 screw and an M2 nut. Su nF o 2. Fasten the servo to the crus. un d er 1. Assemble the servo to the crus. Pay attention to the direction of servo wires. 4. Tighten the screw. 5. Tighten the other screw and nut.
Su nF o un d er 6. Assemble the other 3 servos. Please pay attention to the direction.
Thigh Joint 1 + Servo un d er 1. Assemble the servo to the following thigh joint 1(the one next to the thigh). 3. Connect the two components with an M2*10 screw and an M2 nut. Su nF o 2. Fasten the servo to the thigh joint 1. 4. Tighten the screw. 5. Tighten the other screw and nut.
Su nF o un d er 6. Assemble the other 3 joints. Please pay attention to the direction.
Thigh Joint 2 + Servo un d er 1. Assemble the servo to the following thigh joint 2 (the one close to the upper body plate). Su nF o 2. Fasten the servo to the thigh joint. 3. Connect the two components with an M2*10 screw and an M2 nut. 4. Tighten the screw. 5. Tighten the other screw and nut.
Su nF o un d er 6. Assemble the other 3 servos. Please pay attention to the direction.
Thigh Joint 1 + Thigh Joint 2 3. Fasten with an M3*12 screw and M3 nut (for ease, put the nut into the hole first, then the screw into the other from top). Su nF o un d er 1. Assemble the following two joints. 2. Stick one into the other tightly. 4. Tighten the screw.
5. Assemble the other 3 pairs similarly. Please pay attention to the direction.
Uploading Assembly Program er Open Arduino IDE, and then select File -> Preferences. Su nF o un d On the pop-up window, tick the checkbox Display line numbers. Go to Crawler.ino under Quadruped Arduino\code\3.Crawl\Crawler directory. Crawling Robot Kit V2.0 for Modify code Lines 32-34 as follows (uncomment the line 32 #define INSTALL), compile and upload the sketch to the SunFounder Servo Control Board, and then remove the USB cable.
34 er un d Su nF o
er un d Upper Plate + Thigh Joint Note: Through the assembly below, please keep the power ON and the servos CONNECTED Su nF o 1. Connect the servo rocker arm and the servo 2. Tighten the screws. Pay attention with servo screws. that in the whole course of the (Packaged with the servo, the servo screw is subsequent assembly, the shaft of the shortest one among the three.) the unconnected servos should be The directions of all components must be outward. exactly the same with the following picture: 3.
some slight deviations, that’s OK. er Thigh Joint + Thigh Su nF o un d 1. Connect the servo rocker arm of thighs and the servo of the joints with servo screws. (Packaged with the servo, the servo screws are within the smaller two of five screws.
er 2. Tighten the screws. Su nF o un d 3. After connection, the front view is as follows. Please pay attention to the direction of these components, it should be horizontal. Try your best to make it close to the following picture, but if there is some deviation, that’s OK.
Thigh + Crus er 1. Connect the servo rocker arm of thighs and the servo of crura with servo screws. (Packaged with the servo, the servo screws are within the smaller two of five screws.) The directions of all components must be exactly the same with the following picture: Su nF o un d 2. Tighten the screws. 3. After connection, the front view is as follows. Please pay attention to the direction of these components, it should be vertical.
Upper Plate + Copper Standoffs Su nF o un d er Fasten the M3*36 copper standoffs, M3*8 copper standoffs and M3*8 screws into the following plate. It is shown as follows after connection.
Battery Holder Su nF o un d er Cross the ribbon through the plate, and connect the following components with the M3*12 countersunk screws and M3 nuts. It is shown as follows after connection.
SunFounder Servo Control Board Su nF o un d er Connect the SunFounder Servo Control Board to the following plate with M3*6 screws. It is shown as follows after connection.
Lower Plate Su nF o un d er 1. Keep the power off and connect the battery holder. Pay attention not to connect the power inversely. 2. Mount the batteries to the lower plate. Fix the lower plate with M3*8 Screws.
Servo Wiring Wire the servos to the SunFounder Servo Control Board according to the following servo number.
Su nF o un d er Organize the wires of the servo with wire harness tube. Now the crawling quadruped robot has been fully assembled.
4. Calibrating During the installation, errors may happen to mechanical connection. So you need to calibrate the robot to make sure the accuracy. Uploading Code for Calibration Open Crawler.ino under Quadruped Arduino\code\3.Crawl\Crawler directory Crawling Robot Kit V2.0 for un d er Modify Lines 32-34 as follows (uncomment the Line 33 #define ADJUST), compile the code, upload it to the SunFounder Servo Control Board, and then remove the USB cable. Switch on SunFounder Servo Control Board.
a. Place the robot on the Calibration Chart as shown in the following picture. Measure the coordinates (x, y, z) of leg 1 with a ruler. Here it is (93, 80, 45). Su nF o un d er Please pay attention to the direction of the robot and refer to the orange arrow below. b. Measure the coordinate (x, y, z) of leg 2. Here it is (100, 82, 48).
c. Rotate the robot as shown in the following figure, and measure the coordinates (x, y, z) of leg 3. Here it is (95, 90,41). Su nF o un d er Please pay attention to the direction of the robot and refer to the orange arrow below. d. Measure the coordinate (x, y, z) of leg 4. Here it is (82, 90, 45).
45), as shown below: Fill in the values according to your actual measurements to calibrate the robot correctly. Uploading Code for Verification Su nF o un d er Modify Lines 32-34 as follows (uncomment the Line 34 #define VERIFY), compile and upload the sketch to the SunFounder Servo Control Board, and then remove the USB cable. Switch on SunFounder Servo Control Board. At this point, the crawling robot will keep the verification poses.
5. Movement Crawling Uploading Code for SunFounder Mobile Robot Remote Controller Open Remoter.ino under the Quadruped Crawling Arduino\code\3.Crawl\Remoter directory. Robot Kit V2.0 for Compile the code, upload it to SunFounder Mobile Robot Remote Controller, and then remove the USB cable. Switch on the remote controller. Uploading Code for SunFounder Servo Control Board Open Crawler.ino under the Quadruped Arduino\code\3.Crawl\Crawler directory. Crawling Robot Kit V2.
Compile the code, upload the code to SunFounder Servo Control Board, and then remove the USB cable. Switch on SunFounder Servo Control Board. The robot will dance for a while. er When the robot stops, switch on SunFounder Mobile Robot Remote Controller. Now, you can use it to make the robot dancing. Overview un d 6. Code Explanation For the quadruped, you can not only learn things about robotics and electrics, but also the Su nF o code that animates the robot.
- mathematical model 2/2 * ---------------------------------------------------------------------------*/ void cartesian_to_polar(volatile float &alpha, volatile float &beta, volatile float &gamma, volatile float x, volatile float y, volatile float z) { //calculate w-z degree float v, w; w = (x >= 0 ? 1 : -1)*(sqrt(pow(x, 2) + pow(y, 2))); v = w - length_c; alpha = atan2(z, v) + acos((pow(length_a, 2) - pow(length_b, 2) + pow(v, 2) + pow(z, 2)) / 2 / length_a / sqrt(pow(v, 2) + pow(z, 2))); beta = acos((pow(
∠2=arc cos a2 +(z2 +v2 )−𝑏 2 2∗𝑎∗√z+v2 . ∴ ∠α=∠1+∠2=arc tan(z/v)+ arc cos a2 +(z2 +v2 )−𝑏 2 2∗𝑎∗√z+v2 . The program should be: alpha = atan2(z, v) + acos((pow(length_a, 2) - pow(length_b, 2) + pow(v, 2) + pow(z, 2)) / 2 / length_a / sqrt(pow(v, 2) + pow(z, 2))); Similarly, ∠β= arc cos 2 2 𝑎2+𝑏 −(𝑧 +𝑣2) . 2∗𝑎∗𝑏 The program should be: beta = acos((pow(length_a, 2) + pow(length_b, 2) - pow(v, 2) - pow(z, 2)) / 2 / length_a / length_b); Similarly, ∠γ=arc tan (y/x).
{ servo[i][j].attach(servo_pin[i][j]); delay(100); } } while (1); Here set the shaft of the each servo in the center position so as to minimize the error during the installation. After servos are installed, run the calibration program to check whether all the servo are in the center position.
7. Afterword So, you have the SunFounder crawling quadruped robot totally completed! You can start your journey now and have lots of fun with the bot. Show it to your friends and share with them your joy! You may have encountered with assembly or code issues during the course. Though we have improved this manual and avoided some mistakes, it can still be unsatisfactory.
Copyright Notice All contents including but not limited to texts, images, and code in this manual are owned by the SunFounder Company. You should only use it for personal study, investigation, enjoyment, or other non-commercial or nonprofit purposes, under the related regulations and copyrights laws, without infringing the legal rights of the author and relevant right holders.