|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Encoder Wiring Help Needed
This is our team's first time using encoders and we are encountering issues as to where on the robot/cRio we should be connecting the encoder wires. If anyone can please help and show what part of the robot we should wire our encoders to (electrically) and more specifically how.
Please Note: we are using the kit of parts E4p encoders for our shooter. Thanks in advance! |
|
#2
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
The encoders in the KOP have 4 wires. +5, GND, A and B. You can connect the encoders either to the Jaguars directly (if you are using the Jaguars as your motor controllers) or to the digital input channels on the digital sidecar.
For connecting to the Jaguar, crimp a 5-pin header connector with the 4 wires ("+" goes to +5, "-" goes to GND, "A" goes to A and "B" goes to B, "I" has no connection). If connecting to the cRIO, each encoder needs two digital channels. On the first digital channel, "+" goes to +5 (red), "Gnd" goes to "GND" (black) and "A" goes to signal (white). For the second digital channel, "B" goes to signal (white). |
|
#3
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
Quote:
|
|
#4
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
If you wire the encoders to the Jags, you must use CAN or you can't access them. The benefits are pretty much the CAN versus PWM arguments such as: cleaner wiring, not taking 2 digital channels per encoder, can optionally use the Jag's built-in PID control etc.
|
|
#5
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
Is there a point to access both channels?
|
|
#6
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
Don't understand your question. What channels? Are you talking about the two digital input channels? If so, you need two channels per encoder in order to determine the position/speed as well as the direction of the rotation. the FPGA will handle the two channels and give you the resulting count and direction.
Last edited by mikets : 03-02-2012 at 19:28. |
|
#7
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
Yes that's what I mean. But if you use PWM and use either A or B channel is it less accurate?
|
|
#8
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
Quote:
|
|
#9
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
Quote:
Code:
Encoder(UINT32 aChannel, UINT32 bChannel, bool reverseDirection=false, EncodingType encodingType = k4X); Last edited by mikets : 03-02-2012 at 19:38. |
|
#10
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
Quote:
|
|
#11
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
Makes sense to me. My team since i've been involved, never really used anything more than just a limit switch. So I just figured I ask for future.
|
|
#12
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
You linked your response to my two-question post#12. Was that intentional? If so, not sure what part made sense to you.
|
|
#13
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
I dont recall doing that, but no it wasn't to your two part question.
|
|
#14
|
|||
|
|||
|
Re: Encoder Wiring Help Needed
Not sure where to go. I have wired these encoders using the 2 channels on the sidecar. When I do, the robot goes nuts. It spins one side drive backwards and the second side does nothing and never works. Have wired +5, gnd, signal A to first channel and signal b to second channel on both sides. Anyone have an explanation as to what is going on.
|
|
#15
|
||||
|
||||
|
Re: Encoder Wiring Help Needed
I am not sure if it can or cannot. After all, the FPGA is programmable, the firmware can configure it anyway it could. My understanding is that the FPGA implements the counter for the encoders and the Encoder module in the WPI library is expecting both channel A and B. There is no method in the Encoder module that accepts only one channel. So I am making a speculation that it does not support one channel. However, it is probably possible to implement a software counter. But I don't know the innards of the FPGA enough to be able to do that.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|