Go to Post That is just ridonkulous. - Brandon Holley [more]
Home
Go Back   Chief Delphi > Technical > Control System
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 30-03-2004, 16:58
TedP TedP is offline
Registered User
#1014
 
Join Date: Mar 2004
Location: Dublin, OH
Posts: 19
TedP will become famous soon enough
Re: Offloading intterupts to a counter

Quote:
Originally Posted by KenWittlief
I know that most PIC processors have internal counters that can count transistions on input pins - I dont know if they are available on the one in the RC - if so it would be much easier to use than an external device - and the counters dont need interrupts for each count - only when they have reached their terminal count.
Digital inputs 1 through 6 are already tied to the low priority interrupt handler in the default IFI code. Transitions from 0 to 1 are detected. This is actually how we're doing our encoding -- we just detect beam breaks. At every break, the interrupt triggers and increments a counter.

Everyone seems to love talking about quadrature encoders, but in this particular type of application where you usually have some gear reduction between the motors and the wheels, it just seems silly. If I'm driving the motors forward and the wheels are moving backwards despite the gearing connecting the motors to the wheels, I have a BIG PROBLEM. Thus, just use one bit for encoding and keep track of what direction you're driving your motor to tell you which direction you're going in.

And because I gazed ahead and noticed a question about terminal count... When the external counter reaches the highest number it can count to, it will have to raise a flag indicating it has reached it's "terminal count." This can be done internally in the PIC to keep track of time. If counters external raise a terminal count every, for example, 1024 ticks, then the PIC will be able to increment a counter internally indicating that the counter has moved another 1024 ticks.
  #2   Spotlight this post!  
Unread 30-03-2004, 17:24
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Offloading intterupts to a counter

Ted has a good point - if you end up hitting something, or another bot is pushing you backwards, you wheels will either be slipping (spinning) or turning backwards or both

but either way, you are already lost - so you might as well assume you are going in the direction you set your motors to. once your wheels slip your position based on wheel turns is useless.

and if you are using wheel rotation to close the loop on motor speed, buy the time your wheels end up being pushed backwards your PID loop would have them at full power forwards anyway
  #3   Spotlight this post!  
Unread 30-03-2004, 17:39
TedP TedP is offline
Registered User
#1014
 
Join Date: Mar 2004
Location: Dublin, OH
Posts: 19
TedP will become famous soon enough
Re: Offloading intterupts to a counter

Quote:
Originally Posted by KenWittlief
Ted has a good point - if you end up hitting something, or another bot is pushing you backwards, you wheels will either be slipping (spinning) or turning backwards or both
Well, and what I was trying to also say was that depending on your robot's gearing, it's probably very difficult to push the robots backwards any significant amount, ESPECIALLY if their motors are driving. I'd be more willing to believe wheels slip or spin rather than run backwards. When a motor wants to drive forwards and you drive it backwards instead, it's not good for the motor nor the source of power to the motor.

Quote:
Originally Posted by KenWittlief
but either way, you are already lost - so you might as well assume you are going in the direction you set your motors to. once your wheels slip your position based on wheel turns is useless.
Well, even if your position is useless, the rate of change is still useful. In fact, sometimes the thing to do when your wheels slip is to reduce your speed until you start catching on carpet again. Sometimes having some feedback control controlling your speed is a good way to do that.

Quote:
Originally Posted by KenWittlief
and if you are using wheel rotation to close the loop on motor speed, buy the time your wheels end up being pushed backwards your PID loop would have them at full power forwards anyway
And again, motors in full power forward while wheels are going backwards is no good for anyone. "back EMF" becomes "forward EMF"... or something.

So, yeah, to reiterate, I don't think quadrature encoders really provide much advantage. Get your ticks, fudge your direction, and you'll do just as good as any.

Now, if you have other mechanisms besides drive train that might be driven backwards (perhaps you're using something as input that is fairly free to rotate... etc.) then the quadrature makes a lot of sense. But for drive train for most of these robots, it's probably not all that helpful.
  #4   Spotlight this post!  
Unread 30-03-2004, 20:06
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: Offloading intterupts to a counter

The drive train should be just barely traction limited so slipping will be rare. There are many cases where the drive trains will backdrive in my application, often the motors will not be on and the wheels will spin, it is not always that they will be spinning in the opposite direction. I defenitley do need a direction sensor. Regardless, it isn't too hard at all to check direction with the quadrature encoders, every counter i have looked at has the capability to, and it probably doesnt add too much time to my interrupt code to do a single if on a digital i/o pin. One possible solution might be to use current sensors to see if the motors are being backdriven, but if im going to be counting encoder clicks, i might as well count them up and down.
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award

Last edited by Max Lobovsky : 30-03-2004 at 20:33.
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
Counter Strike Gadget470 Chit-Chat 20 11-07-2005 14:03
Odd counter problems Catastrophy Programming 30 16-02-2004 23:41
Counter chips Ryan Meador Programming 9 15-02-2003 00:07
Microsoft Launches Counter Switch Campaign, Then Takes It Away. Joe Matt Chit-Chat 11 17-10-2002 15:53
Counter loop archiver 2001 3 24-06-2002 00:44


All times are GMT -5. The time now is 05:59.

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