Distance - Variable

9Hammy9

Member
Join Date
Aug 2019
Location
Loughborough
Posts
17
Hello,

A machine sequentially picks and drops objects one after the other. Those objects arrive in batches, and all objects within a batch are identical in dimensions. The size of the object changes from one batch to another.

To have a faster process, I need the arm to come down fast, and to slow down when it gets near the edge of the object, after that it will slowly detect and pick.

To do that, I am considering adding steps to Homing which is done at low and safe speeds every time a new batch arrives. The arm moves from a homing position (switch/signal A) and when it detects the edge if the object in the batch it gives signal B. The program is envisaged to count the number of pulses being sent to the stepper motor during the period between signal A and signal B, and stores that as a variable reflecting the distance between the edge of the object and the homing position of the arm. This variable will then be used as the distance the arm should travel before it reaches the edge of the object for every object in this batch.

When a new batch arrives, Homing will be done again, and the distance will be calculated again and used for all objected within the new batch.

How easily and doable is it for a novice?

Thanks
 
This should not prove to be difficult, I assume you are familiar with stepper drives There are a number of ways to do it for example using a teach button move the stepper in slow mode until edge detected, store the count into a non volatile register, then store what would be the final distance in another add the two together in another register you will have then distance from a to b & distance to part and whole distance to move, in production move fast for x pulses (position a to b), slow from B to final.
Registers
Reg. 1 = 2000 (distance A to B) Fast
Reg. 2 = 100 (distance B to Final) Slow
Reg. 3 = 2100 (distance A to final) Total
How you do it will depend on the drive for example you could drive fast for 2000 pulses, slow for 100 then stop.
You could also build up recipes to store the positions in retentive memory, most PLC's have these, allocate a range of NV memory areas and recall these based on the type of product or teach a new product & store the recipe.
 
It should work about as simply as you've described it. You'll need to write a short sequence to perform the homing - there are a hundred ways to skin that cat, search the forums for sequencing logic and try out a few approaches, see which one fits your needs the best.

My #1 tip when coding sequences is: comment explicitly as you write the code.

Each time you write a rung of code for the next sequence step, document three things on the rung comment:
1. How the sequence arrived at this step
2. What happens while this step is in progress
3. How and when to proceed to the next step/what the next step is

For example:
Step 2: Extend to Position B is initiated after the arm is detected at the Position A sensor.
The arm extends.
Once the Position B sensor is detected, store the step count in DB123.4 and proceed to Step 3: Return to Home


Commenting like this serves three purposes. First, it forces you to write down exactly what you want to happen in clear and concise terms, and very often will help you realise you've forgotten to consider condition x, or that this step is getting complex and it might be easier to split it out into two steps. Second, it makes it easy for you to follow your own thought process through and make sure you're doing what you think you're doing. And third, it makes it ten times easier for someone else reading your code to follow what's going on, even if you use a method of sequencing they're unfamiliar with.
 
It should work about as simply as you've described it. You'll need to write a short sequence to perform the homing - there are a hundred ways to skin that cat, search the forums for sequencing logic and try out a few approaches, see which one fits your needs the best.

My #1 tip when coding sequences is: comment explicitly as you write the code.

Each time you write a rung of code for the next sequence step, document three things on the rung comment:
1. How the sequence arrived at this step
2. What happens while this step is in progress
3. How and when to proceed to the next step/what the next step is

For example:
Step 2: Extend to Position B is initiated after the arm is detected at the Position A sensor.
The arm extends.
Once the Position B sensor is detected, store the step count in DB123.4 and proceed to Step 3: Return to Home


Commenting like this serves three purposes. First, it forces you to write down exactly what you want to happen in clear and concise terms, and very often will help you realise you've forgotten to consider condition x, or that this step is getting complex and it might be easier to split it out into two steps. Second, it makes it easy for you to follow your own thought process through and make sure you're doing what you think you're doing. And third, it makes it ten times easier for someone else reading your code to follow what's going on, even if you use a method of sequencing they're unfamiliar with.
Thanks for the tips, very useful.
 
See attached code, I do not have Step 7 installed at the moment so I have used GX Works. I have made it simple although long to give you ideas, I would probably have reduced the code by integrating it more. I have also made some assumptions and it is just to give you an idea, this is basic so no what if logic the top part is just for simulation purposes, the next is a step sequence that when the teach button is pressed the drive goes down at full speed (you could make this slow for teach purposes), when the arm reaches the part it stores the distance in POs_B Count register, It then waits for operator to press and hold the teach button and drives down slow to ensure part is in position for grab (note: The drive will continue & crush the part if operator keeps the button pressed it relies on operator to see when in position he then releases it as there is no final position PX or you would not need a teach function ?) it stores the count in Pos_C count register.
It then Retracts the arm at fast speed & finishes teach the values have now been stored.
The auto sequence when started, follows the same steps but uses the POs_B & C Registers to control speed, While there is a part in position it continues to cycle.
As I must re-iterate this is a demo, no checking etc....
 
See attached code, I do not have Step 7 installed at the moment so I have used GX Works. I have made it simple although long to give you ideas, I would probably have reduced the code by integrating it more. I have also made some assumptions and it is just to give you an idea, this is basic so no what if logic the top part is just for simulation purposes, the next is a step sequence that when the teach button is pressed the drive goes down at full speed (you could make this slow for teach purposes), when the arm reaches the part it stores the distance in POs_B Count register, It then waits for operator to press and hold the teach button and drives down slow to ensure part is in position for grab (note: The drive will continue & crush the part if operator keeps the button pressed it relies on operator to see when in position he then releases it as there is no final position PX or you would not need a teach function ?) it stores the count in Pos_C count register.
It then Retracts the arm at fast speed & finishes teach the values have now been stored.
The auto sequence when started, follows the same steps but uses the POs_B & C Registers to control speed, While there is a part in position it continues to cycle.
As I must re-iterate this is a demo, no checking etc....
Many thanks for your time.
We'll digest it and figure out how to do the code.
Thanks
 

Similar Topics

Hiya, I have a project coming up using a unimotion servo linear actuator with a Schneider PLC (tm251) Are there any blocks available in the...
Replies
0
Views
959
Hello everyone, What's the difference between nominal sensing distance and maximum sensing distance in a diffuse photoelectric sensor ? in...
Replies
1
Views
1,120
Hi all, I have an Allen Bradley PLC which is connected to a Kinetix 300 drive. I have been using MotionView to adjust the different positions...
Replies
3
Views
1,272
Hi everyone, I don't know much of PLCs but it happened that i need to connect Leuze AMS358i Ethernet laser measurement to Productivity 1000...
Replies
0
Views
1,061
Hii!!! I'm new in automation and i have a Banner LTF Laser distance sensor (LTF121IC2LDQ). I want to connect it on a Allen Bradley PLC. Is the...
Replies
3
Views
2,579
Back
Top Bottom