adccommunitymod (AutomationDirect) asked a question.

Averaging Value & Direction w/prox

Created Date: February 18,2020

Created By: durallymax

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

I have an impromptu last minute project that requires a couple actions I am a little less familiar with. I could take the time to figure them out, but figured I would query the knowledge here first. The first is averaging an analog reading over a few seconds time. I need to monitor for fluctuations in load but the load changes through the process. I can explain further if needed. Its a motor dragging a device that accumulates more restriction as it moves throughout its stroke. Occasionally it encounters a restriction, I need it to stop when that happens. The second is accumulating pulses in two directions via a tone wheel with two prox sensors. Any suggestions for a clean way to do this? I can think of some messy ways but won't reinvent the wheel if its not necessary. The only reason the direction is important to me is due to the "wind up " in the system. When the motor shuts off, the pulley freewheels backwards a bit due to the tension. I want that to decrement the value so it doesn't lose its physical location. Happy to elaborate further if needed. Thanks.


  • adccommunitymod (AutomationDirect)

    Created Date: February 18,2020

    Created by: durallymax

    I have an impromptu last minute project that requires a couple actions I am a little less familiar with. I could take the time to figure them out, but figured I would query the knowledge here first.

    The first is averaging an analog reading over a few seconds time. I need to monitor for fluctuations in load but the load changes through the process. I can explain further if needed. Its a motor dragging a device that accumulates more restriction as it moves throughout its stroke. Occasionally it encounters a restriction, I need it to stop when that happens.

    The second is accumulating pulses in two directions via a tone wheel with two prox sensors. Any suggestions for a clean way to do this? I can think of some messy ways but won't reinvent the wheel if its not necessary. The only reason the direction is important to me is due to the "wind up " in the system. When the motor shuts off, the pulley freewheels backwards a bit due to the tension. I want that to decrement the value so it doesn't lose its physical location.

    Happy to elaborate further if needed.

    Thanks.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: February 19,2020

    Created by: bcarlton

    Regarding the position pulses: it would be important that a useable signal, high or low, be available when the wheel is stopped. I had to Google 'tone wheel ' and their standard pickup is a magnetic sensor which only functions when the wheel is moving. But if you have good signals and approximately 50% on and off pulses then place one over one edge of a high section . Place the the other directly in the middle of a low section. Assuming the wheel is uniformly cut it doesn't matter which high and low sections you use. Choose them as needed for easy mounting. These two signals will be in quadrature and can be sensed for distance and direction by any high speed counter able to read a quadrature signal.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: February 19,2020

    Created by: durallymax

    I'm not sure what the term is in the controls/automation/PLC world, in the mobile equipment world some rings for position/speed sensing are called a tone ring/wheel.

    The one I have for this project is not like those. It just a ring with two inductive proximity switches (it's an existing setup). The high/low positions are uniform and when one sensor is high the other is low.

    I'm planning to use a P1K. I was hoping the standard discrete input module would respond fast enough, I see 2ms for a max response. I need to measure the pulleys and do the math to figure out the period for the pulses though though.

    Thanks.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: February 19,2020

    Created by: kewakl

    Do the prox signals change state simultaneously.

    If not, do as bernie says. On a rising/falling edge of one check the state if the other.

    you can deduce direction.

    there are examples/videos/instructables for 'embedded ' controllers/rotary encoders that explain this.

    A bit of info . The second image shows what I mean in the above wordywords.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: February 19,2020

    Created by: bsinkovich

    If you know when the motor shuts off you can always count the pulses after the motor shuts off and subtract them from the total. To use a quadrature input the pulses from the two sensors would need to over lap. More then likely you would need a HSI.

    For averaging use the Average (AVG) Instruction.

  • adccommunitymod (AutomationDirect)

    Created Date: February 19,2020

    Created by: MikeN

    Since you are making changes to the control system, is there any way you can simply swap out the "tone wheel " with a more universal and simple encoder?

    edit:

    It also kinda sounds like you may just have a simple timing gear and you are counting teeth with a pair of sensors. Which I guess is a fine way to do it

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: February 19,2020

    Created by: bcarlton

    Rather than changing simultaneously the cycles from the two sensors are staggered by 1/4 of a cycle, hence the 'quadrature '. Follow the setup method I proposed.

  • adccommunitymod (AutomationDirect)

    Created Date: February 19,2020

    Created by: kewakl

    Rather than changing simultaneously the cycles from the two sensors are staggered by 1/4 of a cycle, hence the 'quadrature '. Follow the setup method I proposed.

    Yes.

    Bernie, I do not know if you are responding to my post, but I did mention this in the second line.

    Possibly my written word is getting as indecipherable as my spoken word. I was hoping that the image that I linked would help.

    Sorry if I caused any confusion.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: February 19,2020

    Created by: durallymax

    If you know when the motor shuts off you can always count the pulses after the motor shuts off and subtract them from the total. To use a quadrature input the pulses from the two sensors would need to over lap. More then likely you would need a HSI.

    For averaging use the Average (AVG) Instruction.

    That sounds like a very simple solution. Thanks. I don't necessarily need to determine the direction with it, if the forward contactor is engaged it better be moving forward or something else is wrong. I don't really have a need for the confirmation of direction by the sensors at this point.

    As for AVG, I suppose I should 've at least opened Productivity Suite before posting lol. I 've been in Click lately, that instruction makes things too easy.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: February 19,2020

    Created by: durallymax

    Since you are making changes to the control system, is there any way you can simply swap out the "tone wheel " with a more universal and simple encoder?

    edit:

    It also kinda sounds like you may just have a simple timing gear and you are counting teeth with a pair of sensors. Which I guess is a fine way to do it

    I could but I don't know that I need to. The precision requirement for this is +/- 6 " or so and not very critical. I just want to avoid any sort of "creep ".

    It's simply a plate on the gearbox shaft that has windows cut into it, functions the same as the timing gear you mention. I misspoke earlier, there are two versions of this. The one I have does not have the sensors alternating high/low, the windows are cut so they are both high and low at the same time(aside from the transition points of course). The other version has them alternating high and low.

    kewakl the link you provided was helpful, I don't know if I'll use it for this but I am sure I will refer to it again in the future. Thanks.

    Expand Post
10 of 13