View Single Post
  #3   Spotlight this post!  
Unread 09-03-2011, 12:57
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,050
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Protecting against runaway PID

If you're using the PIDController class in WPILib, instead of using the motor as a PIDOutput directly, we have used an intermediate class that checks to see if the motor is being manually overriden, and if so to not allow the PID controller to send output to the motor. Something like..

Code:
void PIDWrite(float output)
{
    if (!m_motor_overridden)
        m_motor.Set( output );
}
This year we're using the CAN mode of the Jaguars, and you can switch control modes from position mode to manual mode, and back. However, we didn't get enough testing time, and we had a bit of trouble getting the position mode to work [even just by itself, without the manual mode] because of what we suspect may be a faulty encoder... so we'll be playing with that soon before our competition in April. But we have shown that you can successfully switch modes.

We also have limit switches hooked up to prevent our arm from traveling too far.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote