element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Raspberry Pi Projects
  • Products
  • Raspberry Pi
  • Raspberry Pi Projects
  • More
  • Cancel
Raspberry Pi Projects
Blog Rapiro: How to modify and upload the Arduino sketch
  • Blog
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Raspberry Pi Projects requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fvan
  • Date Created: 12 Jan 2015 6:04 PM Date Created
  • Views 501 views
  • Likes 1 like
  • Comments 3 comments
  • raspberry
  • rapiro_robot
  • pi
  • sketch
  • rapiro
  • upload
  • servo
  • raspberrypi
  • raspberry_pi_projects
  • arduino
Related
Recommended

Rapiro: How to modify and upload the Arduino sketch

fvan
fvan
12 Jan 2015

  • Introduction
  • Video
  • How-to
    • Topic
    • Prerequisites
    • Arduino IDE
    • Rapiro Sketch
    • Correcting Servo Position

 

Introduction

 

This post is meant as a first how-to for Rapiro, the Raspberry Pi robot. The goal will be to start off with some simple topics and gradually move to more complex things.

It will be a good opportunity for me to use my robot and try to discover its full potential, while getting feedback and/or requests from you.

 

Do you think that's a good idea? If yes, what topics would you like to see covered? Leave a comment!

 

 

Video

 

For a video version of this how-to, watch the embedded video below, otherwise, keep on reading image

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

How-to

 

Topic

 

The topic I'd like to cover in this how-to: modifying and uploading the Arduino sketch to Rapiro. More specifically to solve a particular issue.

 

It's very likely, that after assembling Rapiro and powering it for the first time, some servos are not properly aligned.

 

If you look at the picture below, you'll notice a few mistakes:

  • the arms are pointing to the back instead of being straight down
  • the head and waist are not aligned with the feet
  • the feet are not sitting flat on the table

 

The last one is hard to see from the picture because the robot's weight is pushing them flat. This is however causing a lot of noise as the servo is trying to maintain its position even though it is being forced in another.

image

 

Prerequisites

 

There are certain things you'll need for this how-to:

  • an assembled Rapiro (obviously ...)
  • a computer
  • a micro USB cable to upload the sketch
  • a power supply or batteries to power the robot

 

Arduino IDE

 

The first thing you'll need is the Arduino IDE. This is required to modify and upload the sketch to Rapiro.

If you don't have it installed yet, go to http://www.arduino.cc and download the latest version.

image

 

Rapiro Sketch

 

The second thing needed is the sketch used to program Rapiro, which we will be editing.

The sketch can be found on http://www.rapiro.com, in the download section.

image

 

Correcting Servo Position

 

Open the Rapiro sketch by double-clicking on the Rapiro *.ino file. This should launch the Arduino IDE and visualise the code.

image

 

You'll notice a bit of code for the fine angle adjustments, that's the part needed to fix the initial servo positions without having to take apart the robot and redo the assembly. Unless the correction exceeds 20 degrees, in which case reassembling that part is recommended.

 

It requires a bit of trial and error to find the right values. After corrections, you could end up with something similar:

 

// Fine angle adjustments (degrees)
int trim[MAXSN] = { -5,  // Head yaw
                    -10,  // Waist yaw
                    20,  // R Sholder roll
                    0,  // R Sholder pitch
                    0,  // R Hand grip
                    -20,  // L Sholder roll
                    0,  // L Sholder pitch
                    0,  // L Hand grip
                    0,  // R Foot yaw
                    8,  // R Foot pitch
                    0,  // L Foot yaw
                    3}; // L Foot pitch
  

 

Once the sketch is modified, it needs to be uploaded to Rapiro:

  • power off Rapiro
  • connect the micro USB cable to Rapiro and the computer, Rapiro's eyes should light up
  • in the Arduino IDE
    • select "Arduino UNO" as board type (Tools > Board)
    • select the correct serial device (Tools > Port)
    • press the "Upload" button

 

Rapiro's eyes will turn off while the upload is ongoing and light up again once finished.

 

After having uploaded the modified sketch and powering on Rapiro, it should stand straight and be properly aligned as demonstrated below:

image

 

If not, repeat the process of modifying and uploading the sketch until the position is as desired.

  • Sign in to reply

Top Comments

  • DAB
    DAB over 8 years ago +1
    Nice robot. What are you planning to do with it after you get it fully working? DAB
  • fvan
    fvan over 8 years ago in reply to DAB +1
    Rule the world I'm not sure yet, but I'll think of something. Frederick
  • mcb1
    mcb1 over 8 years ago

    I'm glad to see this beast making an appearance again.

     

    You need to paint it yellow, add some overalls and glasses, then it could join your other minion. image

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • fvan
    fvan over 8 years ago in reply to DAB

    Rule the world image

     

    I'm not sure yet, but I'll think of something.

     

    Frederick

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 8 years ago

    Nice robot.

     

    What are you planning to do with it after you get it fully working?

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube