|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Gear Tooth Counter for height
If this is indeed possible (and legal), how would we get the gear tooth sensor into the code, and how would we use it to control the motor?
I'm thinking it involves a PID loop, but I don't know for sure... |
|
#2
|
|||||
|
|||||
|
Re: Gear Tooth Counter for height
It is possible, legal, and should work fine. Just have the code reset the 'known' position at the start of each match.
A PID loop is used to control a setpoint. One example is a car cruise control (maintains constant speed), another is a kitchen oven (maintains constant temperature). What you may want to use is called an "Interrupt". This is a special hardware connection (to the Digital sidecar) that signals the cRio's processor "STOP Whatever you are doing and run this piece of code. Immediately. Now". In your case, that code might add +1 (or subtract -1 if the lift motor is running backwards) to a counter that keeps track of lift position. Clearly, the code must be as brief as possible, since your processor is literally unable to do ANYthing else while the interrupt is active. (The interrupt gets activated by the sensor signal) Do your own research on the highlighted words to understand and do it. |
|
#3
|
|||
|
|||
|
Re: Gear Tooth Counter for height
I would be worried about using a gear tooth sensor as you only check for height. If there is anything that interferes with your robots elevator extension problems could arise. Some potential problems I can think off hand is if your gear slips (or more likely a belt or chain later down the line) or if your elevator gets hit and is knocked out of wack. While these scenarios are not that likely (depending on construction of said elevator) it might be worthwhile to have an additional check on elevator height.
|
|
#4
|
|||
|
|||
|
Re: Gear Tooth Counter for height
Quote:
-Joe |
|
#5
|
||||
|
||||
|
Re: Gear Tooth Counter for height
Sean - the danger in using a gear tooth counter in this manner is that it is a 'relative' measurement system.
That means that where ever your lift happens to be when you power it on is the zero point. If the lift is set 3 inches high, then you may run the lift too high at the end of the motion. Or, worse, if you have a power fluctuation on the field, the lift will lose it's 'zero' position. You are better off if you use something that is absolute. To that end, there are absolute encoders and multi-turn potentiometers that you could use. In 2008 we used a 10 turn pot from radio shack that worked very well. In 2010, we did as you are suggesting and used the encoder to measure how far we unwound our winch. It was a constant hassle to make sure the winch always started in the same position. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|