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)

its da PAT!!! 03-02-2012 19:47

Re: Encoder Wiring Help Needed
 
I dont recall doing that, but no it wasn't to your two part question.

mikets 03-02-2012 19:48

Re: Encoder Wiring Help Needed
 
Wait...
I just found a different class module (GearTooth class). This one accepts one channel. So it does support counting one channel. I suppose you can connect the A channel to one digital input and use the GearTooth class to access the count.

its da PAT!!! 03-02-2012 19:51

Re: Encoder Wiring Help Needed
 
To honest with you I know nothing about code. The most i know is that we use Java lol. I'm more of a mechanical/ electrical guy.:rolleyes:

mikets 03-02-2012 19:55

Re: Encoder Wiring Help Needed
 
Interesting...
From reading the source code of the GearTooth class, it seems the GearTooth sensor can even tell the direction. It supports different pulse widths on different directions. I wonder how does that work? But I am sure it is only specific to the GearTooth sensor. If you use one channel of the optical encoder, since the pulse width doesn't change in both direction (except for changing speed), it cannot decode the direction from the pulse width.

Ether 03-02-2012 19:55

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by mikets (Post 1119432)
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.

Just found this thread:

http://www.chiefdelphi.com/forums/sh...d.php?t=101587

mikets 03-02-2012 19:58

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by Ether (Post 1119443)

Yep, there is also a counter class that can be used for this purpose.

Ether 03-02-2012 20:01

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by mikets (Post 1119448)
Yep, there is also a counter class that can be used for this purpose.

I am assuming that the counting is being done by the FPGA hardware. Otherwise you'd swamp the cRIO with interrupts.


mikets 03-02-2012 20:03

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by Ether (Post 1119450)
I am assuming that the counting is being done by the FPGA hardware. Otherwise you'd swamp the cRIO with interrupts.

Yep, the counting is done by the FPGA.

Ether 03-02-2012 20:47

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by mikets (Post 1119452)
Yep, the counting is done by the FPGA.

Does it say that explicitly in one of the documents you've just been reading?


mikets 04-02-2012 06:46

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by Ether (Post 1119475)
Does it say that explicitly in one of the documents you've just been reading?

It's in the source code of counter.cpp. It's accessing the FPGA all over.

jmailhot 04-02-2012 11:26

Another issue with encoders to keep in mind is the "sense" of forward and backwards. Especially if using the encoders with jaguar PID loops, but even with cRIO PID loops, the encoders need to be increasing when the motor is going forward, and the control input sense of forward needs to match the encoder. And the jaguar's sense of positive voltage needs to match also. You may need to reverse the A and B lines of the encoder, or the polarity of the motor, to get these things all having the same definition of "forward". If you add limit switches to the mix, the forward and reverse limit switches must also correspond.

BitTwiddler 04-02-2012 13:53

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by mikets (Post 1119448)
Yep, there is also a counter class that can be used for this purpose.

Very timely discussion. I am going to make the assumption the LabView VIs associated with the counter implement this class for us to use to count shooter revolutions.
Thanks guys.:D

gnichols 04-02-2012 16: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.

BitTwiddler 04-02-2012 18:12

Re: Encoder Wiring Help Needed
 
Quote:

Originally Posted by BitTwiddler (Post 1119814)
Very timely discussion. I am going to make the assumption the LabView VIs associated with the counter implement this class for us to use to count shooter revolutions.
Thanks guys.:D

An Update:

For you Labview programmers only interested in looking at one input to count pulses to determine the rate of rotation, the WPI counter library works great. Just make sure you take the time to read the help file on the counter VIs thoroughly.

When I got to the shop earlier today the team programmer complained that the software based counter he had built couldn't keep up at high motor speeds. I explained how the FPGA offloaded this work to the hardware and the counter VIs in the WPI library took advantage of this capability. We tried them and they worked all the way up to the 4000 RPM speed with no problem. We found it helpful to use one of the low-pass filters from the PID library.

Alan Anderson 04-02-2012 20:31

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. 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.

What is your program doing to control the drive motors? Are the encoder readings used to compute the commanded motor power?


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