UIrobot UIM241 Series User manual

User Manual
UIM241XX Series
RS232 Instruction Control
Miniature Integrated Stepper Motor Controller
(Closed-loop)
V1.2

Page 2
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
Please pay attention to the following before using the UIROBOT products:
1.UIROBOT products meet the specification contained in their particular Data Sheet.
2.UIROBOT will only work with the customer who respects the Intellectual Property (IP) protection.
3.Attempts to break UIROBOT’s IP protection feature may be a violation of the local Copyright Acts. If such acts lead to unauthorized
access to UIROBOT’s IP work, UIROBOT has a right to sue for relief under that Act.
Information contained in this publication regarding controller applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications.
UIROBOT MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED,
WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED
TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. UIROBOT disclaims
all liability arising from this information and its use. Use of UIROBOT products in life support and/or safety applications is
entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless UIROBOT from any and all damages,
claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any UIROBOT
intellectual property rights.
[Trade Mark/ Layout-design/Patent]
The UIROBOT name and logo are registered trademarks of UIROBOT Ltd. in the P.R. China and other countries.
UIROBOT’s UIM24XXX series Step Motor Controllers, UIM25XX series CAN-RS232 Converter and their layout designs are
patent protected.
[Contact]
SHANGHAI UNITED INTELLIGENCE ROBOTICS INC.
ADD : Rm 202-203, Building Y2, No, 112 Liang Xiu Rd, Zhangjiang Innopark,Shanghai,China
Z I P : 201203
T E L :021 – 61182435(sales,Marketing)
F A X:021 – 61182431
N E T:www.uirobot.com
Email:info@uirobot.com
[UIM241XX Ordering Information]
In order to serve you quicker and better, please provide the product number in following format.
UIM241XX PART NUMBERING SYSTEM
Note:
1)Peak current is decided by max. supply voltage (See in Table 0-1).
2)Default control connector is T (screw terminal), if not selected.
Table 0-1 Correspondence between Max. Supply Voltage and Peak Current
Voltage
Current
L(28V)
C(40V)
H(48V)
2A
√
√*
√*
T
MSP
-
Category
Motor
Control
2
4
1
UIM
0
2
02 = 2A; 04 = 4A; 08 = 8A
Peak Current
E / IE = External / Internal Encoder Closed-
Loop
M = Advanced Motion Control
T = Screw Terminal; P = Plug / Socket;
Control
Connector
L
L = 28V; C =40V; H=48V
Maximum
Supply Voltage
SP = I/O Control
Function
(Optional)
Series
RS232
Control
PG = Host-free Program Control

UI Robot Technology Co. Ltd.
M4120170509EN
Page 3
UIM241 Miniature Integrated Stepper Motor Controller(Closed-loop)
4A
×
√
√*
8A
×
√
√*
*: Custom-made, please contact with salesmans before purchase.
Examples:
UIM241L02P; UIM241C04T-MS; UIM241C08P-IE;
Examples of Control Connector options:
Screw Terminal Rectangular Plug / Socket

Page 4
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
UIM24102 / 04 / 08
RS232 Instruction Control
Miniature Integrated Stepper Motor Contrller
Miniature Integral Design
Miniature size 42.3mm*42.3mm*16.5mm
Fit onto motors seamlessly
Die-cast aluminum enclosure, improving
heat dissipation and durability
Motor Driving Characteristics
Wide supply voltage range 12 ~ 48VDC
Output current 2/4/8A, instruction adjustable
Full to 16th micro-step resolution
Dual full H-bridge with PWM constant
current control
Accurate micro-stepping and current control
Network Communication
RS232 three-wire serial communication
Max baud rate 57600 bps
Embedded DSP Microprocessor
Firmware DSP, 64bits calculating precision
Absolute position record/feedback, reset by
instruction or sensor
Quadrature encoder based closed-loop
control
Advanced motion control,linear and non-
linear acceleration and deceleration, S-
curve, PT/PVT displacement control
2 sensor input ports
8 programmable real-time event-based
change notifications
13 programmable actions triggered by 6
sensor events
Simple instructions
Intelligent control, intuitive and fault-
tolerating
GENERAL DESCRIPTION
UIM24102 / UIM24104 / UIM24108 are miniature stepper motor controllers with RS232
interface. UIM241 controllers can be mounted onto NEMA17/23/34/42 series stepper
motor through adapting flanges. User device can command these controllers through
RS232 protocol using ASCII coded instructions. Instructions are simple, intuitive and fault-
tolerating. User is not required to have advanced knowledge on stepper motor driving.
UIM241 can realize open-loop and encoder-based closed-loop control. UIM241’s
architecture includes communication system, basic motion control system, absolute
position counter, quadrature encoder interface and real-time event-based change
notification system. Furthermore, there are three optional modules can be installed per
customer request: Advanced Motion Control Module (linear/non-linear
acceleration/deceleration, S-curve PT/PVT displacement control), Encoder-based Closed-
loop Control Module and Sensor Input Control Module.
Embedded 64-bit calculating precision DSP controller guarantees the real-time processing
of the motion control and change notifications. Entire control process is finished within 1
millisecond.
Enclosure is made of die-cast aluminum to provide a rugged durable protection and
improves the heat dissipation.

UI Robot Technology Co. Ltd.
M4120170509EN
Page 5
UIM241 Miniature Integrated Stepper Motor Controller(Closed-loop)
TERMINAL DESCRIPTION
Figure0-1: Terminal Description
Control Terminals
Terminal
No.
Designator
Description
1
V+
Supply voltage, 12 - 48VDC
2
GND
Supply voltage ground
3
RX
To the RX pin on user device
4
TX
To the TX pin on user device
5
GND
To signal ground on user device
6
AG
Analog ground for sensors
7
S1
Sensor input port 1
8
S2
Sensor input port 2
9
RST
Reset R232 baud rate to 9600
Motor Terminals
Terminal No.
Description
A+ / A-
Connect to the stepper motor phase A
B+ / B-
Connect to the stepper motor phase B
WARNING: Incorrect connection of phase winds will permanently damage the controller!
Resistance between leads of different phases is usually > 100KΩ. Resistance between
leads of the same phase is usually < 100Ω. It can simply measured by a multimeter.
WARNING: Except supply voltage port and motor terminal, voltage on port must be kept
between -0.3~5.3V. Otherwise, the controller will be damaged.
Control Termianals
Motor
Terminals
A+
A-
B-
B+
V+
GND
TX
RX
GND
AG
S1
S2
RST
1
9

Page 6
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
Attention:
If no special instructions, users use UIROBOT controllers must strictly follow the
specification that one controller can only drive one motor. Be careful to avoid connecting
more than one motor to the controller. The user should be responsible for the loss caused
by that error operation, our company will be not responsible for it.

UI Robot Technology Co. Ltd.
M4120170509EN
Page 7
UIM241 Miniature Integrated Stepper Motor Controller(Closed-loop)
TYPICAL APPLICATION
Wiring of UIM241 is simple.
UIM241xx controllers use 3-wire RS232 interface to communicate with user devices.
Terminal 3 should be connected to the RX of user device; Terminal 4 should be connected
to the TX of user device; Terminal 5 should be connected to the GND of user device. An
example is provided in figure 0-2. User can use an existing RS232 cable or a converted
cable.
If the sensor inputs are used, make sure the signal are wired to the terminal 7 and/or
terminal 8, and the signal ground are wired to the terminal 6. Furthermore, please be aware:
•User is responsible for the power supply for sensors,
•Voltage on terminal 7 and 8 must be kept between -0.3V and 5.3V
•If using an external encoder, channel A should be connected to S1; channel B to S2;
GND to AG
Figure 0-2: Typical Application
•
12 ~ 48VDC
Stepper motor
PIN2 to RX (UIM terminal 3)
PIN3 to TX (UIM terminal 4)
PIN5 to GND (UIM terminal 5)
UIM241XX
Controller
1
2
3
4
5
7
8
6
TX
RX
V+
GND
GND
AG
S1
S2
Sensor 1
Sensor 2
A+
A-
B-
B+
9
Terminal 9 is for resetting
Baud Rate (details in
chapter 3.4)
RST

Page 8
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
INSTRUCTION SET SUMMARY
Network Communication
Instruction
Description
Feedback
Header
Message
ID
Page
BDR;
Set RS232 communication baud rate
AA
BD
57
Model Check
Instruction
Description
Feedback
Header
Message
ID
Page
MDL;
Check the model of controller
CC
DE
74
Function Configuration
Instruction
Description
Feedback
Header
Message
ID
Page
ENA;
Set enable time, boot time after ms enable
AA
A0
62
ENAxFFFF;
Check enable time
AA
A0
63
ICF;
Set initial configuration register
AA
DA
65
ICF;
Check initial configuration register
AA
DA
66
MCF;
Set master configuration register
AA
B0
69
MCF;
Check master configuration register
AA
B0
70
SCF;
Set sensor control configuration register
AA
C0
86
SCF;
Check sensor control configuration register
AA
C0
87
General Check
Instruction
Description
Feedback
Header
Message
ID
Page
;
Check desired motor status
AA
-
54
FBK;
Check current motor status
CC
-
64
SFB;
Check sensor status
CC
C1
88
Motor Configuration
Instruction
Description
Feedback
Header
Message
ID
Page
ACR;
Set auto-current reduction ratio
AA
-
55
ACR;
Check auto-current reduction ratio
AA
BA
56
CUR;
Set output phase current
AA
-
60
ENA;
Enable H-bridge circuit
AA
-
61
MCS;
Set micro-stepping resolution
AA
-
71
OFF;
Disable H-bridge circuit
AA
-
79

UI Robot Technology Co. Ltd.
M4120170509EN
Page 9
UIM241 Miniature Integrated Stepper Motor Controller(Closed-loop)
Motion Control
Instruction
Description
Feedback
Header
Message
ID
Page
BLC;
Set backlash compensation value η
AA
DE
58
BLC;
Check backlash compensation value
AA
DE
59
MAC;
Set acceleration rate
AA
B1
67
MAC;
Check acceleration rate
AA
B1
68
MDE;
Set deceleration rate
AA
B2
72
MDE;
Check deceleration rate
AA
B2
73
MMD
Set maximum cessation speed
AA
B4
75
MMD;
Check maximum cessation speed
AA
B4
76
MMS;
Set maximum starting speed
AA
B3
77
MMS;
Check maximum starting speed
AA
B3
78
ORG;
Set zero/origin position
AA
B7
80
ORG;
Reset the position to a given value
AA
B7
81
SPD;
Set the desired speed
AA
B5
89
SPD;
Check current speed
CC
B2
90
STO;
Store motion control parameters
AA
D1
94
STO;
Bind motion control parameters to sensor edge
AA
D1
95
STP;
Set desired incremental displacement
AA
B6
96
STP;
Check current incremental displacement
CC
B3
97
I/O Control
Instruction
Description
Feedback
Header
Message
ID
Page
STG;
Set digital input sampling mode
AA
C9
92
STG;
Check digital input sampling mode
AA
C9
93
Closed-Loop Control
Instruction
Description
Feedback
header
Message
ID
Page
QECη;
Set desired quadrature encoder’s position η
AA
B8
82
QEC;
Check current quadrature encoder’s position
CC
B1
83
QERη;
Set quadrature encoder’s resolution η
AA
C2
84
QER;
Check quadrature encoder’s resolution
AA
C2
85
SQT;
Set tolerance of blocked alarm
AA
B8
91

Page 10
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
CHARACTERISTICS
Absolute Maximum Ratings
Supply voltage......................................................................................................................... 10V to 40V
Voltage on S1/S2 with respect to GND..................................................................-0.3V to +5.3V
Maximum output current sunk by S1/S2...................................................................................20 mA
Maximum output current sourced by S1/S2.............................................................................20 mA
Voltage on RX with respect to GND...................................................................................... -25V to +25V
Voltage on TX with respect to GND.............................................................................. -13.2V to +13.2V
Ambient temperature under bias....................................................................................... -20°C to +85°C
Storage temperature........................................................................................................ -50°C to +150°C
NOTE:Working under environment exceeding the above maximum value could result in permanent damage to controller.
Working under conditions at the maximum value is not recommended as operation at maximum value for extended period
may have negative effect on device reliability.
Electrical Characteristics(Ambient Temperature 25°C )
Supply Power Voltage
12V - 48VDC
Motor Output Current
Max 2A/4A/8A per phase (instruction adjustable)
Driving Mode
PWM constant current
Stepping Resolution
full-step, half-step, 1/4, 1/8 and 1/16 step
Communication (Ambient Temperature 25°C)
Protocol
RS232
Wiring method
3-wire: TX, RX, GND
Baud Rate
Max 57600 bps, instruction adjustable, Firmware reset to 9600
Environment Requirements
Cooling
Free air
Working environment
Avoid dust, oil mist and corrosive gases
Working temperature
-40 °C ~ 85°C
Humidity
<80%RH,no condensation, no frosting
Vibration
3G Max
Storage temperature
-50 °C ~ 150 °C
Size and Weight
Size
42.3mm x 42.3mm x 16.5mm
Weight
0.1 kg

UI Robot Technology Co. Ltd.
M4120170509EN
Page 11
UIM241 Miniature Integrated Stepper Motor Controller(Closed-loop)
CONTENTS
General Description ...................................................................................................................4
Terminal DESCRIPTION.............................................................................................................5
Typical Application.....................................................................................................................7
Instruction set summary............................................................................................................8
Characteristics..........................................................................................................................10
1.0 Overview.....................................................................................................................14
1.1 Basic Control System..................................................................................................14
1.2 Advanced Motion Control Module...............................................................................15
1.3 Sensor Input Control Module.......................................................................................15
1.4 Encoder-based Closed-loop Control Module..............................................................16
1.5 Instructions and Interface............................................................................................16
2.0 Instruction and Feedback Structure........................................................................17
2.1 Instruction Structure ....................................................................................................17
2.2 Macro Operator and Null Instruction ...........................................................................17
3.0 RS232 communication..............................................................................................19
3.1 User Device RS232 Port Configuration.......................................................................19
3.2 Hand-Shaking..............................................................................................................19
3.3 Reset Baud Rate to Factory Default 9600 ..................................................................19
3.4 Instruction List .............................................................................................................20
4.0 Real-time Change Notification.................................................................................21
4.1 RTCN Structure...........................................................................................................21
4.2 Enable/Disable RTCN.................................................................................................21
5.0 initial and HARDware/Firmware Configuration......................................................22
5.1 Initial Configuration Register (Firmware version: 1232 or higher) ..............................22
5.2 Auto-enable.................................................................................................................23
5.3 User Program ..............................................................................................................23
5.4 Master Configuration Register.....................................................................................23
5.5 Instruction List .............................................................................................................24
6.0 Basic Control Instructions .......................................................................................25
6.1 General Introduction of Motion Control Modes ...........................................................25
6.2 Basic Instruction Acknowledgment (ACK)...................................................................28
6.3 Motor Status Feedback Message ...............................................................................29
6.4 Instruction List .............................................................................................................30
7.0 Advanced Motion Control.........................................................................................31
7.1 Linear Acceleration......................................................................................................31
7.2 Linear Deceleration .....................................................................................................31
7.3 Nonlinear Acceleration ................................................................................................31
7.4 Nonlinear Deceleration................................................................................................33
7.5S-curve Displacement Control.....................................................................................34
7.6 Direction Control and Position Counter.......................................................................35
7.7 Backlash Compensation..............................................................................................36
7.8 Advanced Motion Control Instructions ........................................................................36
7.9 Enable/disable Advanced Motion Control Module (MCFG)........................................37

Page 12
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
7.10 Instruction List .............................................................................................................37
8.0 Sensor Input Control.................................................................................................39
8.1 Rising and Falling Edge ..............................................................................................40
8.2 Analog Input and Thresholds ......................................................................................40
8.3 Digital Input Sampling Mode .......................................................................................41
8.4 Sensor Event, Action and Binding...............................................................................41
8.5 Introduction to Sensor Input Control Instructions........................................................42
8.6 Sensor Input Control Register S12CON .....................................................................43
8.7 Analog Threshold Control Register ATCONH & ATCONL .........................................43
8.8 Instruction List .............................................................................................................45
8.9 Example of S12CON Configuration ............................................................................45
8.10 Example of ATCONH, ATCONL Configuration...........................................................46
9.0 encoder and closed-loop control ............................................................................48
9.1 Enable/ Disable Encoder and Closed-loop Module (MCFG)......................................48
9.2 Instruction List .............................................................................................................49
10.0 instruction..................................................................................................................50
10.1 Instruction Structure ....................................................................................................50
10.2 Feedback Message Structure .....................................................................................50
10.3 Instruction Description.................................................................................................54
1. ; Check desired motor status.......................................................................................54
2. ACRη Set auto-current reduction ratio........................................................................55
3. ACR Check auto-current reduction ratio.....................................................................56
4. BDRSet RS232 Baud Rate......................................................................................57
5. BLCη Backlash compensation ....................................................................................58
6. BLC Check backlash compensation ...........................................................................59
7. CURη Motor Current Adjusting....................................................................................60
8. ENA H-Bridge Enable..................................................................................................61
9. ENAη Set enable time .................................................................................................62
10. ENAxFFFF Check enable time....................................................................................63
11. FBK Motor Status Feedback Inquiry...........................................................................64
12. ICFxη Initial Configuration Register Instruction...........................................................65
13. ICF Check Initial Configuration Register....................................................................66
14. MACη Set Acceleration Rate.......................................................................................67
15. MAC Check Current Acceleration Rate.......................................................................68
16. MCFη / MCFxη Master Configuration Register Instruction .........................................69
17. MCF Check Master Configuration Register................................................................70
18. MCSη Setup Micro Stepping.......................................................................................71
19. MDEη Set Deceleration Rate ......................................................................................72
20. MDE Check Current Deceleration Rate......................................................................73
21. MDL Check Controller Model......................................................................................74
22. MMDη Set Maximum Cessation Speed ......................................................................75
23. MMD Check current Maximum Cessation Speed.......................................................76
24. MMSη Set Maximum Starting Speed ..........................................................................77
25. MMS Check current Maximum Starting Speed...........................................................78
26. OFF H- Bridge Disable................................................................................................79
27. ORG Reset Position Counter......................................................................................80
28. ORGη Reset Position Counter ....................................................................................81

UI Robot Technology Co. Ltd.
M4120170509EN
Page 13
UIM241 Miniature Integrated Stepper Motor Controller(Closed-loop)
29. QECη Set desired quadrature encoder’s position......................................................82
30. QEC Check current encoder position..........................................................................83
31. QERη Set Quadrature Encoder Resolution ................................................................84
32. QER Check quadrature encoder resolution................................................................85
33. SCFη / SCFxη Set Sensor Configuration....................................................................86
34. SCF Check the value of Sensor Configuration...........................................................87
35. SFB Check Sensor Data.............................................................................................88
36. SPDη Speed Adjusting................................................................................................89
37. SPD Check Current Speed .........................................................................................90
38. SQTη Set tolerance of blocked alarm .........................................................................91
39. STGxη Set Digital Input Sampling Mode.....................................................................92
40. STG Check Digital Input Sampling Mode....................................................................93
41. STO EEPROM Store...................................................................................................94
42. STOη Parameter Banding ...........................................................................................95
43. STPη Displacement Control ........................................................................................96
44. STP Check Displacement ...........................................................................................97

Page 14
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
1.0OVERVIEW
UIM241 miniature integrated stepper motor controllers communicate with user device
using RS232 protocol. The user device controls UIM241 through ASCII coded instructions.
Communication baud rate can be changed through instruction
UIM241 has a size of 42.3mm*42.3mm*16.5mm and is designed to mount onto
NEMA17/23/34/42 stepper motors seamlessly. UIM241X02 can provide 0.7-2A output
current; UIM241X04 can provide 1.5-4A output current; UIM241X08 can provide 3-8A
output current. Current value is adjustable within the range through instructions. Once set,
the value is stored in EEPROM. UIM241XX controller also has the function of high speed
current compensation to offset the effect of Back Electromotive Force (BEMF) of motor at
high speed and therefore to facilitate motor’s high-speed performance. UIM241XX series
of controllers work with 12 ~ 48VDC power supply.
UIM241XX can perform encoder-based closed-loop motion control. The control system
comprises communication system, basic motion control system, absolute position counter,
quadrature encoder interface and real-time event-based change notification system. There
are also three optional modules to be added on customer request: Advanced Motion
Module (linear/non-linear acceleration/deceleration, S-curve PV/PVT displacement
control), Encoder-based Closed-loop Control Module and Sensor Input control Module.
The embedded 64-bit calculation precision DSP controller guarantees the real-time
processing of the motion control and change notifications (similar to the interrupters of
CPU). Entire control process is finished within 1 millisecond.
1.1 Basic Control System
UIM241 controller’s basic control system comprises communication system, basic motion
control system, absolute position counter, and real-time event-based change notification
system.
Communication System
UIM241 controller communicates with user device using RS232 protocol. User device
controls the UIM241 controller through ASCII coded instructions. Communication baud rate
can be changed through instruction.
Basic Motion Control
UIM241 has a build-in basic motion control system. User device can control the following
basic motion parameters through instructions in real-time: direction, speed, angular
displacement, phase current, micro-stepping, and enable/disable the H-bridge, etc. Speed
input range is +/-65,000 pulses/sec, and displacement input range is +/- 2,000,000,000
pulses.
Absolute Position Counter / Quadrature Encoder Interface
UIM241 has a hardware pulse counter. The counter can be reset either by user instruction
or automatically by the configurable sensor input event. Under most conditions, through
the advanced motion control, this counter can provide the absolute position of the motor
with enough accuracy. When the counter reaches zero position, there could be
automatically generated message feedback to the user device, given the corresponding
configuration through user instruction.

UI Robot Technology Co. Ltd.
M4120170509EN
Page 15
UIM241 Miniature Integrated Stepper Motor Controller(Closed-loop)
Furthermore, with the encoder-based closed-loop control module, the UIM241 can perform
self closed-loop control. Furthermore, with the encoder-based closed-loop control module,
the UIM241 can perform self closed-loop control.
Real-time Change Notification (RTCN)
Similar to CPU’s interrupters, UIM241XX can automatically generate certain messages
after predefined events and sends them to the user device. The time is less than 1
millisecond from the occurring of the event to the message being sent. Message transfer
time depends on the baud rate of the RS232 setup. The transfer time will be less than 1
millisecond if the baud rate is set to 57600. UIM241XX’s RTCN system supports 8 events:
displacement control done absolution position reset; sensor 1/2 rising edge and falling
edge; analog input beyond upper threshold, analog input lower than lower threshold, etc.
All RTCNs can be enabled or disabled by instructions.
1.2 Advanced Motion Control Module
With advanced motion control module installed, UIM241XX controller can maintain linear
and non-linear acceleration/deceleration, S-curve displacement control, PT/PVT control,
auto direction control, etc. There are two ways to define acceleration/deceleration rate:
1.Value Mode: Input range: 1 ~ 65,000,000 PPS/Sec (pulse/sec2).
2.Period Mode: Input range: 1 ~60,000 milliseconds (time to fulfill the acceleration or
deceleration).
The input range of the displacement control is +/- 2 billion pulses (steps). In advanced
motion control mode, the actual direction is decided by module calculation. When
displacement is in place, there will be a RTCN (Instruction configurable). Advanced motion
control module can be disabled/enabled through user instruction.
1.3 Sensor Input Control Module
UIM241’s Sensor Input Control Module supports 2 channels of sensor input. They can
accept a TTL level input of 0~5V. There is 1 channel can be configured as analog input
(Precision: 12bit; Sample frequency: 50K; mean of 16 calculation; Update frequency:
1000Hz). User can configure the desired automatic action triggered by sensor status
change. There are 13 actions listed below that can be triggered by sensor event:
•Start and run forwardly at preset-speed and acceleration
•Start and run reversely at preset-speed and acceleration
•Change direction and run at preset-speed and acceleration
•Forword displacement control follow the preset motion parameters (speed,
displacement, acceleration)
•Reverse displacement control follow the preset motion parameters (speed,
displacement, acceleration)
•Direction-change displacement control follow the preset motion parameters (speed,
displacement, acceleration)
•Decelerate at preset deceleration until stop
•Emergency stop
•Reset position and encoder counter
•Reset position and encoder counter + Reverse displacement control follow the preset
motion parameters (speed, displacement, acceleration)
•Reset position and encoder counter + Decelerate at preset deceleration until stop
•Reset position and encoder counter + Emergency stop
•Off

Page 16
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
1.4 Encoder-based Closed-loop Control Module
With the encoder-based closed-loop control module, UIM241 controller can perform self
closed-loop motion control. Without this module, UIM241 can still interface with a
quadrature encoder and provide reading to user device, but the self closed-loop is not
available.
1.5 Instructions and Interface
Instructions for UIM241XX are simple, intuitive and fault-tolerating.
For example, in order to command a speed of 1000 steps/sec, the following instructions
are all valid: "SPD = 1000;", "SPD: 1000;", "SPD 1000;", "SPD1000;" or even "SPD %?&%*
1000;".
In case that a wrong instruction is entered, the controller will return an ACK of error
message. Incorrect instructions will not be executed to prevent accidents.
UIROBOT provides free Microsoft Windows based VB / VC demo software and
corresponding source code to facilitate the quick start of user device side programming.

UI Robot Technology Co. Ltd.
M4120170509EN
Page 17
UIM241 Miniature Integrated Stepper Motor Controller(Closed-loop)
2.0INSTRUCTION AND FEEDBACK
STRUCTURE
Once UIM241XX receives a message (instructions) from the user device, it will first ACK
back (repeat) the received instruction, and then execute the instruction. UIM241XX will
further send back a message to inform the user device of the completion of the instruction.
Before a new instruction is received, UIM241XX will keep current working status (e.g.
running, stop, etc.)
2.1 Instruction Structure
An instruction is a message sent from the user device to UIM241 to Comment certain
operation. Instructions of UIM241 follow the rules listed below:
INS η; or INSx η; or INS;
Instruction symbol INS comprises three letters with no space between them, and is not
case sensitive. If there is an x (INSx), then it means the value is hexadecimal. Value η
comprises set of numbers. Some instructions have no value, such as “SPD;”, “STP;” etc.
Each instruction must end with semicolon (;). Instruction without semicolon will cause
unpredictable results.
Feedback Message is the message sent to user device from UIM241 controller. The
maximum length of feedback messages is 13 bytes.
Feedback messages from UIM241 follow the structure below:
[Header] [Controller ID] [Message ID] [Data] [Terminator]
There are 3 kinds of headers: AA、CC and EE.
Controller ID the identification number of current controller in a network (also known as
Node ID). For UIM241, it is always 00..
Message ID denotes the property of the current message.
Data has a 7bits data structure. High is in front, and low is in the back. The 7bits data can
be translated into 16bits data through the shifting operation. One 16bit data takes three
7bits data to represent.
Terminator denotes the end of a feedback message. UIM241 controller utilizes “FF” or
“FE” as the terminator. If terminator is “FF”, it means there is no follow-up message; If
terminator is “FE”, it means there has follow-up messages.
Note: there are two types of feedback that has NO message ID: ACK message and Motor
Status feedback (controller’s response to FBK instruction). Other messages could have
NO data, such as some real-time change notification messages.
2.2 Macro Operator and Null Instruction
In practice, users will combine several instructions together and send them at once.
Normally, the user device will receive an ACK message on every instruction sent, these
message will cause pressure on CAN bus. Especially for those basic motion instructions
like SPD, DIR, MCS, which have the same ACK, sending a set of ACK is unnecessary. For
example:
CUR 20; MCS 16; SPD 5000; ENA;

Page 18
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
The above instruction set will cause 4 ACK messages being transferred on the RS232 bus.
To facilitate the above situation, user can use the following method to send a set of
instructions:
{Instruction 1; Instruction 2; …Instruction N; }; (N<10)
For example:
{CUR 20; MCS 16; SPD 5000; ENA; };
UIM241XX will only send back 1 ACK on receiving the above message.
In the above example, “{” and “}” is called Macro Operator. Instructions between a pair of
macro operators will get no ACK message.
The semicolon at the end of the instruction set has no letter or number before it. That is
called Null Instruction. The only purpose of a Null Instruction is to tell the UIM242XX to
feedback all the inquired parameters of the basic motion control. (i.e. Enable/disable,
Current, Micro-stepping, Auto current reduction, Direction, Speed, and Displacement)
Actually, user can simply send the null instruction“;” alone to check the status of the above
parameters. If there is no null instruction “;” after the “}” in the above example, there will be
no ACK message at all.

UI Robot Technology Co. Ltd.
M4120170509EN
Page 19
UIM241 Miniature Integrated Stepper Motor Controller(Closed-loop)
3.0 RS232 COMMUNICATION
UIM241xx controllers communicate and exchange information with user devices
throughRS232 serial protocol. The RS232 configuration of user device, the hand-shaking
methods and the instruction used to change the baud rate will be introduced in this Chapter,
along with the method to reset the baud rate to factory default.
3.1 User Device RS232 Port Configuration
To communicate with UIM241XX, user device needs to have following RS232 port settings:
•8 bits data
•1 stop bit
•None Parity
3.2 Hand-Shaking
Any out-of-box UIM241 controller has a factory default baud rate 9600. User can use the
9600 baud rate to connect to a new UIM241 controller.
If the baud rate has been changed, the new baud rate will be stored in the controller’s non-
volatile memory (EEPROM). New baud rate will take effect after the controller is restarted.If
user device knows the baud rate, it can start sending instructions without hand-shaking
Hand-shaking is more used as a method to check the existence and firmware version of
the controller. Under following two situations the UIM241XX will issue a greeting message:
1. When UIM241XX is powered up.
2. When UIM241XX receives following ASCII message: ABC; A message started with AA,
AB, AC at the user device implies a successful hand-shake.
A greeting Message from UIM241XX has the following structure:
Byte
1
2
3
4
5
6
7
8
9
10
11
12
13
Value
AA
AB
AC
18
01
CUR
Module
Firmware Version
00
00
FF
Where,
AA AB AC denotes the greeting message
18 01 denotes the UIM241 controller.
[CUR]denotes the maximum motor current the controller can provide.
[Module] denotes the optional control modules the controller installed
[Firmware Version] denotes the firmware version. Data is in 7 bits format.
Conversion from three 7bits message data to a 16bits integer is illustrated in Figure 10-1.
3.3 Reset Baud Rate to Factory Default 9600
In case of forgotten the baud rate and cannot establish the connection, please take the
following steps to reset the baud rate to factory default of 9600.
1. Reboot the controller.

Page 20
M4120170509EN
UI Robot Technology Co. Ltd.
UIM24102/04/08-IE
2. In 10 seconds, short the terminal 9 (figure 0-1) to analog ground (terminal 6) for 2
times, with intervals around 1 second.
3. Each time, the LED on the controller will flash. If exceed 10 seconds, please restart
from step 1.
4. If successful, the LED will turn off for one second and re-lit. That indicates the baud
rate has been changed to 9600 and ready to use.
5. Use BDR instruction to change the baud rate to desired value.
3.4 Instruction List
The following table shows the instructions mentioned in this chapter, the detail of those
instructions is descriped at the end of the document.
Instruction
Description
Page
BDR;
Set the RS232 communication baud rate of
UIM241XX controller to
57
MDL;
Check the Model, installed optional modules and
firmware version
61
This manual suits for next models
3
Table of contents
Other UIrobot Controllers manuals