MotoRos EDS
MotoRos EDS
Motion interface
Engineering Design
Specifications
Privacy Information
This document may contain information of a sensitive nature. This information should not be
given to persons other than those who are involved in the ROS project or who will become
involved during the lifecycle
Approvals:
# Name Title Organization/Dept.
1
2
3
4
5
6
# Signature Date
1 Overview ............................................................................................................................. 1
1.1 Current System Issues ......................................................... Error! Bookmark not defined.
1.2 Scope .................................................................................... Error! Bookmark not defined.
1.3 Objectives .............................................................................................................................. 1
2 Specifications..................................................................................................................... 2
2.1 Architecture ............................................................................................................................ 2
2.1.1 ROS to MotoROS ........................................................................................................... 3
2.1.2 MotoROS to ROS ........................................................................................................... 3
2.1.3 INFORM to Motoplus...................................................................................................... 3
2.2 Communication Sequence and Tasks ................................................................................... 4
2.2.1 Main Task ....................................................................................................................... 4
2.2.2 Connection Server Task ................................................................................................. 5
2.2.3 State Server Task........................................................................................................... 6
2.2.4 Motion Server Task ........................................................................................................ 7
2.2.5 Add to Inc Move Queue Task......................................................................................... 8
2.2.6 Inc Motion Task .............................................................................................................. 9
2.3 Data Structures .................................................................................................................... 10
2.3.1 Controller Structure ...................................................................................................... 10
2.3.2 Control Group ............................................................................................................... 10
2.3.3 Incremental Motion Queue ........................................................................................... 10
2.4 Simple Messages ................................................................................................................ 11
2.4.1 Message type 13: ROBOT_STATUS........................................................................... 12
2.4.2 Message type 14: JOINT_TRAJ_PT_FULL ................................................................. 13
2.4.3 Message type 15: JOINT_FEEDBACK ........................................................................ 14
2.4.4 Message type 2001: MOTO_MOTION_CTRL ............................................................. 15
2.4.5 Message type 2002: MOTO_MOTION_REPLY .......................................................... 16
2.5 Motion Ready State ............................................................................................................. 18
2.6 MotoROS to Controller communication ............................................................................... 21
2.7 Interpolation of Pulse Increment .......................................................................................... 22
2.7.1 Algorithm ...................................................................................................................... 22
2.7.2 Calculation .................................................................................................................... 23
2.7.3 Check for incremental move validity ............................................................................ 24
4 Appendix .......................................................................................................................... 26
4.1 Port Numbers ....................................................................................................................... 26
4.2 IO Feedback ........................................................................................................................ 26
4.3 Result codes ........................................................................................................................ 26
4.4 Result subcodes .................................................................................................................. 27
Index of Figures
Figure 1: System Architecture .......................................................................................................... 2
Figure 2: Main Task Start-up ............................................................................................................ 4
Figure 3: Connection Server Task .................................................................................................... 5
Figure 4: State Server Task .............................................................................................................. 6
Figure 5: Motion Server Task............................................................................................................ 7
Figure 6: Add to Increment Move Queue Task................................................................................. 8
Figure 7: IncMotionTask ................................................................................................................... 9
1.1 Objectives
The overall objectives of this project are:
1. To enable the robot to execute externally generated trajectories at full speed and
smoothing as is appropriate during the course of executing any trajectory.
2. To create a Motoplus application that used the mpExRcsIncrementMove function.
3. To define the communication interface of ROS to incorporate required data to define a
trajectory and necessary function to operate the robot.
4. To implement restrictions on the incoming data from the PC to enforce safety and pre-
vent damage to the robot.
PC (Linux)
ROS
Define a path for the robot:
ROS Industrial
T2 T3
Decompose path into smaller control points T6
with joint positions, time and end flag: T1 T4 T5
T0
FS100 Controller
MotoPlus (MotoROS)
- Initialize MotoROS by retrieving the controller/manipulator data
- Enable the incremental move function by calling job with SKILLSND
command or a triggering I/O signal.
- Run task receiving the ROS industrial
motion and breaks it down to controller
interpolation clock.
- Run task synchronized with the controller interpolation clock that sends
the incremental motion instruction (mpExRcsIncrementMove)
Controller Software
Execute job to enable the incremental move function.
Move the robot according the received incremental move.
NOP
‘reset the I/O signals
DOUT OT#(890) OFF
DOUT OT#(889) OFF
TIMER T=0.05
‘
‘signal ROS that the controller
‘is ready to receive motion
DOUT OT#(889) ON
‘
‘wait for the signal that ROS is done
WAIT OT#(890)=ON
‘
‘turn off the controller ready signal
DOUT OT#(890) OFF
END
For the final product release, this code will probably be encapsulated in the macro function to
facilitate the usage.
Power Up
Controller
Start Tasks
MotoROS:
Connection
Server
Retrieve
controller I/O Status
status
Update local
status and if
required, take
action on
change
Initialize
Start ROS connection
ports
Start ROS
Load Nodes
Industrial
Wait for
Connect to connection by
controller checking the
various port
Connection Yes
State Server
Port?
MotoROS: Start
StateServer
SendState task
Connection Yes
Motion Server
Port?
MotoROS: Start
MotionServer
WaitForSimpleMsg
task
MotoROS: Start
AddToIncQueue task
ROS MotoROS:
ROS Industrial StateServer Controller
Controller Data
Display/
Send Position to
Update
ROS
Robot State Receive
State Data
(Robot Send locally
Position, stored status to
Status) ROS.
(Status retrieved
by Main task)
ROS MotoROS:
Industrial MotionServer
Process motion
message
Take Controller
appropriate
action...
Inc. Move
Queue
Message
No contains
trajectory
point?
Yes
Parse and Trajectory
validate point data
trajectory data copy
Wait motion
Send reply
message reply
MotoROS:
AddToIncQueue
Trajectory Is there a No
point data point to
copy process?
Yes
Process
trajectory point
and generate
next
corresponding
IncMove
Yes Is the
Inc.Queue
full? Inc. Move
Queue
No
Add
Inc Move to
queue
No Is trajectory Yes
point
reached?
MotoROS:
IncMoveLoop Controller
Are there No
moves in
queue?
Inc. Move Yes
Queue Take Next
Inc.Move from
Queue
Validate Inc
Move values
Apply the inc.
move to the
Send
next
Inc Move
interpolation
segment
Figure 7: IncMotionTask
Command details:
CHECK_MOTION_READY (200101): Checks if the MotoROS/Controller side is
ready to receive external motion data from ROS.
CHECK_QUEUE_CNT(200102): Return the number of motion increment
currently in the queue. A return of 0 indicates that the queue is empty and all
previous motion has been sent to the controller.
STOP_MOTION (200111): Stops robot motion immediately. Note after a stop,
the current trajectory will be cleared and a new trajectory will need to be initiated
but it doesn’t necessarily turn off the MOTION_READY state.
START_TRAJ_MODE (200121): Signals MotoROS to set the controller in
trajectory receiving mode so that ROS can start sending trajectory points.
STOP_TRAJ_MODE (200122): Signals the MotoROS hands controller back to
the controller’s INFORM job. Note that motion needs to complete or stopped
before sending this command.
Result details:
SUCCESS/TRUE (0): The message was processed successfully or the state is true.
BUSY (1): The message couldn’t be processed at this time. Resend the message.
FAILURE/FALSE (2): The message couldn’t be processed properly or the state is false.
INVALID (3): The message type is invalid or the data is incorrect.
ALARM (4): An alarm is currently active on the controller.
NOT_READY (5): The controller is not in ready for motion.
MP_FAILURE (6): MotoPlus API failure. Subcode=MotoPlus Error Code
JointTrajPtExData structure:
JointFeedback structure is the same as the one used for the JOINT_FEEDBACK message.
Please refer to section 2.4.3.
2.7.1 Algorithm
For each new trajectory point:
Calculate acceleration equation coefficients.
While time is smaller than new ROS point time
Increment calculation time by next interpolation period
If next interpolation period is smaller than the controller interpolation period, make it
equal.
If calculation time is smaller than new ROS point time
Set new time to calculation time
For each axis
Calculate position for the current calculation time
Calculate velocity for the current calculation time
Else (if calculation time is equal or larger than new ROS point time)
If calculation time is larger than new ROS point time
Set the next interpolation increment to the different between the two
Set the calculation time equal to the new ROS point time
For each axis
Set position to new ROS point position
Set velocity to new ROS point velocity
Convert new position in pulses
Calculate new pulse increment by subtracting previous pulse position from new pulse
position.
Check incremental pulse validity
Add new pulse increment to queue
position
xi+1
xi vi vi+1
time
ti ti+1
𝒂𝟐 (𝒕−𝒕𝒊 )𝟐
𝒗 = 𝒗𝒊 + 𝒂𝟏 (𝒕 − 𝒕𝒊 ) + 𝟐
(𝒕−𝒕𝒊 )𝟐 𝒂𝟐 (𝒕−𝒕𝒊 )𝟑
𝒙 = 𝒙𝒊 + 𝒗𝒊 (𝒕 − 𝒕𝒊 ) + 𝒂𝟏 +
𝟐 𝟔
Using the control point data to resolve the equations, we find at time ti that:
𝑎2 (𝑡𝑖+1 −𝑡𝑖 )2
𝑣𝑖+1 = 𝑣𝑖 + 𝑎1 (𝑡𝑖+1 − 𝑡𝑖 ) + 2
And
(𝑡𝑖+1 −𝑡𝑖 )2 𝑎2 (𝑡𝑖+1 −𝑡𝑖 )3
𝑥𝑖+1 = 𝑥𝑖 + 𝑣𝑖 (𝑡𝑖+1 − 𝑡𝑖 ) + 𝑎1 2
+ 6
With those coefficients, the position and velocity for any time between ti and ti+1 can be
determined.
4.2 IO Feedback
Controller universal output group 112 is being used by the MotoRos application to
handshake with the controller job and to indicate the state of the MotoRos application.
IO_FEEDBACK_WAITING_MP_INCMOVE 11120 //output# 889
IO_FEEDBACK_MP_INCMOVE_DONE 11121 //output# 890
IO_FEEDBACK_MP_INITIALIZATION_DONE 11122 //output# 891
IO_FEEDBACK_CONNECTSERVERRUNNING 11123 //output# 892
IO_FEEDBACK_MOTIONSERVERCONNECTED 11124 //output# 893
IO_FEEDBACK_STATESERVERCONNECTED 11125 //output# 894
IO_FEEDBACK_FAILURE 11127 //output# 896
The output #889 signals that the controller is ready to receive motion from ROS and should
be set by the controller job.
The output #890 signals that ROS is done with moving the robot and the job execution can
be resumed. The MotoRos turns on this output when the command STOP_TRAJ_MODE is
received. The controller job normally turns it OFF before the next handshake.
The output #891 to #896 are set by MotoRos and should not be changed by the controller
job (or operator). The output #891 confirms that the initialization was completed. The output
#892 indicates that the server threads are running properly. Output #893 and #894 will only
turn on when at least one client is connected and should turn off is all the clients disconnect.
If output #896 is ON, a failure occurred and the controller will have to be rebooted in order to
reset the MotoRos application.
ROS_RESULT_NOT_READY_UNSPECIFIED = 5000,
ROS_RESULT_NOT_READY_ALARM = 5001,
ROS_RESULT_NOT_READY_ERROR = 5002,
ROS_RESULT_NOT_READY_ESTOP = 5003,
ROS_RESULT_NOT_READY_NOT_PLAY = 5004,
ROS_RESULT_NOT_READY_NOT_REMOTE = 5005,
ROS_RESULT_NOT_READY_SERVO_OFF = 5006,
ROS_RESULT_NOT_READY_HOLD = 5007,
ROS_RESULT_NOT_READY_NOT_STARTED = 5008,
ROS_RESULT_NOT_READY_WAITING_ROS = 5009