Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Encoder Wiring Help Needed (http://www.chiefdelphi.com/forums/showthread.php?t=101888)

slijin 04-02-2012 22:54

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by gnichols (Post 1119910)
Not sure where to go. I have wired these encoders using the 2 channels on the sidecar.

Which 2 channels? Which type of channel? They should be digital I/Os.

Quote:

Originally Posted by gnichols (Post 1119910)
When I do, the robot goes nuts. It spins one side drive backwards and the second side does nothing and never works.

What do your encoders have to do with your driving? Have you implemented some form of control loop already?

Quote:

Originally Posted by gnichols (Post 1119910)
Have wired +5, gnd, signal A to first channel and signal b to second channel on both sides.

That's one way to wire them, provided you are using the digital I/Os.

BurkeHalderman 04-02-2012 23:04

Re: Encoder Wiring Help Needed
 
Are you supposed to wire the encoders to the sidecar or the Analog Breakout?

slijin 04-02-2012 23:18

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by BurkeHalderman (Post 1120200)
Are you supposed to wire the encoders to the sidecar or the Analog Breakout?

The encoders provide quadrature outputs (i.e. two square waveforms), so they need to be wired to the digital I/O pins on the sidecar.

alb4h 05-02-2012 12:20

Re: Encoder Wiring Help Needed
 
I'm on the same team as gnichols.

The encoder is wired into 2 digital I/O ports on the digital sidecar, with careful attention made to plugging in gnd and signal to one port and 5v and signal to other port. The hardware connection is correct.

With the encoder wired, when the code is enabled, and in teleop mode, the motors start to run, with no joystick input.
With the encoder unplugged, everything works as expected, with no movement until the joystick is moved.

We are using C++ and this happens even when deploying the FRC Default Program (current with imaging tool), which when loaded into workbench is titled BuiltinDefaultCode.
That code does not explicitly reference digital input ports or the encoder classes at all, neither does the custom code we have created when first discovering this problem.

One other problem we are having is that the signal light we have connected to the digital sidecar is not lighting, though the small led on the sidecar next to the DSL port is lighting. What voltage should we see there?

Brian Selle 05-02-2012 13:21

Re: Encoder Wiring Help Needed
 
We are also having encoder issues. We have the E4P wired as described in the previous posts (2 digital IO ports using PWM cables - one has signal A, +5, GND and the other signal B). I've checked the output with a multimeter - the +5 and GND are good (the red light on the encoder is on) and when I slightly move the wheel I can see the A and B channels vary from 0 to 5v. When the motor is moving the voltage of the A and B channels is 2.5-2.6v. In the software, we create an Encoder - assign the ports in the constructor, but when we output distance, rate, or raw when motor is moving we get 0 for all. I triple checked the port numbers (tried 1,2 and 7,8) but no joy.

One thing I wonder about... is that the our motor shaft is slightly less than 1/4" so we had to crimp the encoder wheel slightly. I wobbles ever so slightly when the motor turns. Could this be it?

Alan Anderson 05-02-2012 18:08

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by alb4h (Post 1120398)
One other problem we are having is that the signal light we have connected to the digital sidecar is not lighting, though the small led on the sidecar next to the DSL port is lighting. What voltage should we see there?

You should see 12 volts when the light is supposed to be on.

Are the BAT, 5V, and 6V LEDs lit?

nitneylion452 05-02-2012 18:11

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by btslaser (Post 1120414)
We are also having encoder issues. We have the E4P wired as described in the previous posts (2 digital IO ports using PWM cables - one has signal A, +5, GND and the other signal B). I've checked the output with a multimeter - the +5 and GND are good (the red light on the encoder is on) and when I slightly move the wheel I can see the A and B channels vary from 0 to 5v. When the motor is moving the voltage of the A and B channels is 2.5-2.6v. In the software, we create an Encoder - assign the ports in the constructor, but when we output distance, rate, or raw when motor is moving we get 0 for all. I triple checked the port numbers (tried 1,2 and 7,8) but no joy.

One thing I wonder about... is that the our motor shaft is slightly less than 1/4" so we had to crimp the encoder wheel slightly. I wobbles ever so slightly when the motor turns. Could this be it?

It could very well be the issue. Rather than crimp the encoder wheel (which is highly inadvisable) try taking a small piece of paper or thin plastic (like from a plastic bag) and putting it over the motor shaft, then putting the encoder wheel over the plastic or paper covered motor shaft.

slijin 05-02-2012 20:08

Re: Encoder Wiring Help Needed
 
I'm going out on a limb here, but have you guys (gnichols, alb4h) checked your DB37 cable assembly as per FIRST's directions?

If the problem persists, I would suggest posting copies of your code and pictures of the relevant connections so it's easier to isolate the problem.

gurdy2 07-02-2012 15:43

Re: Encoder Wiring Help Needed
 
hello all,

my team (1325) is still unsure as to the wiring of our E4p encoders if anyone could supply a diagram that would be great!

Thank You

Alan Anderson 07-02-2012 22:11

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by gurdy2 (Post 1121761)
my team (1325) is still unsure as to the wiring of our E4p encoders if anyone could supply a diagram that would be great!

You will find just such a diagram in both the Encoder Example and Motor with Encoder LabVIEW example projects.

In short, connect encoder common, power, and output A to (-), +5, and signal of one DIO on the Digital Sidecar. Connect encoder output B to the signal of another DIO.

Brian Selle 08-02-2012 22:23

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by btslaser (Post 1120414)
We are also having encoder issues. We have the E4P wired as described in the previous posts (2 digital IO ports using PWM cables - one has signal A, +5, GND and the other signal B). I've checked the output with a multimeter - the +5 and GND are good (the red light on the encoder is on) and when I slightly move the wheel I can see the A and B channels vary from 0 to 5v. When the motor is moving the voltage of the A and B channels is 2.5-2.6v. In the software, we create an Encoder - assign the ports in the constructor, but when we output distance, rate, or raw when motor is moving we get 0 for all. I triple checked the port numbers (tried 1,2 and 7,8) but no joy.

One thing I wonder about... is that the our motor shaft is slightly less than 1/4" so we had to crimp the encoder wheel slightly. I wobbles ever so slightly when the motor turns. Could this be it?


Fixed the problem... you need to call encoder.start() before you get any readings. Also, the disk does wobble slightly but it's well within the tolerance of the optical reader. Another poster did suggest a better idea of using paper or plastic shims, but crimping the wheel (ever so slightly) was actually on the manufacturers instructions. We are reading motor turns - yeah!


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi