Kuka Robot Program Manual
TOPIC 1: Movement The KUKA robot can move from point A to point B in three main ways. PTP – Point-to-Point – Motion along the quickest path to an end point.
This motion requires the programmer to “teach” one point. LIN – Linear – Motion at a defined velocity and acceleration along a straight line. This motion requires the programmer to “teach” one point. The robot uses the point defined in the previous move as the start point and the point defined in the current command as the end point and interpolates a straight line in between the two points. CIRC – Circular – Motion at a defined velocity and accerlation along a circular path or a portion of a circular path.
This motion requires the programmer to “teach” two points, the mid-point and the end point. Using the start point of the robot (defined as the end point in the previous motion command) the robot interpolates a circular path through the mid-point and to the end point. TOPIC 2: Inputs and Outputs Inputs and Outputs (I/O) are the same concept as in PLCs. INPUTS – An input is something (digital or analog) coming from another system and is read in and used to make decisions. Inputs cannot be changed by the robot is represent the state of something external to the robot such as whether a sensor is on or off.
In the robots our inputs are defined from 33 through 40. These inputs can be set to any number but the external inputs that are numbered 0 through 7 are reflected in the programming language as 33 through 40. Therefore to refer to physical input 0 in the program the syntax is $IN33.
Physical input 4 would be $IN37. OUTPUTS – Outputs can be changed by the robot but can also be monitored. The numbering is the same as the inputs. Physical output 0 is output 33 in the program.
The sytax is $OUT33 for output 33. The syntax to change the state of the output is $OUT33=TRUE to cause physical output 0 to turn on and $OUT33=FALSE to cause physical output 0 to turn off. PULSED OUTPUTS – An output can be turned on for a short (or defined) period of time easier than just turning the output on, waiting for a time, and then turning the output off. An input cannot be pulsed because it cannot be altered by the robot. The syntax to accomplish this is PULSE($OUT33,TRUE,0.5) or more generically PULSE($OUT#, state, time) where state can be TRUE or FALSE and time is the time to pulse the output in seconds.
The above example would turn on physical output 0 for 0.5 seconds. This time can range from 0.012 seconds to 2^31 seconds in increments of 0.1 seconds.
TOPIC 3: Execution Control The following are different ways to control the execution of your program. If statements – An if statements checks a condition and executes code if the condition is true and may execute code (if written) if the condition is false. The syntax is as follows. IF conditional TRUE THEN Whatever code you want to execute when the conditional is TRUE ELSE Whatever code you want to execute when the conditional is FALSE ENDIF For example, if you had a switch connected to physical input 0 the following code might be used.
IF $IN33TRUE THEN the code written here would execute when the switch was on. ELSE the code written here would execute when the switch was off. ENDIF The ELSE statement is optional and if not used should not be entered in. In other words if in the example above nothing should happen if the switch was off the following code could be used. IF $IN33TRUE THEN the code written here would execute when the switch was on.
ENDIF For those of you who are familiar with programming, there is no “ELSEIF” option. However, you can nest the IF statements within each other. Switch statements – A switch statement (in other languages it is called a case statement) is commonly used when a variable can have many values instead of just on and off. For example, if a variable had the name countervariable and it could attain values of 10, 20, 30, 40, or 50 the following code could be used to execute different code base on the value of the variable.
SWITCH countervariable CASE 10 code that should execute when countervariable equals 10. CASE 20 code that should execute when countervariable equals 20. CASE 30 code that should execute when countervariable equals 30.
DEFAULT code that should execute when countervariable doesn’t equal any of the above cases. For loops – The For loop is a command that allows the programmer to execute a piece of code a certain number of times while incrementing through a variable. For example if a programmer wanted to execute a set of code 50 times while incrementing a variable in steps of 2 the following code could be used.
FOR CounterVariable = 1 to 100 STEP 2 code to execute every time through the loop ENDFOR The STEP is optional and without the command it defaults to 1. While loops – Instead of executing a set of code a set number of times, a While loop can be used to execute a piece of code while a condition remains true or false. For example if a robot should move back and forth while an input remains on the following code could be used. WHILE $IN35TRUE code to execute while the input remains on ENDWHILE 5.
Repeats loops – A While loop does something while a condition remains true or false, but a repeat loop does something until a conditions becomes true or false. For example, a robot could be asked to move back and forth until a condition is met.
REPEAT code to be executed until input 40 turns off. UNTIL $IN40FALSE 6. Endless loops – Many times, it is the desire of the programmer that the robot does the same task over and over again endlessly. In order to accomplish that we use the LOOP command. This causes code between LOOP and ENDLOOP to execute without end. LOOP code to execute endlessly ENDLOOP TOPIC 4: Variables In a basic program (MODUL PROGRAM) there is a INI line pre-written in a new program.
Mustang repair guide. Above this INI line is the area in which variables are declared or given name and definition. The following are allowable variable types.
Integer (numbers without a decimal point such as 1, 233, 143, 4365) – Syntax: INT variablename. Real (numbers with a decimal point such as 1.2, 33.45, 3.14) – Syntax: REAL variablename. E6POS (variable representing a point in space and robot orientation) – Syntax: E6POS variablename The E6POS variable consists of 6 variables representing the point in cartesian space and the orientation of the arm at that point. Because of this the programmer can reference an E6POS variable in several ways.
variablename.x would refer to the x value of the point in space. variablename.y would refer to the y value of the point in space. variablename.z would refer to the z value of the point in space. variablename.a would refer to the rotation around the z axis in space. variablename.b would refer to the rotation around the y axis in space. variablename.c would refer to the rotation around the x axis in space Oftentimes a programmer will want to save the current position of the robot to an E6POS variable. This is done with the $POSACT command as follows.
If pointinspace is the variable name the programmer would type pointinspace = $POSACT and the current position of the robot would be saved to the variable in real time. Additionally, when using variables, many operators are required and can be grouped into three categories. Relational Operators. Check to see if equal to:. Check to see if not equal to:. Check to see if less than:.
Check to see if greater than or equal to: = 2. Logic Operators. NOT. AND. OR. EXOR (exclusive or) 3. Arithmetic Operators.
Multiplication. Additiona +.
Subraction –. Division / TOPIC 5: Other Topics (include wait and waitfor here) Timers – Timers are also available to the programmer for uses such as timing the amount of time that occurs between two inputs coming on. There are 16 timers (1-16) and there are three commands available for each timer. Shown here are the commands for timer 1. If any other timer is used just replace the 1 with the timer number. $TIMERSTOP1=FALSE This command starts the timer timing. Just like the button on your stopwatch that starts timing.
$TIMERSTOP1=TRUE This command stops the timer timing. Just like the button on your stopwatch that stops timing. $TIMER1 This is the place where the time is stored in milliseconds. A programmer can set this value to zero by typing $TIMER1=0 or use conditional statements based on the value. The value can also be used in a mathematical equation such as Distance = Rate. Time to determine either distance or rate whichever is not known. We will use this in the lab to determine the speed of the conveyor belt by solving for Rate = Distance / Time using two sensors placed along the conveyor a known distance apart.
Velocity Command – The linear velocity of the robot can be set by using the $VEL.CP variable. We will also use this in the lab to set the robot to move at the same speed as the conveyor. An example would be if we wanted the robot to move at 0.5m/s we would type $VEL.CP=0.5. Note that this variable is always in units of m/s.
Wait Commands – There are three different commands that the programmer can use to cause the program to freeze. WAIT FOR – This command causes the program to stop until a condition is met. An example would be WAIT FOR $IN35. This would cause the program to stop until $IN35 was true.
WAIT SEC – This command causes the program to stop for a certain amount of time. An example would be WAIT SEC 3.2. This would cause the program to freeze for 3.2 seconds. HALT – The HALT command causes the robot program to stop until restarted by an operator. You should now be prepared to begin.
BE SURE TO HAVE YOUR CAPS LOCK ON AS IT WILL MARK LOWERCASE ANSWERS INCORRECT. If you hit a score of 1200 you are guaranteed an 80%, after that you are competing with your peers. The highest score gets 100%. To determine other grades (if your score is greater than 1200) I will take 80+ (your score-1200) x (20/((the highest score) – 1200)). If your score is less than 1200 your grade will be (80/1200)x(your score). To submit, take a screen capture of your results and email it to me in a word document.
. Plugins.
Robot Tips. Accuracy. KUKA robots RoboDK supports all KUKA robot controllers since KRC2, including KUKA KRC3 and KRC4 controllers.
This documentation is based on a KRC4 controller. The KRC4 robot controller runs the Microsoft Embedded Windows 7 operating system. Previous controllers, such as KRC2, run Windows 95. The robot teach pendant shows an “HMI” which is a program that KUKA developed to run on Windows and it is the interface that the robot user must use manipulate the robot.
The following sections demonstrate typical operations using a KUKA robot teach pendant to prepare a new program in RoboDK and transfer it to the robot. Transfer a robot program Follow these steps to take a program form a USB disk: 1.
Insert the USB disk on the robot controller (it is much faster than using the teach pendant connection) 2. If we don’t see the USB disk we must enter in Administrator mode 3. Select the file from the USB disk 4.
Select Edit ➔ Copy 5. Select a folder in the KRC unit 6. Select Edit ➔ Paste Start a robot program Follow these steps to start a robot program on the KUKA KRC controller: 1. Select a program from the KRC memory unit 2.
Select Select on the screen 3. Select the button “ R” (top) and Reset program 4. Start the program by selecting green “Play” button on the teach pendant Retrieving the TCP The following steps allow creating or modifying robot tools (TCP, also known as $BASE in KUKA KRC robot programming): 1. Select MENU ➔ Start-up ➔ Calibrate ➔ Tool 2.
Select a tool and edit or retrieve the X,Y,Z position of the TCP. Retrieving the robot joints The following steps allow retrieving the robot joints: 1. Select MENU ➔ Display ➔ Actual position 2.
Select Joints mode and use the left column to take the robot joints Tip: It is possible to retrieve the robot joints more accurately (5 decimal precision) by monitoring the $AXISACT variable or simply using the RoboDK robot driver for KUKA and selecting the Get robot joints button Administrator mode Some menu sections require “Administrator” rights. The following steps allow entering in “Administrator” mode: 1. Select MENU ➔ Configuration ➔ User group 2. Select Administrator (or other). Enter the password if required (default password is “ kuka”) RoboDK driver for KUKA Robot drivers provide an alternative to Offline Programming (where a program is generated, then, transferred to the robot and executed). With robot drivers, it is possible to run a simulation directly on the robot (Online Programming).
More information available in the section. A connection between RoboDK and the KUKA robot can be established to move the robot automatically from a connected PC using RoboDK.
This allows using the RoboDK Run on robot option for online programming and debugging. The connection can be established through a standard Ethernet connection (TCP/IP).
Follow these steps to set up the RoboDK driver for KUKA: 1. Connect a mouse (optional, but strongly recommended). It is possible to plug USB devices to the teach pendant or the controller (reboot is not required). Alternatively, it is possible to establish a remote desktop connection.
These steps can also be accomplished using the teach pendant’s touch screen and the virtual keyboard. (optional) Connect a keyboard and/or external screen (DVI).
Reboot the controller if an external screen is being used. If an external screen is being used with a mouse and keyboard, the screen will show a KukaUser windows login.
Insert the following credentials: user: kukauser (or KukaUser) password: 68kuka1secpw59 3. Using the KUKA HMI application it is possible to open the main menu using the KUKA button, at the top left of the screen: a. KUKA ➔ Configuration ➔ User group ➔ choose Administrator (password: kuka) b. KUKA ➔ Start-up ➔ Service ➔ Minimize HMI (the windows screen will appear) 4. Copy the KUKAVARPROXY folder on the Desktop (or somewhere in the controller PC) 5. Unlock the port 7000 for the KUKAVARPROXY server (HMI): a. Select the HMI.
Robot Program
KUKA ➔ Start-up ➔ Network configuration ➔ Advanced c. NAT ➔ Add port ➔ Port number 7000 d. Set permitted protocols: tcp/udp 6.
Start the KUKAVARPROXY.EXE program on the robot controller (running on Windows). (recommended) Next steps allow starting the driver automatically on the controller on reboot: a. Create a shortcut of the KUKAVARPROXY.EXE file b. Select Windows START ➔ All programs ➔ Right click startup ➔ Open c. Paste the shortcut in the startup folder The KUKAVARPROXY server is now ready.
It is not unsafe to leave this program running all the time. This server allows exchanging global variables from the KUKA controller to the remote PC.
The next steps are to set up the main program that will handle the robot movements: 1. Add the declaration of the following global variables: To do so, locate and modify the file “KRC R1 STEU $config.dat” (or in “KRC R1 System $config.dat” for KRC2 controllers). The folder “KRC R1 ” can also be accessed from the C: drive at the following Windows path: “C: KRC ROBOTER KRC ”. INT COMACTION=0 INT COMACTCNT=0 REAL COMROUNDM=0 REAL COMVALUE1=0 REAL COMVALUE2=0 REAL COMVALUE3=0 REAL COMVALUE4=0 DECL E6AXIS COME6AXIS DECL FRAME COMFRAME DECL POS COMPOS 2. Copy the SRC program provided (RoboDKsynch.src) to the folder KRC R1.
Ev3 Balancing Robot Program
Manually start the “RoboDKsynch.src” program to make the robot behave like a server that responds to move commands coming from the PC. If the RoboDKsynch.src program is not running, RoboDK will still be able to read the robot joints anytime if the KUKAVARPROXY program is running in the robot controller.