33
SCARA Robot Control and Networking Maintenance Report William Disotell Colin Mitchell Final Draft April 24, 2015 CEN 4935 Senior Software Engineering Project Instructor: Dr. Janusz Zalewski Software Engineering Program Florida Gulf Coast University Ft. Myers, FL 33965

SCARA Robot Control and Networking Maintenance Report William Disotell Colin …itech.fgcu.edu/faculty/zalewski/CEN4935/Projects/RTX... · 2015. 4. 24. · SCARA Robot Control and

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

  • SCARA Robot Control and Networking

    Maintenance Report

    William Disotell

    Colin Mitchell Final Draft

    April 24, 2015

    CEN 4935 Senior Software Engineering Project

    Instructor: Dr. Janusz Zalewski

    Software Engineering Program

    Florida Gulf Coast University

    Ft. Myers, FL 33965

  • 2

    Table of Contents

    1. Introduction ................................................................................................................................. 4 

    1.1 The UMI RTX Robotic Arm ................................................................................................. 4 

    1.2 Design Specifications ............................................................................................................ 5 

    1.2.1 Physical Diagram ............................................................................................................ 5 

    1.2.2 Context Diagram............................................................................................................. 6 

    1.2.3 Requirements Specifications .......................................................................................... 8 

    1.3 Design Description ................................................................................................................ 9 

    1.4 Implementation & Testing .................................................................................................. 11 

    1.4.1 Implementation ................................................................................................................. 11 

    1.4.1.1 RTX Software Controller .......................................................................................... 11 

    1.4.1.2 RTX Installer ............................................................................................................. 15 

    1.4.2 Testing .............................................................................................................................. 16 

    2 Operating Instruction ................................................................................................................. 18 

    2.1 Hardware and Software Requirements: ............................................................................... 18 

    2.2 How to install RTX Software Controller for the Windows platform .................................. 21 

    2.2.1 Configuring the RTX robot .......................................................................................... 21 

    2.2.2 Setting a Computer for Direct Connection ................................................................... 22 

    2.2.3 Setting a Computer for Network Connection ............................................................... 24 

    2.3 Running RTX Control Software ......................................................................................... 25 

    3 Troubleshooting ......................................................................................................................... 29 

    3.1 RTX Setup Problems ........................................................................................................... 29 

    3.2 RTX Initialization Problems ............................................................................................... 31 

    4. References ................................................................................................................................. 33 

  • 3

  • 4

    1. Introduction

    1.1 The UMI RTX Robotic Arm

    This project, utilizes the UMI RTX Robot [1] as shown in Figure 1.1. This robot is

    classified as a “SCARA” type robot, or Selective Compliance Assembly Robot Arm. First

    produced in 1986, the robot was designed with six degrees of freedom, or six joints that are able

    to be controlled, and a movable gripper. Because the robot originally was developed in the mid

    1980’s, the software was written in Pascal for use on a MS-DOS machine. Since then, there have

    been many projects working with the RTX in creating new libraries, including several

    contributions from Florida Gulf Coast University students.

    The primary aim of this project is to combine the features of two of the previous projects

    [1][2] to further the capabilities of the RTX robot software. The first project was a Java based

    implementation of the RTX library and contained a controlling interface built using JavaFX [1].

    The second project finalized with the ability to control the RTX over an internet connection with

    the use of an Xbox controller and a second computer [2]. Combining the two previous projects

    would incorporate the functionality of project two.

    The other aim of this maintenance project is to create an automated installer for the client

    and server program so they can be installed out of one executable. For this, an installer will be

    made using Izpack 4.3.5, an open source installation program. As installers created using Izpack

    are ‘.jar’ files, an additional step will be required to wrap them in an executable will be taken to

    increase ease of use. This additional wrapping will be done using Launch4j.

    An extra goal for this project is to also look into the improvement of the state that the

    group of RTX robots owned by Florida Gulf Coast University is in. Currently we have one fully

    functional RTX and two non-functional RTX. The problem will the non-functioning RTX is one

    has an inoperable joint and the other contains firmware that is not compatible with the fully

    functional RTX. The version of each chip’s software can be extracted using the RT100 library,

    so comparison of the software can be identified. The proposed solution would be to swap the IC

    chips in the non-functional RTX’s to salvage additional RTX.

  • 5

    Figure 1.1: The UMI RTX Robot

    1.2 Design Specifications

    1.2.1 Physical Diagram

    The physical diagram in Figure 1.2 shows connected hardware that is used for a project.

    The RTX is connected to a computer via a RS-232 connection. With two computers, a client and

    a host, the user can move the RTX over the internet with the aide of an Xbox controller. Also

    available, the user can input commands directly to the RTX through directly connected computer

    which is also equipped with the client software.

  • 6

    Figure 1.2: Physical Diagram for RTX Software Controller divided into the Server Program and Client Program

    1.2.2 Context Diagram

    The context diagram for the software is shown in Figure 1.3. This diagram shows

    connection between the software and outside world. The software is divided into two separate

    sections:

    1) Server Program – RTX Server – Accepts http connections and after receiving messages,

    forwarding them to the RTX via a RS-232 interface

    2) Client Program – RTX Controller – Sends messages via a RS-232 interface to the RTX

    and allows for an HTTP connection with the Server Program to send messages. The RTX

    Controller can be broken down further into four modules

    1.) User Interface

    2.) Control Module

    3.) Project File Module

    4.) Communications Module

  • 7

    Figure 1.3: Context Diagram of the RTX Software Controller divided into the Server Program and Client Program

  • 8

    1.2.3 Requirements Specifications

    Requirements set by the previous project are as follows:

    1) When a command sequence is received from the user, the RTX Controller shall handle it

    via an RS232 interface to the RTX robot.

    2) The RTX Controller shall save project files to or load project files from a source

    specified by the user.

    3) The RTX Controller shall send the signals to the RTX to move it to the location specified

    by the user.

    4) When a sequence of movements is specified by the User Interface, the RTX Controller

    shall send it to the RTX

    5) The range of motion of the RTX shall be displayed by the RTX Controller with seven

    manageable fields, one for each degree of freedom with the addition to the gripper.

    6) The User Interface of the RTX Controller shall display a list of active serial

    communication ports for the user to select from.

    7) The User Interface and Control Program Modules of the RTX Controller shall have the

    capability to handle multiple RTX connections.

    8) The RTX Server shall accept connection requests from the RTX Controller

    9) The RTX Server shall forward position commands from the RTX Controller to the RTX

    Additional Requirements set for the purpose of this maintenance project are as follows:

    1) The User Interface of the RTX Controller shall allow the user to create a network

    connection to a computer running the server program

    2) If no Xbox controller is detected when the user attempts to create a network connection,

    the User Interface of the RTX Controller shall display an error message alerting the user

    that one is required

    3) The program shall check if the server is available and display an error message if it

    cannot be found.

  • 9

    4) When a network connection has been made, the Control Program shall recognize

    commands to move the RTX as seen in Figure 1.4

    Figure 1.4 – RTX Xbox Button Scheme

    1.3 Design Description

    The architecture of the RTX Software Controller, RSC, is shown in Figure 1.5. The

    Control Module is located at the center and preforms the job of executing sequences of

    movements by interpreting the sequence and sending the signals out to the RS-232 Format

    Module while working with a directly connected RTX. When communicating with an RTX

    through the server program, the Control Module instead sends messages to the Server Module,

    located on the server machine, which then uses the RS-232 Format Module to communicate to

    the RTX. The remaining outer modules contain portions that interact with external entities. The

    GUI receives commands and information to the user. The Import/Export Module creates project

    files on the local machine. The RS-232 Format Module transfers messages to and from the RTX.

  • 10

    Figure 1.5: Software Architecture of the RTX Software Controller

  • 11

    1.4 Implementation & Testing

    1.4.1 Implementation

    1.4.1.1 RTX Software Controller

    The first portion of the project was integrating the client code from a networking project

    with the RTX [2] with the GUI interface of the JavaFX RTX project [1]. The code shown in

    Code Snippet 1.1 is the code used in the network settings windows where the user chooses

    between a serial connection and a network connection to the RTX. This code checks the current

    selection with a switch case and attempts to create the desired connection. If the is an error

    message, a String message is created and displayed to the user. If the connection is created

    successfully, a new tab is created for the connection window where the user can interface with

    the RTX.

    private void attemptCreate() {

    boolean error = false; String message = ""; switch (current) {

    case Serial: if (commChoice.getValue() != null && !Objects.equals(commChoice.getValue(), "")) {

    createSerial(); } else {

    error = true; message = "Please select a COM port";

    } break;

    case Network: message = createSocket();

    if(message != null){ error = true;

    } break;

    } if (error) { Utility.showErrorMessage(this, message);

    } }

    Code Snippet 1.1

  • 12

    The code section from Code Snippet 1.2 shows how a server thread will start and create

    new threads for clients. It then will create a listen_socket and listen for a client connection.

    Connection is not initialized until the client actually connects to the server. Once the connection

    is accepted the Server creates a Connection object. The Connection object will manage the

    instance of the RTX that accesses it. The communication sending is server side, therefore the

    RTX it sends to is based on the server and the COMMS attached to the server. The client will

    send serialized data through object stream to utilize the servers COMMS.

    new Thread(new Server(80)).start(); public Server(int port) {

    if (port == 0) { port = DEFAULT_PORT;

    } this.port = port;

    try { listen_socket = new ServerSocket(80);

    } catch (IOException e) { e.printStackTrace();

    } System.out.println("Server: listening on port " + 80); } public void run() {

    try { while (true) { Socket clientSocket = listen_socket.accept(); Connection c = new Connection(clientSocket);

    } } catch (IOException e) {

    e.printStackTrace(); }

    } Code Snippet 1.2

    To test the network connectivity of the RTX, the client was set up to take an Xbox

    controller using the jxinput library found in a DLL packaged with our project. The functionality

    for the Xbox controller is implemented by sending a command to the RTX to go to the maximum

    value for the joint while the button or joystick is pressed, and stop the motors when released.

    Since the Xbox controller can fire off many events very quickly, the stream will get flooded. To

    prevent this, the restriction on how many buttons can be spammed had to be enforced. Also the

  • 13

    server and client had to be made to handshake, in between connections there are motor

    initialization (on button) that need to run; if these are not run the communications will eventually

    lock up. Another issue is the host machine is running Window XP and cannot handle too many

    commands at once. A portion of the Xbox listeners and their restrictive properties can be seen in

    Code Snippet 1.3. The motors have Boolean values, this prevents the listeners from spamming

    the server with commands. Once the axis is centered the Boolean is changed to inactive (false)

    and the on function is called, ready for the next command.

    public void changed(JXInputAxisEvent arg0) { axisType = arg0.getAxis().getType(); axisName = arg0.getAxis().getName(); axisValue = arg0.getAxis().getValue(); if (axisValue < .07 && axisValue > -.07) { if (wristV == false) { wristV = true; System.out.println("wristV now true"); Connect.sendCommand(Connect.createCommand("On", 0));

    } //Left Joystick else if (axisValue > 0 && axisName.equals("Y Axis") &&

    axisType == 0 && wristV == true) { wristV = false; Connect.sendCommand(Connect.createCommand("wristV", -

    10000)); }

    else if (axisValue < 0 && axisName.equals("Y Axis") && axisType == 0 && wristV == true) {

    wristV = false; Connect.sendCommand(Connect.createCommand("wristV",

    10000)); }

    else if (axisValue > 0 && axisName.equals("X Axis") && axisType == 0 && shoulder == true) {

    shoulder = false; Connect.sendCommand(Connect.createCommand("Shoulder", -

    10000)); } else if (axisValue < 0 && axisName.equals("X Axis") &&

    axisType == 0 && shoulder == true) { shoulder = false; System.out.println("X axis and value < 0"); Connect.sendCommand(Connect.createCommand("Shoulder",

    10000)); }  

     

  • 14

    } Code Snippet 1.3

    The code shown in Code Snippet 1.4 is from the install.xml file that is required to create

    an Izpack automated installer. The install.xml file is the heart of the installer and specifies all of

    the settings for the installation, such as where target files are placed, and what options the end

    user running the installation has. This snippet of code, specifies the packages available to the

    user:

    RTX Drivers

    RTX Setup Instructions

    RTX Server

    RTX Controller and Network Client

    The drivers and setup instructions are set to mandatory and cannot be unselected, this can

    be seen in the installation instructions in figure 2.7.

    Win32 Serial DLL and XBOX Controller

    DLL

    A guide to connecting the and setting up the RTX with a computer for direct or network connections

    The server program to be run on the computer

    physically connected to the RTX and connected to via Internet

  • 15

    The main program capable of controlling the

    RTX via RS232 and over a network

    Code Snippet 1.4

    1.4.1.2 RTX Installer

    The RTX Installer was successfully created using a fork of Izpack 4.3.5. To create the

    installer, a XML file needs to be created which is used to specify what the installer should do.

    Panels, or the screens that are shown in the installation project are set in Code Snippet 1.5.

    Code Snippet 1.5

    In the PacksPanel, we can define the packs that are shown in Figure 2.8. In Code Snippet

    1.6, there two of the packs are defined. For each pack, a descripition is required which is

    displayed to the user when selected. The ‘required’ attribute toggles whether the user can choose

    not to install it, and the ‘os’ attribute defines which operating systems this pack can be installed

    on.

    Win32 Serial DLL and XBOX Controller DLL

  • 16

    The main program capable of controlling the RTX via RS232 and over a network

    Code Snippet 1.6

    After the jar file has been created by Izpack, we wrapped it in a self-extracting executable for ease of use as this project is meant for Windows only. This wrapping was completed using

    Launch4J, an easy to use program.

    1.4.2 Testing

    To test the final implementation of the RTX Software Controller, we had to test both a

    direct connection to the RTX using the RTX Controller, and the connection over a network using

    both the RTX Controller and RTX Server. To test the direct connection, we first tested our

    interface by sending basic positions to the robot, testing every joint from minimum to maximum

    values. After each joint responded then tests continued to sending multiple position changes at

    once, such as Zed -200 and Shoulder +200. After RTX positions were established then sequences

    were the next step. Three positions were added to the sequence with various values. When

    pressing the “Run Sequence” button in the User Interface, the RTX successfully moved from its

    current position to the first in the sequence, progressing through.

    To test the network connectivity of the RTX, the client was set up to take an Xbox

    controller using the jxinput library found in a DLL packaged with our project. The functionality

    for the Xbox controller is implemented by sending a command to the RTX to go to the maximum

    value for the joint while the button or joystick is pressed, and stop the motors when released.

    Since the Xbox controller can fire off many events very quickly, the stream will get flooded. To

    prevent this, the restriction on how many buttons can be spammed had to be enforced. Also the

    server and client had to be made to handshake, in between connections there are motor

    initialization (on button) that need to run; if these are not run the communications will eventually

  • 17

    lock up. Another issue is the host machine is running Window XP and cannot handle too many

    commands at once.

    Testing was performed by connecting the Xbox controller to the client computer and the

    RTX via a serial cable to the server computer. In the user interface of the RTX Controller, a new

    network connection was created while the RTX Server is running on the computer specified in

    Figure 2.2. Using the Xbox controller, we were then able to move each joint as described

    Additional Requirement 4.

  • 18

    2 Operating Instruction

    2.1 Hardware and Software Requirements:

    The following physical components constitute the RTX robotic control system:

    1. UMI RTX robot, pictured in Figure 2.1, has worked the best for all testing.

    Figure 2.1 UMI RTX

    2. One Server computer (if a network connection is desired)

    The server computer used for this project is located in the back corner of Holmes

    429 (Figure 2.2) and has IP address - 69.88.163.33

  • 19

    Figure 2.2 Server Computer Holmes 429

    3. Microsoft Xbox 360 Wireless Controller (network only)

    Controls the RTX over a network (Figure 2.3) with a corresponding Xbox Controller

    Receiver (Figure 2.4) (network only) controls the RTX over a network

    Figure 2.3 Xbox360 Wireless Controller

    Figure 2.1 Xbox Controller Receiver

    4. As an alternative to item 3, a wired Xbox Controller can be used as shown in Figure 2.5

  • 20

    Figure 2.5 Xbox Controller Receiver

    5. RS-232 9pin to USB adapter interfaces the host computer and RTX serial communications

    (Figure 2.6)

    Figure 2.6 RS-232 9pin to USB adapter

    6. RTX Installer

    The front page to the RTX Installer is shown in Figure 2.7. By pressing “Next” it will

    start the installation process, where the user selects the directory to put the program and which

    packages to install.

  • 21

    Figure 2.7: RTX Installer Start Screen

    Figure 2.8: RTX Installer Package Selection

    2.2 How to install RTX Software Controller for the Windows platform

    2.2.1 Configuring the RTX robot

    1. Connect the power cord from a nearby outlet to the RTX

  • 22

    2. Attach the USB 9pin RS-232 to the 9pin RS-232 25pin RS-232

    3. Connect the 25pin RS-232 to the RTX

    4. Insert the USB end into a computer (controlling computer if direct connection or server

    computer if network connection)

    5. Insert the connecting wire into the emergency stop, bridging pins 4 & 5

    6. Flip the power switch on the RTX to on

    7. Press the green Motor Power On button which will light if ready

    2.2.2 Setting a Computer for Direct Connection

    1. Run the RTX Installer on the desired computer, installing the “RTX Controller and

    Network Client” package

    2. Configure serial for the USB to serial adapter to match RTX requirements shown in

    Table 2.2.1

    This can be done through the device manager, finding the adapter under “Ports (COM &

    LPT)” (Figure 2.2)

    Table 2.2.1 Serial Configuration for RTX Data Rate 9600

    Data Bits 8

    Parity Even

    Stop Bits 1

  • 23

    Figure 2.9: Windows Com Port Settings

  • 24

    2.2.3 Setting a Computer for Network Connection

    1. Run RTX Installer for each the client and server computer installing their corresponding

    packages.

    2. Make sure the USB Serial is connected from the server computer to the RTX

    3. Configure the setting for the serial adapter for the server computer to match RTX

    requirements shown in Table 2.2.1 (this can be done through the device manager, finding

    the adapter under “Ports (COM & LPT)”

    *Additionally, the server computer requires the RTX be located on COM 1

    This can be configured as shown in Figure 2.10, in

    “Port Settings” “Advanced” “COM Port Number”

    Figure 2.10 Windows Com Advanced Settings

    4. Run the server program executable on the server computer. A listening message should

    appear if the program is running correctly

    5. Connect the Xbox controller to the client computer, drivers for this should install

    automatically from Microsoft

    6. Start the RTX Control program on the client computer, choosing Network Connection

    when creating a new connection

  • 25

    2.3 Running RTX Control Software

    The first screen upon opening the RTX Control program is shown in Figure 2.3.1.

    Instructions for opening a new connection are set as the background for the base application. The

    available options in the menu are a “Connections” and “Sequences”.

    Figure 2.3.1 - Opening Screen

    After choosing to add a new connection, a window is opened giving the options of a

    serial and a network connection shown in Figure 2.3.2. When “Serial (RS232)” is selected, a

    drop down list populated with all available COM ports. Once a COM port has been selected, or

    “Network” is checked, the “Create” button will initialize a new connection for the RTX, creating

    a new tab.

  • 26

    Figure 2.3.2 - New Connection

    Figure 2.3.3 shows the beginning screen for a serial connection. This screen is divided

    into two sections. Along the left side of the application is the Sequence Panel. This panel lets the

    user add positions to the end of the current sequence with the “Add Position” button, and delete

    the currently selected sequence with the “Delete” button. In the center box is the list of all

    positions in the current sequence. By clicking on a sequence, it is selected as the current, and will

    change the values in the Control Panel accordingly. When a sequence of positions is completed,

    pressing the “Run Sequence” button will one by one progress through each position.

    The Panel on the right, the Control Panel, specifies a position of the RTX (Note: not

    necessarily the current one). The position can be changed by adjusting the sliders for each degree

    of freedom or manually changing the value in the textbox. The RTX can be moved to this

    position with the “Move All” button. The position can also be reached as a position in a

    sequence.

  • 27

    Figure 2.3.3 - Serial Connection: Opening Screen

    Figure 2.3.4 shows one of the many error messages that are displayed throughout the

    program. This error message “Robot is Not Initialized” is displayed when the user attempts to

    run a sequence or move the RTX without first initializing it. The other error that occurs at this

    screen is the “The RTX is currently busy” error which is displayed when a movement button is

    pressed before the RTX has finished its previous action.

    Figure 2.3.4 Serial Connection: Initialization Error

    Figure 2.3.5 shows the opening screen of connection tab when “Network Connection”

    has been selected and has made a successful connection. The screen offers the user no control

  • 28

    over the RTX, but gives the user the button scheme for how to control the RTX with the Xbox

    Controller (a requirement to reach the screen).

    Figure 2.3.5 – Network Connection

  • 29

    3 Troubleshooting

    3.1 RTX Setup Problems

    A quick checklist is shown below and suggested solutions are listed in the table 1. Is the 'MOTOR ON' or 'MOTOR OFF' light illuminated?

    2. If not, is the RTX mains power switch on?

    3. Is the cable connecting the Robot to the serial port of the computer connected and

    securely plugged in?

    4. Is the communications port correctly working on the computer?

    Quick Checklist Solutions

    RTX mains power switch If the RTX mains power switch is in the ‘Off’

    position, move it to the ‘On’

    Motor Light

    If the red 'MOTOR OFF' light is on, press the

    green 'MOTOR ON' button.

    If the green MOTOR ON' light now comes on, re-

    run the initialize program.

    If the green 'MOTOR ON' light does not come

    on, check that the emergency stop buttons have

    been deactivated.

    External Emergency Stop:

    Is the External Emergency Stop bridge

    removed?

    Any piece of wire to bridge pin 4 (data terminal

    ready) & 5 (ground) of the emergency stop

    This is required to turn on the RTX and can be

    removed as an emergency stop

  • 30

    Communication Port:

    Is the communications port correctly working

    on the computer?

    Retrace the steps outlined in section “2.2.1

    Setting up the RTX” in this manual.

  • 31

    3.2 RTX Initialization Problems

    Figure 3.1 Initialized Position of the Robot, Side and Top View

    When does the robot need initializing?

    1. Every time the robot is turned on at the mains, the RTX has to be initialized. This refers

    to the main power switch on the robot. If the MOTOR ON (green button) or MOTOR

    OFF (red button) is pressed, it is not necessary to re-initialize, as the robot will remember

    the home position.

    2. If an arm of the robot is driven against the robot column causing the belt to slip, or if the

    robot is moved manually while power is applied to the motors, this will affect the robots

    count of its current location and the robot will have to be re-initialized.

    3. If the arm is left in FREE mode, power is not sent to the motors and the arm is free to

    move. As long as any of the belts do not slip, the robot will keep track of the current

    position of its motors, and this will not require re-initialization. This is different to when

    the robot has power applied to the motors, and will resist any change of its current

    position.

  • 32

    4. When finished with the robot, operate the emergency stop buttons and leave them active.

    Turn off power to the robot and fold the arm flat against the column in its stowed position

    to keep the bench space clear.

  • 33

    4. References

    [1] W. Disotell, C. Mitchell. UMI RTX Controller, CEN 4065, Florida Gulf Coast University

    2014

    [2] W. Disotell, C. Mitchell. UMI RTX Networking, CNT 4104, Florida Gulf Coast University

    2014