Motion Control Simulator Applet



Motion Control Tracking Applet

By,

Girish Chavan

Chintan Desai

Madhuri Goel

Ha Hoang Tran

Samvith Srinivas

IS 2470 – Interactive System Design

Spring 2003

Motion Control Simulator Applet

Introduction

Applet Overview:

The applet tries to give the user a feel of how 0th, 1st and 2nd order motion control works. This is achieved by asking the user to center the cursor within the target specified. The motion of the cursor with respect to the mouse movement is different for the different orders of control.

Clients and Users:

This project is being developed for Dr. Lewis, as a demonstration applet for the students in his class. This applet would be used by students to get a feel of how the different orders of motion control affect the performance. Hence the users of the applet will be the students taking the course with Dr. Lewis. The user is assumed to have just learnt what the different orders of motion are, and this applet helps to give a practical example of these concepts.

Problem Analysis:

Dr. Lewis already had a similar program which was developed as a testing and evaluating program for employees of the US Air force. This program ran on a Macintosh computer and wasn’t accessible easily by everybody. Dr. Lewis wanted something that could run off the web and be accessible to his students easily without installation of any special programs.

A Java applet perfectly suited this application.

The original program had a control panel which was used to setup the experiment, and an experiment panel which contained the target and the cursor. Once the user setup the experiment and started it, the control panel disappeared and the experiment panel appeared.

We needed to adapt this interface for Java, and keep in mind that now the target users were different. It would also be deployed on the web rather than on a stand alone computer.

Requirements Analysis:

The following features for the project were identified:

1. An introduction page which contained information about the applet, its controls and some background about the concepts of motion. It would contain a link to launch the applet in a new window.

2. A control panel that provided widgets to set the following :

a. 0th, 1st and 2nd Order motion simulations

b. Compatible and incompatible direction control modes

c. Gain control of mouse movement.

d. Delay between mouse movement and its reflection on the behavior of the cursor.

3. A help panel to display instructions and feedback to the user.

4. An experiment panel that would display the target and the cursor.

Task Analysis:

This applet would be used by the students to understand the concepts of orders of motion.

We identified one major task - “Run the experiment” that would define the purpose of the applet.

The Running the Experiment task could be broken up into 2 sub tasks

1. Set up the experiment.

2. Perform the experiment.

[pic]

This would be the natural sequence of operations by the user. However the user may also want to perform another run of the experiment with the same setup as the previous run. Hence step 2 may be iterated many times, before step 1 is again performed.

This prompted us to add the following requirements in the requirements list enumerated in the previous section.

1. Experiment setup is persistent across multiple runs of the experiment unless it is changed explicitly by the user.

2. An easy way to rerun the experiment immediately after a run without need to change the experiment setup

System Design

We employed the iterative rapid prototype development approach while designing the applet.

There were 3 major prototypes that were developed.

Prototype 1: Mouse movement tracking and mouse pointer hiding

[pic]

The purpose of this prototype was to test the mouse position tracking code and mouse pointer hiding code. It implemented basic 0th order motion control.

he mouse controlled the cursor ( + ) shown within the square box. Visibility of both the cursor and the mouse pointer would be confusing to the user hence the mouse pointer needed to be hidden when the experiment started.

The following problems were noticed in this prototype:

1. Once the experiment started, the mouse didn’t align itself to the cursor position. Hence even though the mouse pointer was hidden, the last known position of the pointer was different than that of the cursor, resulting in slight disorientation.

It was decided to snap the cursor to the mouse pointer before the experiment started so that the last known position of the mouse pointer and the cursor would be the same, and hence the user will feel that the cursor is now the mouse pointer once the mouse pointer is hidden.

Implementation Plan for Prototype 2 was decided as follows:

1. To implement the 3 orders of motion.

2. Correct the problem noticed in Prototype 1, documented above.

Prototype 2: 0th, 1st and 2nd order motion

[pic]

This prototype implemented the essential elements of the final project. It had fully functional implementations of the 3 orders of motion.

Problems identified in this prototype:

1. No clear indication of whether the experiment was running or stopped.

2. Experiment parameters could be changed in between the experiment causing confusion.

3. No clear way to stop the experiment without completing it.

Implementation Plan for Prototype 3 was decided as follows:

1. Provide clear indication whether experiment was running or not using a Experiment Status text box.

2. Disable the parameter widgets when experiment is ON to avoid modification.

3. STOP Experiment button to stop the experiment at anytime.

4. Implement other features like Gain, Delay, and Direction control.

5. Provide space for instructions to the user.

Prototype 3 : All requirements implemented.

[pic]

Problems identified in this prototype:

1. The procedure for starting the experiment became complex and included multiple steps. If the user needed to change the parameters, he would be required to do the following steps :

a. Do the appropriate changes.

b. Click on Set Parameters to finalize changes

c. Move mouse to the square in the View Panel and click on it to start experiment.

If the user didn’t want to change the parameters, he could directly start the

experiment by clicking on the square.

The problem with this approach was that there was inconsistency in procedure to start the experiment. Once the user had consecutive reruns of the experiment without changing the parameters, he was used to starting the experiment by clicking on the square. Now when he/she changed a parameter, the user tended to go directly to the square to start the experiment, without clicking on the ‘Set Parameter’ button.

It was concluded that the action of the user to click the square was sufficient proof that he had finalized the parameters and was ready to start the experiment.

Implementation plan for the final prototype :

1. Remove the Set Parameters button.

Final Prototype

[pic]

Heuristic Analysis

We did a heuristic evaluation of the applet. Shown below is a summary of the results.

| | | | |

|ID |Category |Good Feature |Problem |

|HE1: Help Panel on the applet is displaying what is to be done at all|Provide Feedback | | |

|times. | | | |

|HE2: Stop Experiment button on the control panel |Provide Clearly Marked Exits | | |

|HE3: Experiment can be stopped at any time by just clicking the |Provide Shortcuts | | |

|mouse. | | | |

|HE4: Use of radio buttons for selection of order and direction in the|Prevent Errors | | |

|experiment. | | | |

|HE5: As the control panel and the view panel are present on the same | | | |

|page and also the parameters selected are left as such even after the| | | |

|experiment is finished. User doesn’t need to remember which |Minimize User Memory Load | | |

|parameters he has selected in the previous experiment. | | | |

|HE6: Control panel is made disabled as soon as the experiment is |Prevent Errors | | |

|started. | | | |

|HE7: If the cursor remains out of the view panel for more than 5 | | | |

|seconds the experiment is automatically stopped and the accurate |Provide Feedback | | |

|feedback is provided. | | | |

|HE8: When incompatible mode is selected, the cursor jumps to left |Simple and natural dialog | | |

|border of the View Panel, when mouse pointer is brought within View | | | |

|Panel causing slight disorientation. | | | |

|HE9: Only accept legal input from user for gain and delay. |Prevent errors | | |

|HE10: Display error message when user set gain or delay to a value |Provide good error message | | |

|out of range. | | | |

Design Features:

The application consists of two main sections the Front page and the applet that runs the experiment.

The Front page consists of a link to the experiment that is run on the applet.

The front page was designed in order to satisfy two main objectives.

1) Provide the basic operation instructions to the first time user of the applet.

2) Provide a brief overview of the concepts involved for the user who would feel the need to do so.

This front page is then linked to the main experiment section which comprises of the applet.

The applet consists of basic operations instructions and continuous feedback to the user while he is experimenting. This is achieved through direct manipulation that provides the user with an intuitive feel.

The Design Features of each of the above sections is explained in more detail below:

Front Page: User Orientation

As mentioned above the front page was designed with two objectives in mind. Hence there are two main sections in the design.

Section one consists of an introduction and an overview on how to run the experiment.

This section can be read by users who are familiar with all the terms and concepts involved and users who’s main goal is to begin running the experiment.

The second section is a glossary that explains the concepts and terms that some users may not be familiar with.

These two sections appear in sequence one after the other. This is done because we do not want users who are familiar with the concepts to have to read through the glossary. However we have provided direct links to the glossary from the first section of the front page whenever a new term or concept is introduced. This is done in an attempt to serve both categories of users efficiently.

Applet: Experiment Section

The applet consists of three main sections the view panel, the control panel and the help panel. Each of these sections is marked with the respective titles.

The view section presents the visual section of the experiment. The Control Panel provides the various controls that are required. The help panel provides continuous feedback and help to the user.

Radio buttons were used for selection of Order and Direction parameters.

A combination of slider bars and text boxes was used to provide the user a choice in the type of input method while working with the gain and delay parameters.

The dialog boxes pop up to display various output and error messages.

Structural Design

The program is designed in MVC pattern to enhance the clarity and productivity.

Model class: Contains the data model of the experiment.

Control class: Contains a number of widgets and view port to allow the user to change parameters and interact with the program.

View class: Contains code to draw the content of the view panel that includes the cursor, box and target.

Model class

Properties:

1. View size

2. Box size, box position

3. Cursor size

4. Cursor position, Cursor velocity, Cursor acceleration

5. Mouse position

6. Mouse displacement

7. Interval of time that mouse move is sampled

Methods:

Set and get methods for all properties

boolean CheckCursorPos() to check if cursor is inside the target (to count for time to stop experiment)

boolean isCursorInBox() to check if cursor is inside the box (to let user to start experiment)

boolean isOutOfPanel() to check if cursor is outside of the panel.

void resetCursor() to reset the cursor position (and the box position if necessary) to the initial values.

Control class:

Properties:

Model model: contain the data model of the program

View viewPanel: contain the portion of window that the user will do experiment

JPanel controlPanel: contain all the widgets

Timer movementTimer: timer to check if the user exceeds the time limit for experiment

Timer snapTimer: timer to check if the cursor snap on the target for critical interval of time

Timer delayOutputTimer: timer to trigger for the delay output if there is delay

Timer isOutOfPanelTimer: timer to trigger for stopping the program if cursor is out of limit of view panel for too long.

Timer mouseStopTimer: timer to trigger event mouse stop.

int dt: interval time of updating cursor position

double gain: store gain value

int delay: store delay value in milliseconds

Methods:

Several mouse events take inputs from the user.

void zeroOrder(): update cursor position value in zero control order

void firstOrder(): update cursor position and velocity value in first control order

void secondOrder(): update cursor position, velocity, acceleration value in second order

void startExperiment(): start the experiment

void stopExperiment(): stop the experiment

void updatePosition(): update position in the screen

View Class :

The view class inherits from the class “JPanel”, so we override the class JPanel’s “draw” method with our code, so that the “View” class can be assigned the responsibility to display the output. According to our design the “Controller” class uses the “set ()” methods of the class “Model” and sets all the values in the “Model” class, then the “Controller” passes this “Model” Object to the “View” class, and “View” class uses the “get ()” methods of the “Model” Object to get the co-ordinate values, so that it can draw the resulting output on the screen. Thus breaking the task into three classes according to the MVC architecture greatly helped us to divide the project equally among the group members, and the responsibility assignment to each class was very intuitive.

The following Class Diagram shows the relationship between these classes.

[pic]

Responsibilities

Chintan Desai: Task Analysis, Structural Design, Coding, Final Report Writing, Heuristic

Analysis.

Girish Chavan: Task Analysis, Structural Design, Final Report Writing, Heuristic Analysis,

Presentation.

Ha Hoang Tran: Task Analysis, Structural Design, Coding, Debugging.

Madhuri Goel: Task Analysis, Coding, Heuristic Analysis

Samvith Srinivas: Task Analysis, Heuristic Analysis, Final Report Writing, Presentation.

-----------------------

Run the Experiment

Setup the Experiment

Perform the Experiment

0

1

2

View

Model

Controller

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download