Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
105
12/23/05
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
Problem:
In some applications, the host sends a speed reference to the drive, and the
motor moves with the reference speed, in a speed control loop. Reaching a
position limit switch stops the motor, until the host sends a speed reference in
the opposite direction. The drive ENABLE input needs to be used to activate /
deactivate the motion. The motion is activated only in the presence of the drive
ENABLE signal. Also, you can use the limit switches and internal reference to
position the motor in the middle of an interval defined by the left margin and the
right margin.
Solution:
Drive
S/W environment :
S/W application
Description:
P091.042.IM23x-MA.APN-MOT1.105.x.msq
P091.042.IM23x-MA.APN-MOT2.105.x.msq
The application implements a speed control with external motion reference read
on-line through RS-232. The motor movement is limited between two limit
switches. There are two Limit Switch inputs on IM23x-MA (LSP and LSN), which
are used for this purpose. The motor will be stopped as soon as it reaches a
limit switch and you can start it again only in the opposite direction. The
application uses also the ENABLE input in order to activate/deactivate the
motion.
A second part implements a position control with internal generated reference.
The motor movement is limited between two margins (defined by the limit
switches) and then the motor is centered in the middle of the moving interval.
:
Project set-up:
1. Install EasyMotion Studio on your PC. Please find the setup kit on our web site.
2. From the attached archive P091.042.IM23x-MA.APN-DOC.105.x.zip extract the files
P091.042.IM23x-MA.APN-MOT1.105.x.msq and P091.042.IM23x-MA.APN-MOT2.105.x.msq
into the ..\ESM\Archives folder.
3. Perform all the hardware connections as it is explained in P091.042.IM23x-MA.APNDOC.101.x.pdf document (Getting started using IM23x-MA).
4. Start EasyMotion Studio, then create a new project using the template IM23x IM23x-MA
(see the section 1. Create a new project of P091.042.IM23x-MA.APN-DOC.101.x.pdf
document).
5. Setup the intelligent motor for speed and position control (see the section 3.B. Drive setup of
P091.042.IM23x-MA.APN-DOC.101.x.pdf document).
Technosoft 2005
APN.105 - 1
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
6. Import the motion file P091.042.IM23x-MA.APN-MOT1.105.x.msq (for the first part of the
application) or P091.042.IM23x-MA.APN-MOT2.105.x.msq (for the second part) in your
application by selecting Application | Motion | Import Sequence menu. You will be
prompted to select from ..\ESM\Archives folder a .msq file. Select the file P091.042.IM23xMA.APN-MOT1.105.x.msq or P091.042.IM23x-MA.APN- MOT2.105.x.msq.
NOTE: You must import the two .msq files in two separate applications of the project, or in
two separate projects.
7. In the window left side please select Interrupts and check User defined for int 6 LSP
programmed transition detection and int 7 LSN programmed transition detection.
8. Select from window left side int-6 LSP programmed transition detection from Interrupts
branch. Import the interrupt sequence file P091.042.IM23x-MA.APN-INT6.1.105.x.msq by
pressing the Import icon on the right
. You will be prompted to select from
..\ESM\Arhives folder a .msq file. Select the file P091.042.IM23x-MA.APN-INT6.1.105.x.msq
9. Select from window left side int-7 LSN programmed transition detection from Interrupts
branch. Import the interrupt sequence file P091.042.IM23x-MA.APN-INT7.1.105.x.msq by
pressing the Import icon on the right
. You will be prompted to select from
..\ESM\Arhives folder a .msq file. Select the file P091.042.IM23x-MA.APN-INT7.1.105.x.msq
10. In the second application in the window left side select Interrupts and check User defined for
int 6 LSP programmed transition detection and int 7 LSN programmed transition
detection.
11. Select from window left side int-6 LSP programmed transition detection from Interrupts
branch. Import the interrupt sequence file P091.042.IM23x-MA.APN-INT6.2.105.x.msq by
pressing the Import icon on the right
. You will be prompted to select from
..\ESM\Arhives folder a .msq file. Select the file P091.042.IM23x-MA.APN-INT6.2.105.x.msq
12. Select from window left side int-7 LSN programmed transition detection from Interrupts
branch. Import the interrupt sequence file P091.042.IM23x-MA.APN-INT7.2.105.x.msq by
pressing the Import icon on the right
. You will be prompted to select from
..\ESM\Arhives folder a .msq file. Select the file P091.042.IM23x-MA.APN-INT7.2.105.x.msq
Technosoft 2005
APN.105 - 2
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
Technosoft 2005
APN.105 - 3
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
IM23x - MA v1.1
J3
24V_IO
LOAD
READY
Optical
isolation
OUT#25
3
50 mA max
LOAD
Optical
isolation
GPO
OUT#16
50 mA max
5...24V
+
MotionChipTM
GND IO
GND IO
ENABL
LSP
LSN
GPI1
GPI2
2
6
2.5 K
7
Optical
isolation
GND IO GND
ENABLE
LSP
+3.3V
LSN
Figure 1. How to generate Limit Switch and Enable events on IM23x-MA
Technosoft 2005
APN.105 - 4
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
Implementation:
In the flow-chart below is shown the principle structure of the application:
Start the Motion
sequences
flag_LSP = 0
flag_LSN = 0
LSN_state = 0
LSP_state = 0
CACC = 100
NO
ENABLE = 1 ?
YES
YES
flag_LSN = 0 ?
flag_LSP = 0 ?
NO
NO
NO
ENABLE = 1 ?
YES
YES
ENABLE = 1 ?
NO
NO
YES
flag_LSP = 0
NO
ENABLE = 1 ?
YES
NO
YES
flag_LSN = 0
Technosoft 2005
APN.105 - 5
YES
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
NO
YES
NO
LSP_state = IN#2/LSP
LSN_state = IN#24/LSN
YES
LSP_state = 0 ?
YES
NO
LSN_state = 0 ?
flag_LSP = 1
flag_LSN = 1
RETI
RETI
NO
The application purpose is to limit the motor movement between two limits by using two digital
inputs (Limit Switch inputs LSP and LSN) Also the application take into account the ENABLE input
which activate/deactivate the motion.
Technosoft 2005
APN.105 - 6
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
Figure 3. How to use Command Interpreter window to send external on-line reference
The application structure above is implemented in the Main section of the TML program. Select
the M Motion item in your application tree to view this section.
Technosoft 2005
APN.105 - 7
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
4, 6 5
4
5
6
7
8
The figure 4 shows you which buttons were used in order to generate the motion sequences. To
get details about how the motion sequences were configured in the window above, double-click in
the areas marked with 1 to 8.
To see how the Interrupts for Limit Switch Positive (LSP) and Limit Switch Negative (LSN) are
implemented please follow the next steps:
1. In the project window left side, in your application select Interrupts, to open this window:
Technosoft 2005
APN.105 - 8
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
Figure 5. How to edit the Interrupts for Int6 Limit Switch Positive and Int7 Limit Switch Negative
2. Check User Defined and then in the window left side choose int 6 LSP programmed
transition detected
3. Check User Defined and then in the window left side choose int 7 LSN programmed
transition detected
Technosoft 2005
APN.105 - 9
Technosoft 2005
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
APN.105 - 10
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
Implementation:
In the flow-chart below is shown the principle structure of the application:
Start the Motion
sequences
Enable LSP
Technosoft 2005
APN.105 - 11
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
Enable LSN
RETI
RETI
The application purpose is to sense the two margins of an interval (left margin represented by LSP
and right margins represented by LSN) and then to center the motor in the middle of the interval
and reset its zero position to the center of the interval, thus preparing the motor for further
movement. Also, its purpose is to show how you can do the limit switch position capture without
using a capture interrupt.
Technosoft 2005
APN.105 - 12
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
Technosoft 2005
APN.105 - 13
Technosoft 2005
IM23x-MA
Using the Limit Switches and Enable inputs with on-line or internal reference
APN.105 - 14