baylor7
Posts: 12
Joined: Wed Aug 06, 2014 2:28 am

Encoder help with Raspberry Pi

Wed Aug 06, 2014 2:39 am

I am wanting to start a project that involves a encoder on a reel. On that reel is pipe. So, when the reel moves forward (clockwise) pipe is then released. I will need the encoder to measure pipe footage when the reel rotates. Also, I will need to include when pipe is brought back on the reel, when the reel rotates counter clock wise. Therefore, pipe footage will then decrease.

I hope that makes sense.

Can someone point me in the right direction as to where I need to start? I am recently new to my raspberry pi with this being my first project.

Duane Degn
Posts: 55
Joined: Thu Jul 10, 2014 6:30 am
Location: Idaho, USA

Re: Encoder help with Raspberry Pi

Wed Aug 06, 2014 6:33 pm

In order to keep track of direction with an encoder, you want to use a quadrature encoder.

Just about any microcontroller could read a quadrature encoder and there are lots of ways one could make these encoders.

I'm sure the Raspberry Pi wouldn't have a problem reading a quadrature encoder. I haven't done this myself, but I'm sure there are lots of examples.

When making your own quadrature encoders, you want to make sure the two sensors (you need two for quadrature) don't change states at the same time. This is usually referred to as having the sensors 90 degrees out of phase but this is 90 degrees with respect to the sensor pulse phase and not 90 degrees around the object.

Here's one of my quadrature encoder experiments (not with the RPi).

baylor7
Posts: 12
Joined: Wed Aug 06, 2014 2:28 am

Re: Encoder help with Raspberry Pi

Wed Aug 06, 2014 6:53 pm

Thanks for the response. That gives me an idea of how I need to go about things.

I am wanting the encoder to possibly be wireless. Are there any communication options that do not use
radio frequency?

Thank you for the help

Duane Degn
Posts: 55
Joined: Thu Jul 10, 2014 6:30 am
Location: Idaho, USA

Re: Encoder help with Raspberry Pi

Wed Aug 06, 2014 8:01 pm

baylor7 wrote:Thanks for the response. That gives me an idea of how I need to go about things.


If the reel has regularly spaced supports, you could use some sort of switch as an encoder pulse. I was thinking of something like this switch but scaled to an appropriate size.

A physical switch would have the advantage of working well in any light condition. Some optical encoders can have trouble when exposed to daylight.

If the spool were made from metal, it would also be possible to use a pair of Hall effect sensors as an encoder.

There are lots of different ways to approach problems like these and the best solution will depend a lot on the physical properties of the spool. How well aligned the spool is will also be important (does it wobble?).
baylor7 wrote:I am wanting the encoder to possibly be wireless. Are there any communication options that do not use
radio frequency?
The only wireless options I can think of which don't use radio frequencies are light (IR or visible) and sound. Devices could communicate with IR pulses similar to a TV remote but communication with light requires a direct line of sight between the two devices to work reliably. It's also possible to send information wireless with sound but the data rate is slower and decoding the transmission is a bit more challenging than using other options.

How is this encoder data going to be used? Do you just want the length of pipe deployed displayed?

baylor7
Posts: 12
Joined: Wed Aug 06, 2014 2:28 am

Re: Encoder help with Raspberry Pi

Wed Aug 06, 2014 9:59 pm

Yes, the spool has regularly spaced supports. I like the idea of the Mini Microswitch - SPDT (Roller Lever). As you recommended this, I thought of a location that a device like this could be placed to measure pipe footage.
Image See picture that I have provided. This type of device could be mounted somewhere on the gooseneck. The gooseneck is the "gooseneck" looking thing just above the injector in the picture. I imagine the device mounting in one of the slots on the gooseneck and would measure pipe footage as the pipe passed through. Would the device actually come in contact with the pipe? Would it be able to measure pipe footage as the pipe came back on to the spool (In reverse)?

The spool is entirely made up of metal. I researched the hall effect sensor that you mentioned. I also believe a device like this could potentially be great. Do you think this device would have to be mounted somewhere on or near the spool or could it possibly be placed somewhere on the gooseneck and would measure pipe footage as the pipe passed by?

Now, you got me thinking about what would be the most accurate way to measure footage. Measuring the movement/rotation of the spool to calculate pipe footage or going with a device that would be mounted on the gooseneck measure footage as pipe went in/out.

The spool is aligned with the axis of rotation. The spool has minimal wobble as it is mounted on a stand. It does vibrate but its very small amounts.

And yes, the encoder will simply display only pipe footage measured on and off the spool.

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: Encoder help with Raspberry Pi

Wed Aug 06, 2014 10:41 pm

Hi,

According to your picture (outside industrial usage), I'd definitely avoid usage of a measuring method based on mechanical contact or optical principles.
The first issues I see in the overall story is the requirement not to use RF communication... Hopefully (for you), this one can be changed. ;-)

Hall effect sensor could be a solution, but due to a metal construction, it might take some trial & error attempts to find a location for a magnet (or a durable spacing material between the magnet and the metal rotor) and the sensor.

Since the connection wires on such machines are always weak link of the overall product, what I'm thinking about is an option to create an autonomous sensor (one molded mini brick) containing sensor element, tiny microcontroller, a rechargeable battery and just two charging contacts exposed to the outside world. The sensor would measure gravity vector (by rotating it around horizontal axis, the gravity change represents its current angle / you can count rotations). This measuring box would burn very small amount of energy, so charging it once per month or so can easily be achieved using a small battery pack...

To decrease overall costs, the reading/display unit could be a mobile phone running a simple app, for example...

There are quite some options how to solve this challenge... however, try to avoid wires and mechanical moving components. ;-)


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

Duane Degn
Posts: 55
Joined: Thu Jul 10, 2014 6:30 am
Location: Idaho, USA

Re: Encoder help with Raspberry Pi

Wed Aug 06, 2014 11:14 pm

baylor7 wrote:Yes, the spool has regularly spaced supports. I like the idea of the Mini Microswitch - SPDT (Roller Lever). As you recommended this, I thought of a location that a device like this could be placed to measure pipe footage.
Image See picture that I have provided. This type of device could be mounted somewhere on the gooseneck. The gooseneck is the "gooseneck" looking thing just above the injector in the picture. I imagine the device mounting in one of the slots on the gooseneck and would measure pipe footage as the pipe passed through. Would the device actually come in contact with the pipe? Would it be able to measure pipe footage as the pipe came back on to the spool (In reverse)?
The way I thought you could use the microswitch is by having it count the "spokes" of the reel. The wheel just makes the lever slide against the spoke easier. The roller isn't measuring anything itself.

BioniC187
Posts: 26
Joined: Sun Jun 02, 2013 6:30 am

Re: Encoder help with Raspberry Pi

Thu Aug 07, 2014 4:30 am

I don't see why not use an optical encoder.

I've successfully used optical encoders on HPDC machines without failure of the optical encoder itself.
Just don't use the shaft of the encoder as the load bearing shaft ;)

Return to “Automation, sensing and robotics”