RS032 Playful Puppy Instruction Manual Copyright C 2013 by DAGU Hi-tech Electronic Co., Ltd. All rights reserved. No portion of this instruction sheet or any artwork contained herein may be reproduced in any shape or form without the express written consent of DAGU Hi-tech Electronic Co., Ltd. The manufacturer and distributor cannot be held responsible for any damages occurred by mishandling, mounting mistakes or misuse due to non-respect of the instructions contained in this manual.
Contents Product description 3 Warnings 3 Required tools 3 Parts list 4 Assembly instructions 5 Wiring Instructions 9 Installing the Software 11 Controlling the robot 13 Understanding the code 14 Uploading via the ISP socket 22 Burning the bootloader 24 Trouble Shooting 25 Controller specifications 26 2
Product Description Thank you for selecting the Playful Puppy for your next do-it-your-self project. This kit allows you to build and program a small quadruped robot that can track moving objects and respond to your hand movements. Product Features 1. Arduino compatible robot controller with USB interface. 2. Laser cut, transparent acrylic base plate. 3. 10x 9g miniature servos. 4. 1x pan tilt assembly with magnetic servo clutches.
Parts List: 1 3 2 9g geared motor 10pcs Base plate 1pc 7 6 Clutch-drop shape 1pc Leg segment 8pcs 11 Pan-tilt bracket-1 1pc M2*6 self-tapping screw with flange 16pcs 21 M2*6 self-tapping screw 12pcs M2*8 self-tapping screw with flange 4pcs 23 IR compound eye 1pc 28 L30 brass spacer 4pcs 31 Mini Driver board 1pc M2.3*12 self-tapping screw 2pcs 4 M2.
Assembly Instructions: Step 1: Before you begin assembly set all your servos to center position as shown. Servo output shaft 14 Servo stop shown in center position 2 7 x4 Step 2: 17 7 18 4 attach legs so knee bent at 90˚. x4 Step 3: 14 Please note that servo mounts differently for left and right legs. 14 2 2 Use the ruler to check the length of your screws and spacers.
Step 4: Step 5: 16 17 1 3 Step 6: 20 Note position of hip servos and mount legs at 90˚ to body. Step 7: 21 10 2 12 34 19 15 25 30 x2 5 30 x2 23 5 34 Install 8x Magnets in both clutch pieces so the poles alternate as shown. Pay careful attention to which bracket you use. The hole patterns are different to suit various sensors. 6 Make sure the servo bracket is mounted on the correct side.
Step 8: 25 24 (2pcs) 11 25(2pcs) 22 15 19 2 6 30 x2 5 Step 9: 9 Step 10: 0 inch 10mm 20mm 13 23 21 0mm Install 8x magnets in both clutch pieces so the poles alternate as shown.
Step 11: Step 12: 21 32 27 33 28 23 Remove protective paper from adhesive strips and mount battery holder with velcro.
Wiring the robot: Start by plugging the rainbow cable into the eye. Pay careful attention to the colours to ensure correct function of the eye. Thread the cable under the tilt servo an use a cable tie to hold it in place. Leave this cable tie very loose so that the cable can move a bit if necessary. Red wire connects to Vcc Please note that the brown wire has been swapped to the other side Loose cable tie The Mini Driver includes a dual motor driver that is not used for this robot.
In this robot, A0 and A1 are being used as digital outputs instead of analog inputs to drive the pan and tilt servos. These servos are getting power through the 5V regulator so they cannot be heavily loaded. Connect the "tilt" servo to A1 as shown in the first photo. Make sure the brown ground wire is closest to the outer edge of the PCB. Next connect the "pan" servo to A0 as shown in the second photo. Tilt servo Pan servo Loosely cable tie the front knee and hip servos as shown.
Installing the software: The CD includes a copy of all third party software required for those without internet access. It is recommended that you check the internet for the latest versions. To install the sample code you must first have the Arduino IDE version 1.03 or later running on your computer. The Arduino IDE can be downloaded for free from here: http://arduino.cc/en/Main/Software. The Arduino IDE is available for Windows, Mac and Linux platforms.
Installing the software ( cont.): Before you plug the robot into the computer make sure you have 4x freshly charged AAA NiMh batteries installed and the power connector plugged in the correct way. Turn off the robot while uploading the new program to stop the robot from trying to move. The processor and head servos will be powered from the USB port but the leg servos will not have power.
Controlling the robot: Using the sample code provided, the puppy responds to movement. When your hand or any object is in range (within 15cm - 20cm) of the puppy's compound eye the puppy will track the movement of your hand with it's head. When standing the puppy will follow your hand and if necessary, will turn to try and keep your hand in front of it. If your hand gets too close the robot will back up. If your hand is too far away (but still in range) then the robot will walk forward.
Understanding the Code: Although you can play with the robot using just the sample code provided, the real fun is in teaching it new tricks! This section explains some of the basic features of the code and how they can be changed. Do not be afraid to experiment, you can always restore the original code if you make a mistake. Below is a flowchart of the sample code. A flow chart is not actual code, it is more like a map showing blocks of code and the different paths the processor can follow within your code.
Understanding the code (cont.) If you are new to Arduino then a guide to all the main commands and functions can be found by going to help and selecting reference. The first tab is the main program. In the beginning the library and definitions are added. Then global variables and servos are defined. The setup() function runs only once when the program first runs. This is where the servos are attached to their digital pins and initialized to their center positions.
Understanding the code (cont.) The second tab is [Constants.h]. This tab contains definitions for constant values that do not change when the program is running. In this tab we can set the center position of each servo and experiment with some other values that affect the way the robot walks and tracks movement. Normally the servos should be centered at 1500. If they need a big adjustment you should re-seat the servo horn. For fine adjustment (+/- 200) you can change the center values in this tab.
Understanding the code (cont.) The [IOpins.h] tab is your programs wiring diagram. If you want to change which pins are used for a servo or sensor then that change must be reflected here. If you need to replace a servo or even if you are wiring up the robot for the first time then this tab is your guide as to what device connects to which pin. The [IReye] tab is where the data from the eye is generated. This code first takes a reading of all sensors with the IR LEDs turned ON.
Understanding the code (cont.) The tab [IRtrack] is where the data from the compound eye is used to control the pan and tilt servos. If there are no objects nearby then the head will slowly return to center position. Basically the code adjust the pan servo to keep the left and right IR values equal. The tilt servo is adjusted to keep the upper and lower IR values equal. This keeps the sensor facing directly at any nearby object.
Understanding the code (cont.) This robot uses some timers in the code to control certain functions. This is done using the millis() function which counts the number of milliseconds since the robot was turned on. We will briefly look at how the unsigned long variable sit is used to measure boredom in the robot. In the [Play] tab, sit is set to equal the value reported by the millis() function whenever the robot takes a step.
Understanding the software (cont.) If the robot is not bored then the code in the [Play] tab determines if the puppy walks or jumps. Normally the puppy will walk unless the size of the steps, determined by the distance is too small. If the head tilts far enough upward to track the object then the robot will jump. The code for the puppy's walking motion (gait) is in the [WalkingMotion] tab.
Understanding the software (cont.) When the puppy first becomes bored, the code in the [SittingMotion] tab is called. So that the robot does not just suddenly drop down, the same timer used to measure boredom is used to control the robots sitting speed with the rear legs slowly straightening at the knee and moving forward at the hips. Once the robot is sitting the code in the [SitShakeLiedown] tab determines the behavior of the puppy.
Uploading via the ISP socket: Since version 1.0 of the Arduino IDE it has been possible upload your programs directly to the processor using the ISP socket. This will overwrite the bootloader making more memory available and cause your program to start immediately on power up or reset. To do this we need a programmer. If you have a programmer, please refer to it's instruction manual. These instructions will explain how to use an Arduino or compatible board as the programmer.
Uploading via the ISP socket (cont.) You can connect the wires directly from the ISP socket of the programmer to the ISP socket of the puppy or you can use the digital pins. Note that D10 or D53 of the programmer is connected to the reset pin of the puppy.
Uploading via the ISP socket (cont.) For no apparent reason you may get an error message. If you try and upload a second time then the program should upload ok. If you continue to get this message then check your robot is turned on and that the batteries are fully charged. Check the wiring and make sure your board type and programmer type are set correctly. The serial port must be set to the programmer.
Trouble Shooting: Please note that this robot is designed to work only with good quality, AAA NiMh batteries. Alkaline batteries will not be able to deliver the current necessary and should not be used. Do not use a 2S LiPo battery as the voltage is too high and may damage the servos. Q. A. I turn the robot on but no lights come on. Check that the batteries are fully charged and the connector is the correct way around with the red wire to +5V.
Robot Controller: The Playful Puppy uses the Mini Driver which is a general purpose robot controller from DAGU. This is a small, Arduino compatible controller that comes with the Arduino bootloader pre-installed. Specifications: Ø Input voltage 4.5V - 9V with reverse polarity protection rated at 4A. Ø LDO 5V regulator rated at 1A. Ø USB interface and ISP socket, can be programmed with USB cable or ISP programmer. Ø ATmega8A processor @ 16MHz with 8K FLASH, 1K SRAM and 512 Bytes EEPROM memory.