|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Interrupt on driver station digital input
Is it possible to attach an interrupt to a digital input on the driver station? I would like to use an encoder as an input device, and I don't believe there is any other way use them than with interrupts. I looked through the WPILib beta 5 code and didn't see anything about driver station interrupts in DriverStation.h/cpp and FRCComm.h.
If this isn't possible, I'm considering using a microprocessor to take in the encoder readings, keep track of the encoder offset, and output that as a PWM signal to the driver station analog input. For example, if the encoder is turned halfway around, the microprocessor would send a 50% PWM to the driver station. Would this work correctly? Also, does the driver station have a power source I could use? (As I understand it, external power is not allowed.) For the visual people: ![]() |
|
#2
|
|||||
|
|||||
|
Re: Interrupt on driver station digital input
You can't interrupt on the digital inputs on the DS. If you're using a very coarse encoder (4-8 cycles per revolution) you might be able to manage it by simply sampling it every data packet from the DS... If it isn't turned too fast.
That said, if you're only interested in the angular position of the encoder is there any reason you can't use a plain old potentiometer to do this? There's stopless potentiometers if you need it to roll over, or multi-turn ones if you need a couple of turns. Expending all that effort to turn an encoder into just a potentiometer seems a little... excessive. |
|
#3
|
|||
|
|||
|
Re: Interrupt on driver station digital input
Quote:
You would have to put a low pass filter on your PWM signal for the analog input to read it properly. If you post the specific frequency you will be duty cycle modulating, we can help you design the filter. It won't be much more than an RC network or two. There is a 5V power supply on the DS that you can use, it is set up just like the DSC. |
|
#4
|
|||
|
|||
|
Re: Interrupt on driver station digital input
I'd transplant the encoder out of a USB joystick into the mechanical controls, while keeping the encoder attached electrically to the original processing hardware.
Last edited by Tom Bottiglieri : 03-12-2008 at 10:53. |
|
#5
|
||||
|
||||
|
Re: Interrupt on driver station digital input
Has anyone cracked open the Attack 3's? We've drilled them to mount them, but we didn't break them open. Is the "thumb wheel" on the base an encoder, or a potentiometer?
|
|
#6
|
||||||
|
||||||
|
Re: Interrupt on driver station digital input
You can also buy encoders with an analog interface, like the US Digital MA3. http://www.usdigital.com/products/en...ary/shaft/ma3/
|
|
#7
|
|||||
|
|||||
|
Re: Interrupt on driver station digital input
Quote:
That said, I have never used the MA2 or MA3 on a Driver Station, but they should work just fine! |
|
#8
|
|||||
|
|||||
|
Re: Interrupt on driver station digital input
Quote:
I imagine the code would be simple enough to just check the value each cycle and compare it to previous to get the "distance traveled". Big Caveat, It's been forever since I really sat down and programmed. |
|
#9
|
|||
|
|||
|
Re: Interrupt on driver station digital input
Quote:
Quote:
|
|
#10
|
|||
|
|||
|
Re: Interrupt on driver station digital input
Ah, my fear was right about the lack of interrupts. Thanks for the ideas, everyone. I didn't know about the 'portable computing devices' rule, and that definitely invalidates my workaround idea.
However, the stopless potentiometers and analog/absolute encoders look interesting. I've heard of stopless potentiometers before... do they come that way, or do they have to be modified to become limitless? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Securing the Driver Station? | Madison | FRC Control System | 16 | 16-12-2008 03:05 |
| driver station doesn't see robot | nickmagus | Programming | 4 | 29-11-2008 23:58 |
| 2009 Driver Station Dimensions | noxryan | FRC Control System | 5 | 27-11-2008 21:02 |
| pic: The new driver station | Billfred | Extra Discussion | 28 | 23-04-2008 20:07 |
| size of driver playing station | 663.keith | Technical Discussion | 1 | 11-01-2005 13:23 |