Feasible? 1 “go” trigger, 1 counter(rotary encoder), multiple simultaneous cycle

Newbie here trying to work out if this can work.

Ok, not sure if the title is a good description… (if I can change it to something that makes more sense, let me know) So, I’ll try to explain. (Sorry for the long description)

We will be running material though a metal detector before it goes through a cutting press. The metal detector is several feet from the cutting machine. Material is a continuous roll. I am working on a device to mark the material if metal is present. It needs to be marked as close as possible to the actual location of the metal. So, this means a “delayed” marking method. The marking device will be several inches past the point of detection.

So… RUN CYCLE

  • The material is running though the detector
  • If metal is present = output from detector (trigger)
  • Material continues to advance
  • Distance of travel tracked by rotary encoder (counter)
  • When material travels appropriate distance, marking device activates

This would mark the material close to the location of the metal so I can skip that section of material

I think this should be relatively easy for the Arduino. (Though I'm not quite sure how to do it. Yet.)

But my question is:

How would you deal with multiple “triggers” where the cycles overlap?

If a cycle is: detect>advance material>mark

Can you start a second cycle if more metal is detected during the “advance material” step and not break the first cycle? So you would end up with multiple marks in a short distance.

Can this be done using the Arduino?

About me..
I have some experience with the Arduino and programming. But would still very much consider myself a newbie. My sketches are still mostly “copy>paste>modify”.

Thanks

That all sounds feasible with an Arduino, including multiple detections. You could have a circular buffer to store the encoder positions at which the metal was detected and then the marker would operate on the next value it gets from the buffer.

The way Serial data is received in an Arduino works like that.

...R

Robin2:
That all sounds feasible with an Arduino, including multiple detections. You could have a circular buffer to store the encoder positions at which the metal was detected and then the marker would operate on the next value it gets from the buffer.

The way Serial data is received in an Arduino works like that.

...R

Thanks for the reply. I will do some research on how to do a circular buffer.