Collision Avoid
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.
2. Application flowchart:
Execute Homing
1
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
2
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
3. ESM implementation:
Axis 1:
3
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
Axis 2:
4
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
5
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
Axis 3:
6
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
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.
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:
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
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:
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:
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:
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.
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:
12
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
1
2
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:
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
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:
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:
18
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
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:
20
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
In this
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
Step 10:
22
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
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:
23
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
Step 12:
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:
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
26
Technosoft 2018 13.08.2018
APPLICATION NOTE #12 Collision Avoid
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
For more details about TML Interrupts visit the following link on Technosoft
Knowledge Base: TML Interrupt Settings.
28
Technosoft 2018 13.08.2018