Go to Post The rules are the rules, but if the rules get so ridiculous some of us may choose not to play anymore and that is the bigger shame. - Paul Copioli [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 22 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 01-03-2011, 21:15
ksanger's Avatar
ksanger ksanger is offline
Registered User
FRC #0211 (MaK)
 
Join Date: Mar 2010
Rookie Year: 2010
Location: Rochester NY
Posts: 62
ksanger is on a distinguished road
Re: Java CANJaguar PID Issues

We would really rather stay in position control and not deal with velocity mode at all. However when we "enable" teleop mode the motors move. When we "enable" autonomous mode the motors move. It appears that the CANJaguars have a glitch such that once initialized during robotInit() as PID position control using a potentiometer; then when one goes to auto or tele mode they are instructed to start up, yet the PID loop is either not initialized or worse yet they start as velocity devices until further initialization is performed. Note we are not starting with a potentiometer position of zero as that is close to the dead zone. Rather we are starting with an input voltage near 0.145 V.

Even this isn't clear though as sometimes the motors move to a greater voltage direction and other times they move to a lower voltage direction. The main common theme is that the speed is the same. Its as if the starting position we give the CANJaguars during init becomes a speed when teleop or autonomous is enabled. Until the CANJaguar realizes that it was programmed as a position device and then it stops moving.

Basically we have been unable to successfully program a CANJaguar as a position device prior to calling teleop or autonomous.

For competition we decided to control the CANJaguar limit inputs using digital I/O such that we may disable the CANJaguars prior to calling Teleop and Autonomous. We have successfully performed this by hardwiring the inputs, however we have not successfully done this programatically. ie the motors still run. There may be a race condition between the motors running and the digital output disabling the CANJaguars by going high.

Our contingency plan is that the hardware will run against a hard stop and crash into itself so it can't go backwards. Hopefully the forward motion won't kill us while crashing backwards into hardware for a short period doesn't burn out the motors or put the potentiometers passed their zero voltage output. (Once the pots go less than zero they read as greater than 0.90 volts and then a position command runs backwards through more hardware to get to the 0.145 volt starting position. Not.)

There must be a reason that a CANJaguar that is programmed for position control with PID inputs of -1400, 500, 0, start to run a motor whenever teleop or autonomous is enabled from the driver station. The pots are not slipping. They are Cherry AN8 360º encoders monitoring a magnetic pickup screwed into a shaft. Repeated moves to two voltage positions (0.145 and 0.5 V) replicate fabulously over and over many times regardless of enabling and disabling. And yet enabling teleop causes the motor to move. Our starting position is 0.145 V. We .disable() the CANJaguar, set the mode to PID position mode, set PID to -1400, 500, 0; set the potentiometer to a 1 turn pot, set the position to 0.145 using .set( 0.145). We don't enable until we get to Teleop. When teleop is called the motors move a while at a slow speed in a random direction then stop. Eventually after enabling the CANJaguars in Teleop and commanding them to 0.145 they go to 0.145 where a .get() returns 0.145.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:39.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi