Beruflich Dokumente
Kultur Dokumente
106
12/23/05
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
Problem:
Solution:
Drive
Description:
S/W environment :
S/W application
P091.042.IM23x-MA.APN-MOT.106.x.msq
The application implements a speed control with external motion reference read
from an analog input (0V to +5V). For this purpose, a potentiometer (REF) can
be used, connected to the IM23x-MA drive as you can see in figure 1. 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.
This application also uses the ENABLE input line in order to activate/deactivate
the motion.
The limit switches are active on level that means only the movements in the
opposite directions are allowed while the limit switch is active. As soon as the
limit switch is off (becomes inactive) the movement is allowed on both
directions.
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.106.x.zip extract
P091.042.IM23x-MA.APN-MOT.106.x.msq into the ..\ESM\Archives folder.
the
file
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 (see the section 3.B. Drive setup of P091.042.IM23xMA.APN-DOC.101.x.pdf document).
Technosoft 2005
APN.106 - 1
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
6. For this application, the drive must be configured in speed control mode with analogue external
reference read from the potentiometer REF (see figure 1). In the External Reference Setup,
at Analogue, set the Maximum Speed equal with 900 rpm and Minimum Speed equal with
900 rpm (see figure 3) and connect the potentiometer to the IM23x-MA drive as you can see in
figure 1.
IM23x - MA v1.1
Analog Inputs
Connection
J2
TM
GND
REF
10K
0..5V
470 R
5V/DEF
MotionChip
30K
+5V
Internally Generated
DEFAULT
9
470 R
+3.3V
Technosoft 2005
APN.106 - 2
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
Figure 2. Drive window settings for external speed reference read from an analogue input
Technosoft 2005
APN.106 - 3
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
CheckAndWaitEnable
WaitForLSNtoBecomeInactive
WaitForLSPtoBecomeInactive
The TML functions defined are listed in the Project window left side, in the current application,
as a sub-tree of the Functions section.
Technosoft 2005
APN.106 - 4
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
on the
Import the motion sequences by selecting a function and press the Import button
right toolbar. You will be prompted to select from ..\ESM\Arhives folder a .msq file. Select the
appropriate motion sequence file for each function.
10. In the Project 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 int6 - LSP programmed transition detection from Interrupts
branch. Import the interrupt sequence file P091.042.IM23x-MA.APN-INT6.106.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 P091042.IM23x-MA.APN-INT6.106.x.msq
12. Select from window left side int7 - LSP programmed transition detection from Interrupts
branch. Import the interrupt sequence file P091. 042.IM23x-MA.APN-INT7.106.x.msq by
. You will be prompted to select from
pressing the Import icon on the right
..\ESM\Arhives folder a .msq file. Select the file P091. 042.IM23x-MA.APN-INT7.106.x.msq
Technosoft 2005
APN.106 - 5
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
Application running:
In order to run your application, follow the next steps:
1. Power up the intelligent motor IM23x-MA.
2. Download the setup, using the menu command Application | Setup | Download to
Drive/Motor or by pressing the correspondent button from EasyMotion Studio toolbar
3. Download and execute the programmed motion sequences, by pressing the button from
4.
5.
6.
7.
8.
9.
10.
11.
For more details about other configuration for your application, using of data analysis tools and
saving your project/application please refer to P091.042.IM23x-MA.APN-DOC.101.x.pdf document
(Getting started using IM23x-MA).
Technosoft 2005
APN.106 - 6
IM23x-MA
Using the Limit Switches and Enable inputs with analogue 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 4. How to generate Limit Switch and Enable events on IM23x-MA
Technosoft 2005
APN.106 - 7
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
Implementation:
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 status of the
ENABLE input in order to activate/deactivate the motion. In the flow-chart below is shown the
principle structure of the application
Start the Motion
sequences
CheckAndWaitEnable
flag_LSP = 0
flag_LSN = 0
LSP_state = 0
LSN_state = 0
ENABLE =1 ?
NO
RET
CALL
"WaitForLSNtoBecomeInactive"
CALL
"WaitForLSPtoBecomeInactive"
YES
flag_LSN = 0 ?
NO
flag_LSP = 0 ?
NO
CALL
"CheckAndWaitEnable"
CALL
"CheckAndWaitEnable"
NO
YES
flag_LSP = 0
CALL
"CheckAndWaitEnable"
NO
YES
flag_LSN = 0
Technosoft 2005
APN.106 - 8
InterruptService
Service
Routine
Lim
it Sw itch+
Interrupt
Routine
forfor
Limit
Switch+
YES
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
InterruptService
Service
Routine
Lim
it Sw itchInterrupt
Routine
forfor
Limit
Switch-
NO
Speed Reference
Reference << 00 ??
YES
Speed Reference
Reference >> 00 ??
W
ait for Relative
e to
Wait
Relative Tim
Time
to avoid
avoid
ultiple transitions
s)
the m
multiple
transitions (5m
(5ms)
LSP_state
= IN#2/LSP
LSP_state
= LSP
YES
LSP_state =
= 01 ??
NO
LSN_state
= LSN
LSN_state
= IN#24/LSN
YES
NO
NO
LSN_state
LSN_state == 01 ??
flag_LSP =
flag_LSP
= 11
flag_LSN =
flag_LSN
= 11
otor by
Stop the m
motor
by applying
applying 00
speed reference
reference with
with
acceleration profile
acceleration
profile (Stop3)
(Stop3)
otor by
Stop the m
motor
by applying
applying 00
speed reference
reference with
with
acceleration profile
acceleration
profile (Stop3)
(Stop3)
CALL
"W
aitForLSPtoBecom eInactive"
"WaitForLSPtoBecomeInactive"
CALL
"W aitForLSNtoBecom eInactive"
"WaitForLSNtoBecomeInactive"
edge
Enable LSP
LSP for
for falling
rising edge
edge
Enable LSN
LSN for
for falling
rising edge
RETI
RETI
W aitForLSPtoBecom eInactive
WaitForLSPtoBecomeInactive
W aitForLSNtoBecom eInactive
WaitForLSNtoBecomeInactive
LSP_state
= LSP
LSP_state
= IN#2/LSP
LSN_state
= LSN
LSN_state
= IN#24/LSN
NO (LSP
(LSP inactive)
inactive)
LSP_state == 01 ??
NO (LSN
(LSN inactive)
inactive)
LSN_state == 01 ??
NO
Speed Reference
Reference << 00 ??
otor (Stop3)
Stop the m
motor
(Stop3)
YES
NO
NO
Speed Reference
Reference >> 00 ??
Start with
with negative
negative
reference
reference
otor (Stop3)
Stop the m
motor
(Stop3)
Technosoft 2005
APN.106 - 9
YES
Start with
with positive
positive
reference
reference
NO
NO
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
Technosoft 2005
APN.106 - 10
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
To get details about how the motion sequences are configured in the window above, double-click
on the motion sequence for which you need details.
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 Interrupt, to open this window:
Figure 7. How to edit the Interrupts for Int6 Limit Switch Positive and Int7 Limit Switch Negative
Technosoft 2005
APN.106 - 11
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
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.106 - 12
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
Technosoft 2005
APN.106 - 13
IM23x-MA
Using the Limit Switches and Enable inputs with analogue reference
Technosoft 2005
APN.106 - 14