Instruction Structure; Macro Operator And Null Instruction - UIrobot UIM2842 User Manual

Can2.0b instruction control, miniature integrated stepper motor controller (closed-loop) v1.0
Table of Contents

Advertisement

UIM2842

2.2 Instruction Structure

An instruction is a message sent from the user device to UIM2842 to Comment certain
operation. Instructions of UIM2842 follow the rules listed below:
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 UIM2842 controller. The
maximum length of feedback message is 13 bytes.
Feedback messages from UIM2842 (through UIM2501/2502) follow the structure below:
[Header] [Controller ID] [Message ID] [Data] [Terminator]
There are 3 kinds of headers: AA、CC and EE.
Controller ID is the identification number of current controller in a CAN network (also
known as Node ID). Scope: 5 – 125.
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. UIM2842 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.3 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:
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:
For example:
UIM2842 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.
Page 22
INS η; or INSx η; or INS;
CUR 20; MCS 16; SPD 5000; ENA;
{Instruction 1; Instruction 2; ...Instruction N; }; (N<10)
{CUR 20; MCS 16; SPD 5000; ENA; };
M4220170607EN
UI Robot Technology Co. Ltd.

Advertisement

Table of Contents
loading

Table of Contents