Shanghai Nofuel Energy Technology Co., Ltd.
Products
Contact Us
  • Contact Person : Mr. Qian Money
  • Company Name : Shanghai Nofuel Energy Technology Co., Ltd.
  • Tel : 86-21-20965195
  • Fax : 86-21-38230339
  • Address : Shanghai,Shanghai,Room 1058 ,No.1-9, Lane 99,Shenmei Road,Pudong District
  • Country/Region : China
  • Zip : 201318

industrial robot for multifunction

industrial robot for multifunction
Product Detailed
Related Categories:Manipulator
robot arm Innpro handling bottles Painting application multiflexible board handling Fande screw application

Robot arm

 

 

1 The URScript Programming Language1.1 IntroductionThe Universal Robot can be controlled a three di erent levels: The Graphical User-InterfaceLevel, the Script Level and the C-API Level. URScript is the robot programming languangeused to control the robot at the Script Level. Like any other programming language URScripthas variables, types, flow of control statements, function etc. In addition URScript has a numberof built-in variables and functions which monitors and controls the I/O and the movements ofthe robot.

1.2 Connecting to URControlURControl is the low-level robot controller running on the Mini-ITX PC in the controllercabinet. When the PC boots up URControl starts up as a daemon (like a service) and PolyScopeUser Interface connects as a client using a local TCP/IP connection.Programming a robot at the Script Level is done by writing a client application (running atanother PC) and connecting to URControl using a TCP/IP socket.                        Hostname: ur-xx (or the ip-adresse found in the about dialog-box in PolyScope if the                        robot is not in dns.)                        Port: 30002When connected URScript programs or commands are sent i clear text on the socket. Each line is terminated by 'nn'.

1.3 Numbers, Variables and TypesThe syntax of arithmetic expressions in URScript is very standard:1+2-34*5/6(1+2)*3/(4-5)In boolean expressions the boolean operators are spelled out:True or False and (1 == 2)1 > 2 or 3 != 4 xor 5 < -6not 42 >= 87 and 87 <= 42Variable assignment is done using the equal sign '=':foo = 42bar = False or True and not Falsebaz = 87-13/3.1415hello = "Hello, World!"l = [1,2,4]Flow of Control The URScript Programming Languagetarget = p[0.4,0.4,0.0,0.0,3.14159,0.0]The fundamental type of a variable is deduced from the rst assignment of the variable. In theexample above foo is an int and bar is a bool. target is a pose, a combination of a positionand orientation.The fundamental types are: none bool number - either int or float pose stringA pose is given as p[x,y,z,ax,ay,az ], where x,y,z is the position of the TCP, and ax,ay,azis the orientation of the TCP, given in axis-angle notation.

1.4 Flow of ControlThe flow of control of a program is changed by if-statements:if a > 3:a = a + 1elif b < 7:b = b * aelse:a = a + bendand while-loops:l = [1,2,3,4,5]i = 0while i < 5:l[i] = l[i]*2endTo stop a loop prematurely the break statement can be used. Similarly the continue statementcan be used to pass control to the next iteration of the nearest enclosing loop.

1.5 FunctionA function is declared as follows:def add(a, b):return a+bendScoping rules The URScript Programming LanguageThe function can then be called like this:result = add(1, 4)It is also possible to give function arguments default values:def add(a=0,b=0):return a+bendURScript also supports named parameters. These will not be described here, as the implementationis still somewhat broken.

1.6 Scoping rulesA urscript program is declared as a function without parameters:def myProg():endEvery variable declared inside a program exits at a global scope, except when they are declaredinside a function. I that case the variable are local to that function. Two quali ers are availableto modify this behaviour. The local quali er tells the runtime to treat a variable inside afunction, as being truly local, even if a global variable with the same name exists. The globalquali er forces a variable declared inside a function, to be globally accessible.In the following example, a is a global variable, so the variable inside the function is the samevariable declared in the program:def myProg():a = 0def myFun():a = 1return aendr = myFun()endIn this next example, a is declared local inside the function, so the two variables are di erent,even though they have the same name:def myProg():a = 0def myFun():local a = 1Threads The URScript Programming Languagereturn aendr = myFun()endBeware that the global variable is no longer accessible from within the function, as the localvariable masks the global variable of the same name.

1.7 ThreadsThreads are supported by a number of special commands.To declare a new thread a syntax similar to the declaration of functions are used:thread myThread():# Do some stuffreturnendA couple of things should be noted. First of all, a thread cannot take any parameters, andso the parentheses in the declaration must be empty. Second, although a return statement isallowed in the thread, the value returned is discarded, and cannot be accessed from outsidethe thread. A thread can contain other threads, the same way a function can contain otherfunctions. Threads can in other words be nested, allowing for a thread hierarchy to be formed.To run a thread use the following syntax:thread myThread():# Do some stuffreturnendthrd = run myThread()The value returned by the run command is a handle to the running thread. This handle canbe used to interact with a running thread. The run command spawns o the new thread, andthen goes o to execute the instruction following the run instruction.To wait for a running thread to nish, use the join command:thread myThread():# Do some stuffreturnendThreads The URScript Programming Languagethrd = run myThread()join thrdThis halts the calling threads execution, until the thread is nishedexecuting. If the thread is already nished, the statement has no e ect.To kill a running thread, use the kill command:thread myThread():# Do some stuffreturnendthrd = run myThread()kill thrdAfter the call to kill, the thread is stopped, and the thread handle is no longer valid. If thethread has children, these are killed as well.To protect against race conditions and other thread related issues, support for critical sectionsare provided. A critical section ensures that the code it encloses is allow to nish, before anotherthread is allowed to run. It is therefore important that the critical section is kept as short aspossible. The syntax is as follows:thread myThread():enter_critical# Do some stuffexit_criticalreturnend

1.7.1 Threads and scopeThe scoping rules for threads are exactly the same, as those used for functions. See section 1.6for a discussion of these rules.1.7.2 Thread schedulingBecause the primary purpose of the urscript scripting language is to control the robot, thescheduling policy is largely based upon the realtime demands of this task.The robot must be controlled a frequency of 125 Hz, or in other words, it must be told what to do every 0.008 second (each 0.008 second period is called a frame). To achieve this, each thread is given a \physical" (or robot) time slice of 0.008 seconds to use, and all threads in a runnable state is then scheduled in a round robin1 fashion. Each time a thread is scheduled, it can use a piece of its time slice (by executing instructions that control the robot), or it can execute instructions that doesn't control the robot, and therefor doesn't use any \physical" time. If a thread uses up its entire time slice, it is placed in a non-runnable state, and is not allowed to run until the next frame starts. If a thread does not use its time slice within a frame, it is expected to switch to a non-runnable state before the end of the frame2. The reason for this state switching can be a join instruction or simply because the thread terminates.It should be noted, that even though the sleep instruction doesn't control the robot, it still uses \physical" time. The same is true for the sync instruction.

1.8 Program Label MessagesA special feature is added to the script code, to make it simple to keep track of which lines areexecuted by the runtime machine. An example Program Label Message in the script code looksas follows;sleep(0.5)$ 3 "AfterSleep"digital_out[9] = TrueAfter the the Runtime Machnie executes the sleep command, it will send a message of typePROGRAM LABEL to the latest connected primary client. The message will hold the number 3 andthe text AfterSleep. This way the connected client can keep track of which lines of codes arebeing executed by the Runtime Machine.

2 Module motion

This module contains functions and variables built into the URScript programming language.URScript programs are executed in real-time in the URControl RuntimeMachine (RTMachine).The RuntimeMachine communicates with the robot with a frequency of 125hz.Robot trajectories are generated online by calling the move functions movej, movel and thespeed functions speedj, speedl and speedj init.Joint positions (q) and joint speeds (qd) are represented directly as lists of 6 Floats, one for eachrobot joint. Tool poses (x) are represented as poses also consisting of 6 Floats. In a pose, the rst3 coordinates is a position vector and the last 3 an axis-angle (http://en.wikipedia.org/wiki/Axis angle).Version: 1.5 1  Before the start of each frame the threads are sorted, such that the thread with the largest remaining time slice is to be scheduled first. 2  If this expectation is not met, the program is stopped.Copyright: (C) 2008 Universal Robots Aps

2.1 Functions

Movec (pose via, pose to, a=1.2, v=0.3, r=0)

Move Circular: Move to position (circular in tool-space)

TCP moves on the circular arc segment from current pose, through pose via to

pose to. Accelerates to and moves with constant tool speed v.

Parameters

pose via: path point (note: only position only is used).

pose to: target pose

a: tool acceleration [m/s^2]

v: tool speed [m/s]

r: blend radius (of target pose) [m]

movej(q, a=3, v=0.75, t=0, r=0)
Move to position (linear in joint-space) When using this command, the robotmust be at standstill or come from a movej og movel with a blend. The speedand acceleration parameters controls the trapezoid speed pro le of the move.The $t$ parameters can be used in stead to set the time for this move. Timesetting has priority over speed and acceleration settings. The blend radius canbe set with the $r$ parameters, to avoid the robot stopping at the point.However, if he blend region of this mover overlaps with previous or followingregions, this move will be skipped, and an 'Overlapping Blends' warning messagewill be generated.Parametersq: joint positionsa: joint acceleration of leading axis [rad/s^2]v: joint speed of leading axis [rad/s]t: time [S]r: blend radius [m]
movel(pose, a=1.2, v=0.3, t=0, r=0)
Move to position (linear in tool-space)See movej.Parameterspose: target posea: tool acceleration [m/s^2]v: tool speed [m/s]t: time [S]r: blend radius [m]
movep(pose, a=1.2, v=0.3, r=0)
Move ProcessBlend circular (in tool-space) and move linear (in tool-space) to position.Accelerates to and moves with constant tool speed v.Parameterspose: target posea: tool acceleration [m/s^2]v: tool speed [m/s]r: blend radius [m]
servoc(pose, a=1.2, v=0.3, r=0)
Servo CircularServo to position (circular in tool-space). Accelerates to and moves withconstant tool speed v.Parameterspose: target pose (position + orientation)a: tool acceleration [m/s^2]v: tool speed [m/s]r: blend radius (of target pose) [m]
servoj(q, a=3, v=0.75, t=0)
Servo to position (linear in joint-space)Parametersq: joint positionsa: NOT used in current versionv: NOT used in current versiont: time [S]
set pos(q)
Set joint positions of simulated robotParametersq: joint positions
speedj(qd, a, t min)
Joint speedAccelerate to and move with constant joint speedParametersqd: joint speeds [rad/s]a: joint acceleration [rad/s^2] (of leading axis)t min: minimal time before function returns
speedj init(qd, a, t min)
Joint speed (when robot is in ROBOT INITIALIZING MODE)Accelerate to and move with constant joint speedParametersqd: joint speeds [rad/s]a: joint acceleration [rad/s^2] (of leading axis)t min: minimal time before function returns
speedl (xd, a, t min)
Tool speedAccelerate to and move with constant tool speedParametersxd: tool speed [m/s] (spatial vector)a: tool acceleration [rad/s^2]t min: minimal time before function returns
stopj(a)
Stop (linear in joint space)Decellerate joint speeds to zeroParametersa: joint acceleration [rad/s^2] (of leading axis)
stopl(a)
Stop (linear in tool space)Decellerate tool speed to zeroParametersa: tool accleration [m/s^2]

2.2 Variables

NameDescription
packageValue: 'Motion'
a joint defaultValue: 3
a tool defaultValue: 1.2
v joint defaultValue: 0.75
v tool defaultValue: 0.3

3 Module internals

3.1 Functions

get controller temp
Returns the temperature of the control boxThe temperature of the robot control box in degrees Celcius.Return ValueA temperature in degrees Celcius (float)
get forward kin
Forward kinematicsForward kinematic transformation (joint space -> tool space) of current jointpositionsReturn Valuetool pose (spatial vector)

industrial robot for multifunction



Copyright Notice @ 2008-2022 ECBAY Limited and/or its subsidiaries and licensors. All rights reserved.