0% found this document useful (0 votes)
57 views28 pages

Collision Avoid

This document describes how to configure 3 motors on 3 axes to move lenses while avoiding collisions. Each axis will send its current position to the other axes as a software limit switch. Time interrupts will run on each axis to send its position, and motion complete interrupts will check if movement triggered a limit to reset profiles. Axes 1-3 will be configured independently with motion profiles, interrupts, and starting from measured positions to avoid lenses colliding.

Uploaded by

Crys Ox.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views28 pages

Collision Avoid

This document describes how to configure 3 motors on 3 axes to move lenses while avoiding collisions. Each axis will send its current position to the other axes as a software limit switch. Time interrupts will run on each axis to send its position, and motion complete interrupts will check if movement triggered a limit to reset profiles. Axes 1-3 will be configured independently with motion profiles, interrupts, and starting from measured positions to avoid lenses colliding.

Uploaded by

Crys Ox.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 28

APPLICATION NOTE #12 Collision Avoid

1. Application description:
This application note explains the steps that need to be done to control
independently 3 motors on 3 different axis in which each one moves a lens from an
user external command, in such a way to avoid the collision between lens (look at
figure1).
The collisions will be avoid using a TML time interupts, where every axis will send
the own actual position as a software limit switch to the axis which it limits.

Figure 1. Scheme for particular mechanical system (top view)

2. Application flowchart:

Deactivate Software Limit


Switches

Execute Homing

Set the actual position to the


distance at point 0

Activate Software Limit


Switches

Enable Time and Motion


Complete interrupts

Start the motion on external


online reference

1
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Figure 2. Motion flowchart diagram

Scale the actual position for the axis wich


will recive it as a Software Limit Switch

Send the scaled actual position as a


Software Limit Switch to that axis

Figure 3. Time interrupt flowchart diagram

Check if Motion Complete interrupt Yes


No was triggered by Software Limit
Switch

Reset the Software Limit


Reactivate the motion profile
Switches active bits

Reactivate the motion profile

Figure 4. Motion Complete interrupt flowchart diagram

2
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

3. ESM implementation:
Axis 1:

Figure 5. Motion sequences window (Axis 1)

Figure 6. Motion Complete interrupt window (Axis 1)

3
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Figure 7. Time interrupt window (Axis 1)

Axis 2:

Figure 8. Motion sequences window (Axis 2)

4
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Figure 9. Motion Complete interrupt window (Axis 2)

Figure 10. Time interrupt window (Axis 2)

5
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Axis 3:

Figure 11. Motion sequences window (Axis 3)

Figure 12. Motion Complete interrupt window (Axis 3)

6
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Figure 13. Time interrupt window (Axis 3)

4. Detailed description:
Next will be explained each step that have to be done to configure an axis. The
implementation consists of 3 parts for each axis: Motion window, Motion is
Completed interrupt window and Time interrupt window. So below will be
explained the configuration just for Axis 1 that is pretty similar to other axis, with
some additions for Axis 2 and Axis 3.

Motion window (Figure 5):


Step 1: Deactivating the Software Limit Switches. For this we have to clear the bit
responsible for Software Limit Switches activation in ASR register – ASR.12 bit. Click
on the red area marked with 1 will open the needed following window:

Figure 14. Clearing the bit 12 in ASR register

7
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

By applying an AND mask EFFF on ASR register – bit 12 will be cleared. In the first
frame is set the 16-bit variable, and in second one the masks that are applied to this
variable.
Step 2: User variables declaration. For Axis 1 we will use 2 variables: DER_copy
of type int – for checking DER register, and Pos_LS_Axis2 of type long – for sending
Software Limit Switch to Axis 2. Other variables from Axis 2 and Axis 3 are also used
for sending Software Limit Switches, or for scaling actual position between axis.
Click on the red area marked with 2 will open the following window:

Figure 14. Define variable named DER_copy of type int


In the first frame is specified variable name, and in second one is specified the type
of this variable.

Step 3: Homing execution. This step should be done to know the initial actual
position of every axis lens. In this way each axis moves the lens to the mechanical
limit. For this is used the 39 Homing to move negative until is reached the
mechanical limit, and 40 Homing to move positive until is reached mechanical limit.
The Homing parameters can be set by the user, depending on the application and
mechanical restrictions. Click on the red area marked with 3 will open the window
below (Figure 15). In the first frame are set the homing parameters, in the second
one the homing procedure . For Axis 1 is used the 40 Homing.

8
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Figure 15. Setting the homing parameters and homing procedure

Step 4: Set actual position. After homing was executed, the distance of lens from a
desired point 0 should be measured to know the actual position of each lens from
this point. In this particular case, Axis 3 position is set as 0 point, Axis 2 is at 50 mm
from Axis 3, and Axis 1 is at 260 mm from Axis 3. For setting the actual position click
on the red area marked with 4, it will open the following window:

Figure 16. Setting the actual position


9
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Step 5: Activating Software Limit Switches. This step is similar with Step 1, with
the difference that now we have to set the bit 12 in ASR register. This is achieved by
applying an OR mask 1000 on ASR register. Click on the red area marked with 5 will
open the following window:

Figure 17. Setting the bit 12 in ASR register

Step 6: Enabling Time and Motion Complete Interrupts. For this click on the red
area marked with 6, and it will open the following window:

Figure 18. Enabling Time and Motion Complete interrupts


10
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

The “Interrupt Settings” dialogue allows you to activate and/or deactivate the TML
(Technosoft Motion Language) interrupts. For Time period has elapsed and Motion is
completed interrupts (Int9 and Int10) select Enable and also Reset previous TML
interrupt request to reset the corresponding interrupt flag(s) set in the past. For
Time period has elapsed interrupt press the Details button to set the time period.

Step 7: Start the motion on external online reference. For this click on the red
area marked with 5 and it will open the window bellow (Figure 19). In this window we
have to set the Online External Reference Type. As we want to command the
position of lens we have to choose Position Control Mode. Because of mechanical
restrictions we have to Limit maximum speed. Also we should to Set the initial value
(EREFP) to the value of actual position after homing, because in this mode the
motion will be commanded from Command Interpreter by setting the EREFP
variable, but by default the EREFP is equal to 0, and so the lens will move to 0 point
without command.

Figure 19. Setting the motion on external online reference

11
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Step 8: Define Time and Motion Complete interrupts. Click on the red area
marked with 8 will open the following window:

Figure 20. Setting the motion on external online reference


The purpose of this application is to change the default interrupts so choose
option User defined for Time period has elapsed and Motion is completed interrupts.
The TML interrupt with option User defined appears in the project window left side
selection tree, in the current application, as a sub-tree of the Interrupts section.
Click on it to get in the interrupt window.

Motion complete interrupt window (Figure 6):


Motion Complete Interrupt is required to exit from Quick Stop profile if this was
triggered by the Software Limit Switches, and to reactivate the last motion mode. So
the lens can go in opposite direction if the Software Limit Switch was reached.
Step 1: Check if the MC int. was triggered by the Software Limit Switches. The
DER register bits 6 and 7 (DER.6 and DER.7) responds for Software Limit Switches
activation. If DER.6 is set then Software LSP is asctive, if DER.7 is set then Software
LSN is active. For checking this register, first we have to copy DER register into the
DER_copy variable by clicking on the red area marked with 1, it will open the
following window:

12
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

1
2

Figure 21. Copying the DER register into DER_copy variable


In the first frame is set the variable in wich will be copied the register, and in the
second one the variable to copy (register).
After this we have to select bits DER.6 and DER.7 by applying an AND mask 00C0
to the DER_copy variable. For this also click the red area marked with 1 in the first
frame set the variable DER_copy and in the second one write the AND mask you
want to apply:

Figure 22. Applying an AND mask to the DER_copy variable

13
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Step 2: Make the condition if the MC int. wasn’t triggered by Software Limit
Switches. If DER.6 and DER.7 bits are clear then the MC int. wasn’t triggered by
Software Limit Switches, so we will just reactivate the motion profile. For this click on
the red area marked with 2, and it will open the following window:

Figure 23. “Goto” condition if the MC int. wasn’t triggered by Software Limit
Switches
In this window is created a jump to the selected label Reactivate_Motion_External, if
DER.6 and DER.7 bits are clear.

Step 3: Make the condition if the MC int. was triggered by Software Limit
Switches. If DER.6 and DER.7 bits are set then the MC int. was triggered by
Software Limit Switches, so we will clear the DER.6 and DER.7 bits for not to get
stuck in MC int. and then reactivate the motion profile.

The Time Interrupt is required to send the actual position to other axis after a desired
period of time, and a

Figure 2 shows the steps that need to be done to enable the interrupt and create
the variable LED. To get details about how the motion sequences were

14
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

configured in the window above, please click in the areas marked with 1 to 3.
You’ll obtain the following programming windows:
 Step 1:

Figure 4. Interrupt Settings

Figure 5. Set the time period

The “Interrupt Settings” dialogue allows you to activate and/or deactivate the TML
(Technosoft Motion Language) interrupts. For Int10 – Time period has elapsed
select Enable and press Details to set the time period. For the interrupts enables,
check also Reset previous TML interrupt request to reset the corresponding
interrupt flag(s) set in the past.

 Step 2:

15
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Figure 6. Define variable named LED

Select Define variable named to define a new variable. Specify the variable name
“LED” in the next field and choose the variable type “int” from the list.

16
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

 Step 3:

Figure 7. Variable LED initialization

The “Assignment and Data Transfer – 16 bit Integer Data” dialogue helps to
assign the 0 value to the 16-bit integer variable LED. In this way the variable is
initialized.

17
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

 Step 4:

Figure 8. Interrupts window


This view allows you to see, define and modify the TML interrupt service routines
(ISR). Each drive/motor has a default ISR for each of the 12 TML interrupts. In order
to use the default ISR, select Default for all the TML interrupts.
The purpose of this application is to change the default ISR so choose option User
defined. The TML interrupt with option User defined appears in the project window
left side selection tree, in the current application, as a sub-tree of
the Interrupts s ection. Click on
it to get in the INT10 window.

18
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Figure 9. How to get in the INT10 window


 Step 5:

Figure 10. Jump to LED_ON label

The “Jumps and Function Calls” dialogue allows you to control the TML program flow
through unconditional or conditional jumps and unconditional, conditional or
cancelable calls of TML functions.
Select Goto and indicate the jump address (LED_ON) in address, label or address
set in variable.
Check if variable to execute the conditional jump and specify the test variable and
the condition. The test variable is always compared with zero. Initially verify that the
variable LED is equal to 0. If the condition is true the jump to LED_ON label is
executed, else the next TML command is carried out.

19
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

 Step 6:
Figure 11. Jump to LED_OFF label
 Step 7:

Figure 12. Define LED_ON label


The jump address can be set indirectly via a label. Use Insert label name to place
the label in the desired location.
 Step 8:

20
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

In this

application, the “I/O” dialogue is used to


Figure 11. The “I/O” dialogue
21
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

set low/ high a digital output, equivalent to led off/ led on. Select Single I/O, choose
Set output line, select the desired output from the list of available outputs and
choose the output level: low or high.
First, the output is set high because it is part of the set of instructions that will be
executed if the condition “LED = 0” is true.

 Step 9:

To

Figure 12. Variable's value corresponding to the ON status of the led


indicate the ON status of the led, the value of the variable LED is changed to 1.

 Step 10:

22
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Figure 13. Return from interrupt

Select RETurn from interrupt to insert the RETI instruction, which ends the TML
interrupt. When RETI instruction is executed, the TML program returns to the point
where it was before the TML interrupt occurrence.

 Step 11:

Figure 14. Define LED_OFF label

23
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

 Step 12:

Figure 15. Set output status to LOW

This instruction will be executed if the “LED = 0” condition is false. The status of the
led will switch from on to off.

24
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

 Step 13:

Figure 17. Customize Control Panel


Figure 16. Variable's value corresponding to the OFF status of the led
To indicate the OFF status of the led, the value of the variable LED is changed to 0.
The RETI statement is no longer needed because this is the last instruction in the
time interrupt. The program returns automatically to the main menu.

The steps that need to be done to track how the value of variable LED changes in
DRIVE IO Control Panel are explained below:

25
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Use the “Control Panel | Customize” menu command in order to be able to


customize the DRIVE IO Control Panel. A special toolbar will be displayed,
containing all the possible objects which can be added in a Control Panel. Note that
during the parameterization stage, all the control panels are stopped.
Click on the first object from the special toolbar in order to select it. Press the left-
mouse button and drag the mouse in order to add it in DRIVE IO Control Panel.

It's used to visualize the value of variable LED.

26
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Figure 8. Object customization

In the Variable field select “LED” from the current list of variables or type the name
of the variable. The title of the object window (displayed in the object window title
bar) can be specified in Title section. By default, if you don't specify a title, the
variable name will be assumed instead.
Use again the “Control Panel | Customize” menu command to end the
customization and return in the normal operation mode of the control panels.

Use the “Start Control Panel” button or the “Control Panel | Start” menu
command to start the control panels of the application. From this moment, all the
contents of all the objects contained in the visible control panels of the application
will be updated and displayed on the screen.

27
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid

Figure 9. led OFF and led ON

For more details about TML Interrupts visit the following link on Technosoft
Knowledge Base: TML Interrupt Settings.

28
Technosoft 2018 13.08.2018

You might also like