Go to Post Dee and I pooling our brain cells almost make a full deck... - RoboMom [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-02-2008, 01:53
LieAfterLie's Avatar
LieAfterLie LieAfterLie is offline
Registered User
FRC #2028
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Hampton, VA
Posts: 35
LieAfterLie is an unknown quantity at this point
PID Without Direction - How?

I would like to know what the best ways to implement a pid control are when your feedback doesn't include direction. All you have is a setpoint and an interrupt count - you don't know which direction the wheel was spinning when each interrupt was generated, just how many times/how fast it's going.

Obviously you have to assume that the count is in one direction or the other, either in the ISR counter or in the control itself, but this assumption can be taken from a lot of places, such as the direction of the setpoint.

If you do this, without any precautions, then whenever the wheel happens to be spinning backwards faster than the current setpoint is telling it to go forward, the assumption that the wheel is going forward will cause an attempt at correction and end up sending a continuous full reverse signal. (until the setpoint changes to reverse and the direction assumption becomes right)

What are your ideas on the best way to retain full control at slow speeds and still detect/prevent false direction assumption?

I was thinking about a combination of different sources to detect a wrong direction assumption, such as setpoint direction and a sudden change in error and a high D term output and (hopefully not necessary) unchanging extreme total output.

Any ideas or links would be very appreciated, I think this is a very interesting problem and I'm curious about different ways and the best way for us to fix it.

I'm sure other teams have had to get around this somehow, with the gear tooth sensors this year not telling direction.
__________________
SEMPER UBI SUB UBI
  #2   Spotlight this post!  
Unread 26-02-2008, 02:14
114Klutz 114Klutz is offline
Registered User
AKA: Li Pi
FRC #2984 (Viking Robotics)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Los Altos
Posts: 152
114Klutz is a jewel in the rough114Klutz is a jewel in the rough114Klutz is a jewel in the rough
Send a message via AIM to 114Klutz
Re: PID Without Direction - How?

Using GTS, you actually can sense direction - going one direction, the sensor gives a different length pulse then the other, but without using timing, you can simply determine the direction based on the current direction you set the motor to spin at. While not as reliable, it should work well enough.
  #3   Spotlight this post!  
Unread 26-02-2008, 07:27
Jetweb Jetweb is offline
is good at making robots find walls
AKA: Jonathan
FRC #0179 (Children of the Swamp!!!)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jupiter, FL
Posts: 213
Jetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to all
Re: PID Without Direction - How?

Quote:
Originally Posted by 114Klutz View Post
Using GTS, you actually can sense direction - going one direction, the sensor gives a different length pulse then the other, but without using timing, you can simply determine the direction based on the current direction you set the motor to spin at. While not as reliable, it should work well enough.
we have been using this method for years on our team but this years geartooth counters are only single direction and the pulse width is the same in both directions .

we just decided that +/- 6 inched was good enough on distance and used gyro for going streight . When you have a 40 In. target we dident have a problem hitting it with this method but its still not as accurate as in the past
  #4   Spotlight this post!  
Unread 26-02-2008, 08:33
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: PID Without Direction - How?

Well, if you're worried about the robot going backwards, limit the reverse power output of the PID to a number too low to actually cause reverse robot motion.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #5   Spotlight this post!  
Unread 26-02-2008, 22:53
LieAfterLie's Avatar
LieAfterLie LieAfterLie is offline
Registered User
FRC #2028
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Hampton, VA
Posts: 35
LieAfterLie is an unknown quantity at this point
Re: PID Without Direction - How?

Well the same thing applies in the forward direction. I was just contemplating the results of misjudging the direction of the feedback. If it's less than the setpoint and assuming the wrong direction, then the output will tell it to go faster, actually making it go slower and towards the real setpoint (even if in a more uncontrolled manner, going faster and faster until the assumption is correct). If it's more than the setpoint, it'll go the other way and won't stop, which is more of a problem, although being able to detect a wrong direction in either of these circumstances is better.
__________________
SEMPER UBI SUB UBI
  #6   Spotlight this post!  
Unread 27-02-2008, 01:17
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: PID Without Direction - How?

Are you looking for an alternate way to determine direction or do you want to leave direction completely out of it?

As far as alt forms of direction sensing goes, you can use
current output value to motor - motors running forward generally drive/coast forward till reverse is applied
accelerometer - if external force (crash) is applied you can sense its direction
(speed) rate of GTS/encoder pulses - definitely a stretch, but if you have speed you can make some assumptions that are generally correct under normal circumstances
gyro

a combination of these sensors and some (reasonably complex) code should be able to determine direction.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
  #7   Spotlight this post!  
Unread 27-02-2008, 06:13
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: PID Without Direction - How?

Our team is just flat-out shutting the motors off once we are at/past our goal--if the feedback loop is tweaked well, you will settle in pretty closely and a bit of overshoot should not hurt anything.

As far as assuming direction, I don't think so. I can't honestly imagine software being useful here. If you absolutely need direction, you might consider using an encoder instead.

JBot
__________________
Aren't signatures a bit outdated?
  #8   Spotlight this post!  
Unread 04-03-2008, 00:17
intellec7's Avatar
intellec7 intellec7 is offline
108 programmer
AKA: Gustavo
FRC #0108 (SigmaC@ts)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2006
Location: Hollywood, Florida
Posts: 65
intellec7 is on a distinguished road
Send a message via AIM to intellec7 Send a message via MSN to intellec7
Re: PID Without Direction - How?

Some careful positioning might allow you to align two GTS for quadrature output. You'll probably need to use an oscilloscope to visualize the position.
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
PID without the D Joohoo Programming 8 22-01-2008 17:06
How to tune a PID loop? steve d Programming 3 11-02-2007 20:49
PID How to hold an arm in a fixed position without a locking gear box Ian_Xodus General Forum 29 28-01-2007 08:50
PID without a Ph.D. Joe Johnson Programming 3 07-02-2006 17:37
Drive Straight C Code using Encoders without PID? Chris_Elston Programming 17 15-02-2005 23:41


All times are GMT -5. The time now is 01:45.

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