![UIrobot UIM241 Series User Manual Download Page 46](http://html1.mh-extra.com/html/uirobot/uim241-series/uim241-series_user-manual_3289250046.webp)
Page 46
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
13.
If enable auto-feedback, once the motor touches limit switch, user device will receive
a feedback message of falling-edge on port S1/S2.
8.10 Example of ATCONH, ATCONL Configuration
Similar to S12CON configuration, user needs to first fill every bit of the ATCONH (ATCONL)
according to the information provided in previous sections, and then affixes the suffix code
0011 (0010). An example is provided below.
System Description
A reciprocating mobile platform has one linear potentiometer attached to the mobile table.
Within the stroke range, the potentiometer outputs 0.6V ~4V.
Requirements:
1.
As soon as the sensor output is less than 0.6V, the stepper motor starts to run
forward until the potentiometer outputs arrives 4V.
2.
As soon as the sensor output is higher than 4V, the stepper motor starts to run
backward until the potentiometer outputs reaches 0.6V.
Realization:
1.
First stop the motor by sending:
OFF;
2.
Set MCFG<ANE>=1, MCFG<CHS> =0, MCFG<S1IE> =1, get:
MCFG = 1000 0000 0000 0001 (binary) = 0x8001 (hex) = 32769 (decimal)
3.
Send instruction:
MCF x8001;
or
MCF 32769;
4.
It is required Start and Run Forwardly on S1 falling edge (when analog input < 0.6V),
therefore, S1FACT<3:0> =1010
5.
It is required Start and Run Reversely on S1 rising edge (when analog input >4V),
therefore, S1RACT<3:0> =0010
6.
Fill the S12CON with above bits, get: S12CON = 0000 0000 0010 1010 (binary)
7.
Add suffix-code 0000 (for S12CON), get:
SCFG = 0000 0000 0010 1010 0000 (binary)= 0x2A0 (hex)= 672 (decimal)
8.
Send instruction:
SCF x2A0;
or
SCF 672;
9.
Calculate the upper limit:(4V/5V)*4095 = 3276 = 0000 1100 1100 1100
(
binary
)
10.
Add suffix-code 0011 (for ATCONH), get:
SCFG= 0000 1100 1100 1100 0011 (binary)= 0xCCC3 (hex)= 52419 (decimal)
11.
Send instruction
SCF xCCC3;
or
SCF 52419;
12.
Calculate the lower limit:
(
0.6V/5V
)
*4095 = 491 (value is rounded)= 0000 0001
1110 1011 (binary)
13.
Add suffix-code 0010 (for ATCONL), get:
SCFG= 0000 0001 1110 1011 0010 (binary)= 0x1EB2 (hex)= 7858 (decimal)
14.
Send instruction:
SCF x1EB2;
or
SCF 7858;
15.
Set desired speed, by sending instruction:
SPD 5000;
16.
Burn parameters into EEPROM, by sending:
STO;
17.
Send instruction:
ENA;
18.
The system starts to work continuously.
19.
Disconnect the user device, and restart the UIM241 controller, the system will
automatically run.