Add an Encoder to Feetech Micro 360 Degree Continuous Rotation Servo FS90R

Posted on 30/12/2018 by droidguru
Steps completed / 8
Press to mark a step as
completed or click here to complete all
Components you will need
Select missing items to add them
to the cart or select all
Other requirements
Introduction

It's very difficult or next to impossible to precisely control wheeled robot motion using open loop motor control. Many applications require accurately setting the pose or travel distance of a wheeled robot. Small continuous rotation micro servo motors are a great low cost solution to drive small robots but they lack the feedback control of larger servo motors.

Converting these little servos to use closed loop position feedback control is actually very easy once you add a Tamiya analog Encoder sensor and a simple closed loop feedback algorithm to an Arduino or Raspbery Pi controller.


  1. Open the Encoder_disk.pdf and print it onto the Avery 8160 address label paper
  2. Use scissors to cut out the Encoder disk graphic along the dashed lines from the label paper and cut out the center hole using the dashed line as a guide

  1. Peel off the paper backing from the encoder disk graphic from Step 3
  2. Attach the encoder disk graphic to the back of the round servo horn and center the encoder disk graphic hole around the servo horn spline boss
  3. Smooth out the encoder disk graphic to remove any air bubbles or wrinkles

  1. Place a small drop of hot melt or super glue onto the micro servo motor shaft boss. Use hot melt glue as a temporary fastener but use super glue for the final permanent attachment.
  2. Attach the Tamiya Analog encoder ensuring that the hole in the Tamiya Analog encoder circuit board is centered around the micro servo motor shaft with the sensors pointing up/away from the motor

 

 

  1. The cables provided with the Tamiya Analog encoder need to be modified to work with standard ground-5V-signal configuration on microcontroller analog input pins
  2. Swap ground and 5V wires on one end of the Analog sensor cable so that the 5V wire is in the center of the pin connector and the ground and signal wires are on the edge position of the pin connector
  3. Attach the unmodified end of the cable to the Tamiya Analog encoder pins
  4. Attach the modified end of the cable to the analog input pins of the Arduino microcontroller ensuring that the ground wire on the Arduino pin is connect to the ground pin of the Tamiya Analog encoder
  5. Attach the Micro Servo motor PWM cable to the D9 PWM pins of your Arduino microcontroller

  1. Mount the round servo horn with the encoder disk graphic onto the micro servo motor shaft and attach it using the provided servo horn attachment screw

Arduino Version

  1. Connect the modified end of the encoder sensor cable to the Analog 4 port of the Arduino observing the correct Ground-5V-Signal pin orientation
  2. Connect the Micro Servo Motor PWM connector to the D9 pins of the Arduino controller
  3. Connect Arduino to a power supply

Raspberry Pi Version

  1. Stack the Pimoroni Automation Phat to the Raspberry Pi GPIO header
  2. Stack the SparkFun Pi Servo HAT on top of the Pimoroni Automation Phat
  3. Connect the Signal pin of the Analog Encoder sensor to the ADC 1 connection on the Pimoroni Automation Phat
  4. Connect the Ground and 5V pins of the Analog Encoder sensor connector to the respective Ground and 5V connections on the Pimoroni Automation Phat
  5. Ensure that the SparkFun Pi Servo HAT Power supply isolation jumper is in open mode (see vendor manual) before connecting the battery power to the hat
  6. Connect battery power to the Raspberry Pi and SparkFun Pi Servo HAT

Arduino Version

  1. Copy, clone or download the Arduino Encoder Encoder.ino, Encoder.h and Encoder.cpp demo code from github
  2. Open the demo code in the Arduino IDE and select your board from the IDE Tools menu
  3. Upload the code to your board
  4. Once the Arduino board resets it will start the program and run through a sequence of predefined motions that illustrate how to control the Micro servo motor using the Tamiya Analog encoder

Raspberry Pi Version

  1. Copy, clone or download the encoder.py Python Encoder demo code from github onto your Raspberry Pi SD card
  2. Open the demo code in the Python 3 Idle IDE and run the code from the IDE Run menu
  3. Once the program starts it will start the program and run through a sequence of predefined motions that illustrate how to control the Micro servo motor using the Tamiya Analog encoder. Uncomment to code labelled interactive mode to enter position commands from the Python shell command line

  1. You can test an example robot with encoder controlled Micro Servo motors on the free droidguru.net Web site
  2. Goto: droidguru.net. Watch the tutorial first if you don't know how it works (Help menu). Joystick steers the robot and the A button fires the Airsoft gun unless it's out of BB's or battery dies. (Best when viewed on a laptop/desktop computer)
  3. Follow these steps to start using the example robot
  4. Login as a Guest
  5. Select the Wheels room from the Join Room Panel
  6. Select the Drone Patrol 1 robot from the Room members panel
  7. After the countdown timer completes you can control the robot with the joystick or jog buttons
  8. Reselect the Drone Patrol 1 robot from the Room members panel to start a new robot control session
  9. The virtual joystick steers the robot and the joystick job arrow buttons control jog/vernier/incremental motor movements using the Analog encoders to better align the airsoft gun with the targets
Flag this post

Thanks for helping to keep our community civil!


Notify staff privately
It's Spam
This post is an advertisement, or vandalism. It is not useful or relevant to the current topic.

You flagged this as spam. Undo flag.Flag Post