Quadrature encoder is moved while power off

Go To Last Post
29 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hi all! I have a quadrature encoder that is used to calculate displacement based from the formula "displacement = (pi*d*count)/ppr" where count is the counter of pulses A vs B and ppr is 256.

I'd like to ask if there's any way that I'd know that the sensor shaft is moved while power off?

For reference, the above image is an example. The sensor is attached to a walkway. Say the last position of the star is 30, and then the power goes off, then the walkway was manually moved, and now the position of the star is 90.

As of now, I'm saving the last position (from displacement) before power off using eeprom. 
Is there anyway that I'd know that the sensor shaft was moved from last position saved to current position?

 

I have an AS5040 sensor (can be a quadrature encoder or an absolute position sensor). I tried doing this using the absolute position mode but it has very limited range

of detection that the sensor is moved (only 512 bits, that's like 18.81mm), otherwise, microcontroller won't know the correct direction the sensor moved during power off.

That's why I'm considering using the quadrature output mode.

I'm new.

Last Edited: Tue. Feb 18, 2020 - 08:36 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With typical QE there's no way to initially know the absolute position. The solution is to use some kind of homing procedure at startup during which the actuator is moved until some kind of sensor (optical or mechanical switch) is activated. That position becomes the mechanical zero reference position. Depending on the application you could even let the system skip the homing and just update its absolute position if/when the sensor is activated during regular use.

 

Another solution would be to prevent the actuator being moved while power is turned off.

/Jakob Selbing

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

How many spins of skipping when it is off?  1/10th?  1?  2 ?  Obviously more than one spin will be undetectable.

 

I tried doing this using the absolute position mode but it has very limited range

Well isn't quadrature mode even more limited--isn't it each of those steps?  (I'm not sure).   With absolute, you know where you are for many possible steps, whereas with incremental, move 4 steps without power & you are lost. 

 

In situations like these you often need another sensor that has an exact home position.

 

Is this walkway a looping belt?

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

francoder wrote:
I'd like to ask if there's any way that I'd know that the sensor shaft is moved while power off?

You would need an absolute encoder:

 

https://en.wikipedia.org/wiki/Rotary_encoder#Absolute

 

https://en.wikipedia.org/wiki/Rotary_encoder#Absolute_encoder

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Feb 18, 2020 - 09:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Or provide a backup battery and use sleep modes to reduce power consumption so you can keep track of the encoder while the power is off.

 

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How is the shaft being moved with out power?

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


jaksel wrote:
at startup during which the actuator is moved until some kind of sensor (optical or mechanical switch) is activated. That position becomes the mechanical zero reference position.
Ah that takes me back! Anyone here old enough to recognise this?....

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

francoder wrote:
a walkway.

If it's a walkway then, presumably, you can't just stop it & start it willy-nilly ?

 

Especially before starting, there must be safety procedures to be sure that it's safe to start?

 

So make the "zeroing" part of the startup procedure...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Anyone here old enough to recognise this?

It's one of those new-fangled 5-1/4" ones, isn't it?

 

I remember the 8" originals ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wouldn't the sensor be attached to the motor assembly driving the walkway?  Or perhaps you are worried about slippage between the two.  You need to provide more details about the drive of this walkway.

 

You could possibly apply reflective strips (encoding) to the edge of the walkway, perhaps on the bottom (but such that they won't wear away).

Magnets might be better.  Optics & walkway dirt might not be a good combo.

Why do you need to know the walkway has moved when unpowered?

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
Obviously more than one spin will be undetectable.

 

There are multi-turn absolute encoders out there.  They're expensive.  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Scroungre wrote:
They're expensive.  

I can't imagine that one of these travelling walkways is exactly "cheap" ... ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can't imagine that one of these travelling walkways is exactly "cheap" ... ?

I wonder how much juice it uses when nobody is on a long one (like airport)...a lot of watts going nowhere (maybe to heat the building).

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all. I apologize for the confusion regarding the walkway example. That is not what I intend to do.
To be exact, I'm doing a shut height indicator for machines similar to hydraulic press.

 

The sensor has a preset maximum and minimum height that indicates the height the press will go up and down.

The sensor shaft is most likely to be connected to a belt that can indicate the height of the press as it goes up and down.
The sensor is connected to a motor-gear-like that commands the press the height it goes up and down.

 

For example, exactly of what I want to achieve:

  • Say the preset maximum height is 250, and the minimum height is 50.
  • The initial position the sensor is placed is at 150.
  • Then the press will go up and down at 250 and 50 vice versa.
  • During power off, the last position the sensor saved is 200. If the press is not moved, there will be no problem because the count still remains 200 on power on, thus still stands valid that the sensor will go up 50 to reach maximum, 250, and down 150 to reach the minimum, 50.
  • However, if the sensor is moved from last position 200 to 170, on power-on, the sensor still reads 200 when it fact it is actually now at 170. So the sensor will command the motor to go up (170+50 = 220), making the maximum limited to 220 and go down 150 (170-150 = 20), which exceeds the minimum 50. What more if the minimum goes negative, it will be like baaam.

 

I've mentioned that the sensor I'm using can be changed to an position sensor with 10-bit resolution - this is what I'm using for now. It goes from 0-1023 pulses.

But the position sensor mode is very limited  to 512 pulses of shaft movement because of sensor limitations.

Converting the 512 pulses to a certain displacement with the current shaft I'm using, it's just 18.81mm.

So if the press moved a distance greater than 18.81, the sensor's reading will be incorrect.

 

Any approach on this problem is extremely helpful. I apologize again for any confusion. Thank you!

I'm new.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

You probably want an absolute linear encoder. You might want to speak to an industrial automation company - they should have an off-the-shelf solution for you. Be prepared to pay. A LVDT (linear variable displacement transformer) comes to mind.

 

What resolution do you need? More resolution == more money.

 

You really have two main solutions - use an incremental encoder, but you need to do a homing sequence each time you power up. Or an absolute encoder - more expensive but no homing required.

 

 

If you want to do a little more work and want a cheap solution - 

You can get digital height gauges which are a variation of the digital vernier caliper.

 

https://www.machineryhouse.com.a...

 

These are battery powered and remember the absolute position. They also have a standard digital interface that has been hacked so you can read the distance with a microcontroller.

If the battery goes flat - then you have a problem. If the sensor is required for machine or personal safety, then you need to look at other sensors to complement this.

 

 

Note - if this device is to ensure operator safety, then I'd suggest you not get involved. You don't want to be liable for someone's injury or death. There are solutions for this - again be prepared to pay.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Somewhere I saw some tape (like a tape measure that you peel & stick down) & a reader that simply reads the code marks & gives an absolute position.  Don't remember the resolution, but I seem to remember it was pretty impressive & the cost was pretty low too.

Of course optical like that might be a poor choice for an open, dirty machine (pro for LVDT).

 

What resolution & accuracy do you need?  0.001 inch? 0.1 inch?  1/2 inch?

 

You should FIRST be speaking about machine dimensions & motions...later think in terms of counts  (counts required, counts moved cost of counts, etc)

 

Note - if this device is to ensure operator safety, then ....

 

there are lots of design standards & requirements that you must meet!!

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Wed. Feb 19, 2020 - 02:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

draw wire encoder may work for you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

francoder wrote:

  • Say the preset maximum height is 250, and the minimum height is 50.
  • During power off, the last position the sensor saved is 200. If the press is not moved, there will be no problem because the count still remains 200 on power on, thus still stands valid that the sensor will go up 50 to reach maximum, 250, and down 150 to reach the minimum, 50.
  • However, if the sensor is moved from last position 200 to 170, on power-on, the sensor still reads 200 when it fact it is actually now at 170. So the sensor will command the motor to go up (170+50 = 220), making the maximum limited to 220 and go down 150 (170-150 = 20), which exceeds the minimum 50. What more if the minimum goes negative, it will be like baaam.

 

As above, an absolute encoder may solve your problems. That does not care about any power-off movement.

If that is not practical, other solutions are 

* Use a battery powered incremental system so the counter is not powered down when the system does. Effectively, this makes an absolute encoder by adding a battery.

* Add limit detectors, that force a recalibrate of any incremental encoder movements, before any damaging limits are reached.

That means more sensors, and more SW are added, but such limit safety nets are common on big machines..

* A mix of Absolute encoder and incremental encoder could be considered.

eg I see Mouser have SoftPots, that come in 200mm wiper lengths (~$16 1+), and one of those could be used with an encoder, as a dual-sensor sanity check 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is something called an "Absolute Position" Encoder.

 

A quadrature encoder is specifically three outputs, an 'A' output, a 'B' output and a "Marker" output.

 

The 'A' and 'B' outputs are 90 degrees out of phase and the "Marker" is one narrow pulse per revolution.

 

On the other hand, an "Absolute Position" encoder has many outputs that represent a binary of GRAY count.  The count represents the angular position of the encoder shaft.  The shaft is then geared to represent distance traveled.

 

With the "Absolute Position" encoder, you could possibly keep just it powered up so that any positional change would be remembered thru the power down time.

 

In any case, a power up position initialization or "Homing" sequence is highly advised.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

jaksel wrote:
at startup during which the actuator is moved until some kind of sensor (optical or mechanical switch) is activated. That position becomes the mechanical zero reference position.
Ah that takes me back! Anyone here old enough to recognise this?....

 

 

 

 

Yup! 8 inches across, even!

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Ah that takes me back! Anyone here old enough to recognise this?....

And to think we used to boot an entire operating system off one of those.

 

Kartman wrote:
A LVDT (linear variable displacement transformer) comes to mind.

That also brings back memories - In our Electronics Labs at university, we had to study the driver circuit and output signal conditioning & processing. I remember being truly amazed at the resolution and repeatability they achieved.

 

Nowadays you can probably buy them with nice digital outputs using USB/Serial connection.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Taking a step back . . . why would you ever turn the power off to the encoder and monitoring circuitry if the item being monitored is still capable of movement?  Details?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Altazi wrote:

Taking a step back . . . why would you ever turn the power off to the encoder and monitoring circuitry if the item being monitored is still capable of movement?  Details?

 

I'm guessing while it's turned off a service tech moves it.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You know, in 50 years of working on and around machine movement, I can only think of one application where position was required thru a power cycle. A quadrature encoder based system will always require a "Homing" sequence after a power cycle, unless the position electronics remains powered. But if the axis is moved while power is off, a."Homing" sequence will be required.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And an 8" floppy.disk was what, 360KB? The typical ARM controller might have more RAM than that.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

microcarl wrote:
And an 8" floppy.disk was what, 360KB?

Actually a DSDD 5.25" floppy was 360KB, an 8" was multi-MB size. Aw those were the days!

 

Jim

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kinda off topic... the first hard drive I ever had was a Tandon TM-502 which was a 5-1/4 full height beast that stored only 10 megabytes. Same era as the 8 inch floppies.

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Krupski wrote:
Kinda off topic... the first hard drive I ever had was a Tandon TM-502 which was a 5-1/4 full height beast that stored only 10 megabytes. Same era as the 8 inch floppies.

 

SCSI cards for an S100 computer were like $25, but the drives were crazy. Then, all of a sudden, 5MB hard drives showed up for like $100 in BYTE magazine. But then, you could not find SCSI cards for less than a kilobuck. My S100 computer never got a hard drive, always 2 double sided double density 8 inch floppies.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0



 all of a sudden, 5MB hard drives showed up for like $100 in BYTE magazine ​​​​​​​

Glad I waited...

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!