element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • 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 Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
  • Settings
Attack of the Drones
  • Challenges & Projects
  • Project14
  • Attack of the Drones
  • More
  • Cancel
Attack of the Drones
Blog Alpha Rover - Interrupted
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Attack of the Drones to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 24 Apr 2021 1:08 AM Date Created
  • Views 1045 views
  • Likes 5 likes
  • Comments 2 comments
  • alphabot
  • optical_rotation_sensors
  • speed_control
  • arduino_uno_plus
  • attackofthedronesch
Related
Recommended

Alpha Rover - Interrupted

ralphjy
ralphjy
24 Apr 2021

I'd previously written about the poor performance of my AlphaBot Alpha Rover - Out of Control and how I was surprised that the wheel optical encoders had not been incorporated into the AlphaBot library.  fmilburn had written a blog post about implementing encoder feedback using a PID controller Simple Arduino DC Motor Control with Encoder, Part 2 .

 

I decided that before trying to implement a PID controller that I'd just try some first order feedback trying to balance the encoder counts between the two wheels.  I was amazed that the performance got worse.  So, I did a simple open loop test where I swept the PWM value to both motors and measured the equivalent RPM at each step.  The Blue trace is the step count (0-255).  The Red trace is the Left motor and the Green trace is the Right motor.  Two things are apparent - the Right motor takes more voltage to start and there is a huge difference between the two motors in terms of RPM.  At first glance, I suspected that I had a bad motor.

image

 

Then I checked the output of the optical encoder.  Ch1 is the Left motor and Ch2 is the Right motor.

image

 

So, besides any issues with motor mismatch, I'm also having encoder issues - most of the apparent RPM mismatch is probably due to this.  It would explain why trying to add feedback would make things worse.

 

The encoder is pretty simple.  A slotted disk interrupts the light path between a photo diode and a photo detector.  And the signal gets cleaned up by an inverting buffer.

image

 

Looking at the output of the photo detector shows the problem - some of the output pulses are not reaching 3V and the spec on the buffer is 0.7 x VCC = 3.5 (VCC is 5V).  So, the output is intermittent.

 

image

 

Unfortunately this could be a number of issues - maybe even mechanical alignment.  It probably will require taking things apart and verifying everything.  The Left wheel sensor looks similar, I think that buffer might have a bit more input margin.

 

Anyway, I barely had time to try to finish the Alpha Rover if there hadn't been any issues.  So, I won't get done for the AttackoftheDrones contest, but I'll finish this off when I get the other projects out of the way.  And maybe the Arduino RP2040 Connect will be available by then...

 

Good luck to all the participants!  I'm sure I'll learn stuff from your projects that I can use image.

  • Sign in to reply

Top Comments

  • fmilburn
    fmilburn over 4 years ago +3
    That is too bad - but interesting too. Hope you get it fixed soon. I set up my DIY encoders with the opto-interrupter output going straight to the interrupt pins on the microcontroller. I can see how it…
  • DAB
    DAB over 4 years ago +1
    Nice job of identifying the problems. DAB
Parents
  • fmilburn
    fmilburn over 4 years ago

    That is too bad - but interesting too.  Hope you get it fixed soon.  I set up my DIY encoders with the opto-interrupter output going straight to the interrupt pins on the microcontroller.  I can see how it might be better to have something in between to clean up the signal but so far no problems.  I have been working on it this week on the bench with a power supply and made a new motor control board.  With PID both motors can be controlled to less than 1% of the set point, probably 0.5 % without a problem but it is slower than desired to settle.  I should be able to get it going with batteries this weekend, see how well it runs on the ground, and write something up.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • fmilburn
    fmilburn over 4 years ago

    That is too bad - but interesting too.  Hope you get it fixed soon.  I set up my DIY encoders with the opto-interrupter output going straight to the interrupt pins on the microcontroller.  I can see how it might be better to have something in between to clean up the signal but so far no problems.  I have been working on it this week on the bench with a power supply and made a new motor control board.  With PID both motors can be controlled to less than 1% of the set point, probably 0.5 % without a problem but it is slower than desired to settle.  I should be able to get it going with batteries this weekend, see how well it runs on the ground, and write something up.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
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 © 2025 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

  • X
  • Facebook
  • linkedin
  • YouTube