Techplex Labs
  • Home
  • Projects
    • Home Heating Automation
    • Plextex
    • ISTE Desgins >
      • A Modern OpenConcept Design
      • A Modern OceanView Design
      • A Modern Lloyd-esq Design
    • Desk Expander
    • Belgrade Public Library Renovation Project
  • Portfolio
  • Blog
  • Contact

Thoughts...

Using PID to Drive Straight and A Measured Distance

2/5/2017

0 Comments

 
Back in the Recycle Rush days we figured out that having two PID controllers in one command is very challenging. The solution was to have one "P" controller in the Drivetrain Subsystem to correct the robot driving straight, and to have a full PID controller in a command to drive a distance.
​
Here is the method in the Drivetrain subsystem to drive straight.
Note: the HDrive call essentially simplifies to a call to arcade drive.

The real magic happens in the command. In the usePIDOutput we do a bit of massaging on the output value.
  • First we constrain output between negative maxspeed and maxspeed.
  • Then we increase any output value less than .4 to .4 as that seemed to be the minimum speed to make the robot move.
  • Then we set an acceleration rate with a time dependent function so the wheels don't spin out when the PID initially becomes active and calclulates a large error
0 Comments

    Author

    Blake is a recent graduate of the University of Maine with a Computer Engineering degree. Blake set out to work closely with industry professionals to provide products and solutions specially tailored to some of the costliest problems. 

    Picture

    Archives

    February 2017
    January 2017
    April 2013
    March 2013
    April 2012
    February 2012
    December 2011
    November 2011
    August 2011

    Categories

    All
    Apache
    Code
    FRC
    Javascript
    Linux
    Nginx
    PID
    Robotics
    Web

    RSS Feed

Powered by Create your own unique website with customizable templates.
  • Home
  • Projects
    • Home Heating Automation
    • Plextex
    • ISTE Desgins >
      • A Modern OpenConcept Design
      • A Modern OceanView Design
      • A Modern Lloyd-esq Design
    • Desk Expander
    • Belgrade Public Library Renovation Project
  • Portfolio
  • Blog
  • Contact