|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Offloading intterupts to a counter
Quote:
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
|
||||
|
||||
|
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
|
|||
|
|||
|
Re: Offloading intterupts to a counter
Quote:
Quote:
Quote:
![]() 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
|
||||
|
||||
|
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.
Last edited by Max Lobovsky : 30-03-2004 at 20:33. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |