Introduction to Computers and Engineering Problem Solving Spring 2012 Problem Set 8: Rail switching Due: 12 noon, Friday, April 27, 2012

Similar documents
CSCI 135 Programming Exam #0 Fundamentals of Computer Science I Fall 2013

Issue 2.0 December EPAS Midi User Manual EPAS35

EPAS Desktop Pro Software User Manual

Vanpool Regional Administration

Red Light Camera Frequently Asked Questions

ELD DRIVER GUIDE June 21, 2018

What s cooking. Bernd Wiswedel KNIME.com AG. All Rights Reserved.

2004, 2008 Autosoft, Inc. All rights reserved.

V 2.0. Version 9 PC. Setup Guide. Revised:

PROMAS Landmaster. Table of Contents. Training Exercises - Day 2

Project 2: Traffic and Queuing (updated 28 Feb 2006)

2016 Reporting Guide W Sharp Avenue, Spokane, WA POOL (7665)

CSCI 135 Programming Exam #2 Fundamentals of Computer Science I Fall 2013

DEPARTMENT OF TRANSPORTATION. National Highway Traffic Safety Administration. [Docket No. NHTSA ; Notice 1]

ECT Display Driver Installation for AP2 Module

Department of Technology Fall 2004

Frequently Asked Questions: EMC Captiva 7.5

BUMP AND SPIN KIT ESSENTIAL INFORMATION. Version 1.0 PROGRAM AND DESIGN YOUR OWN BUGGY WITH THIS

ENGR 40M Problem Set 1

Tutorial. Running a Simulation If you opened one of the example files, you can be pretty sure it will run correctly out-of-the-box.

oxigen system The 'C' type chip 1/ 9 Type C SSD - D132 - oxigen in-car chip manual The type 'C' chip is a compact and powerful device.

SMART PASSENGER TRANSPORT

Overview of operation modes

National Search Dog Alliance (NSDA) Land Human Remains Detection Field Test

COLORADO DEPARTMENT OF LABOR AND EMPLOYMENT DIVISION OF OIL AND PUBLIC SAFETY STATISTICAL INVENTORY RECONCILIATION (SIR) GUIDANCE DOCUMENT

The City of Salisbury s Automated Speed Enforcement Program Frequently Asked Questions

Introduction. E-Trac Xchange is versatile and easy to use, so make the most of your E-Trac with this great new feature. Enjoy!

Village of Lombard Automated Red Light Enforcement Program. OPTION I. Pay the Fine

Aural Skills I Syllabus Spring 2015

Agricultural Machinery Illumination and Safety Act (AMISA)

What s Inside? Colorado Department of Revenue Tax Forms, Information and E-Services

What Industrial Contractors Need to Know About MSHA Before Work at a Mine Site?

Official Powerdyne Model BD Supercharger and Kit Limited Warranty

APPROVE ESE OFFICE WORK INSTRUCTIONS

Zio Decoder App. Quick Start Guide

Vehicle Programming Instructions

The CMPE 118 Cockroach Robot Dept. of Computer Engineering, UCSC

Park County Windrider Transit

PROBLEM SOLVING COACHES IN PHYSICS TUTORING PART 2: DESIGN AND IMPLEMENTATION. Qing Xu 4/24/2010 MAAPT

Rig Master Power by Mobile Thermo Systems Inc.

THERMOMETER PROJECT KIT

WIRELESS BLOCKAGE MONITOR OPERATOR S MANUAL

COMMERCIAL DRIVER APPLICATION

Parts and Accessories Necessary for Safe Operation; Application for an Exemption from Great Lakes Timber Professionals Association.

SEG-D, Rev October 2015 Release letter

GENERAL CHEMISTRY. Sub-disciplines of Chemistry. Course Organization. Course Organization: People. What You Need for Lecture

RailPro DCC User Manual

Objective: Estimate and measure liquid volume in liters and milliliters using the vertical number line.

OPTION I. Pay the Fine

ibusiness Banking Application Form Welcome to ibusiness Banking Need help completing this form? Adding an Additional Company to an existing Group

Application for Steam Service

TROUBLESHOOTING TP. Index

Contents Getting Started with PrePass ELD...4 Starting a Trip...7 During a Trip Co-Driver Features... 14

EIVA NaviPac. Tug Management Module. Object Based with Telemetry & Rigmove

Town of Centreville Automated Speed Enforcement Program

Objective: Estimate and measure liquid volume in liters and milliliters using the vertical number line.

IGNITION INTERLOCK LIMITED LICENSE THE LAW Frequently Asked Questions

Pre-lab Questions: Please review chapters 19 and 20 of your textbook

The Commonwealth of Massachusetts

DRIVER QUALIFICATION FILE CHECKLIST

LEAP: LSC Evaluation and Achievement Program

Calvert County s Automated Speed Enforcement Program Frequently Asked Questions

Southern California Edison s Charge Ready Home Installation Rebate Pilot (CRHIRP) Sample Supporting Documents

Introduction: Supplied to 360 Test Labs... Battery packs as follows:

ESSENTIAL INFORMATION /2153 BUILD INSTRUCTIONS HOW THE BUGGY WORKS EXPLORE SOLAR POWER WITH THIS SOLAR POWERED BUGGY. Version 2.2

DRIVER'S APPLICATION FOR EMPLOYMENT

BX Licensing System. Instructions for Request and Use of BX Software Add-Ons

index changing a variable s value, Chime My Block, clearing the screen. See Display block CoastBack program, 54 44

Release Enhancements GXP Xplorer GXP WebView

Power Team Mission Day Instructions

OTS Technical Advisory Committee Meeting

Serial adapter 1.0 V10 Fadec to serial comunications

Build a Simple Handheld Throttle for the Digitrax Zephyr

Fiorano ESB 2007 Oracle Enterprise Gateway Integration Guide

C-Start Configuration Form

BX Licensing System. Instructions for Request and Use of BX Software Add-Ons

Rank Recommended. 1 Senior

SAFETY-- SECURITY-- SIMPLICITY! TM

LU23, LU28 & LU29 Series Quick Start

8 Tips and Tricks for Improving Rolling Stock Lighting ( Robert J. Wilkins Oct 2017)

Cedar Blue Property Owners Association Board Meeting Minutes November 17, 2018

SEG-D, Rev September 2014 Release letter

Driver Qualification Handbook

An ISO 9001:2008 Registered Company

RPK-1 RailPro Model Railroad Control System Starter Kit

Experiment 6: Induction

Energy Performance Information Request Timeline

EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

Real-time Bus Tracking using CrowdSourcing

HC Model Railroad Handheld Controller

ZLogs Help. Tablet Applications. Contents. ZLogs Help

MaxSonar Operation on a Multi-Copter

RETAINS STEERING WHEEL CONTROLS, FACTORY SETTINGS AND MORE!

GRADUATED LICENSING. KITCHEN TABLE DISCUSSION GUIDE Have your say on Your PLates reforms

EchoPod. UG06 & UG12 Series Quick Start Flowline, Inc. All Rights Reserved Made in USA. Ultrasonic Liquid Level Transmitter

BAS Construction Checklist

A R T I C L E S E R I E S

Village of Schiller Park Automated Red Light Enforcement Program

Mo. Day Year. The last four digits of the phone number are required for rebate processing.

Smart Traffic Lights

Transcription:

Introduction to Computers and Engineering Problem Solving Spring 2012 Problem Set 8: Rail switching Due: 12 noon, Friday, April 27, 2012 1. Problem Statement Railroads use radio remote control systems for an operator on the ground to control engines switching cars in a rail yard. We will simulate a simple version of such a system in this homework, which will have just one track, one railroad car, and one engine. Your program will allow remote control of the engine speed, direction and coupling to a car. It must have a safety feature that stops the engine if it detects a lighted object in its range, such as a car with an end marker. You should base your program on the Phidget and Swing vehicle application from lecture, although you will need to make substantial modifications: The slider sensor must control engine speed in either direction. A value near the middle is zero mph; allow a range (e.g., 450 to 550) to be zero speed. The high range (550 to 1000) indicates positive speeds and the low range (0-450) indicates negative speeds (going backwards). The GUI must show the engine moving across the display. You will have to keep moving the slider sensor to keep generating events so that the engine keeps moving. This feature exists in real systems, and is both an annoyance and a safety feature: if the operator is incapacitated, the engine will stop. The force sensor must be used to couple or uncouple a car from the engine. The car and engine must be adjacent to be coupled or uncoupled, and the speed of the engine must be zero. Use a force threshold of 300. The light sensor must be used to initiate an emergency stop. Cars and employees have reflective surfaces and the engine has lights and a light sensor that detects reflected light. When the light sensor detects a high light reading, the engine speed is immediately set to zero. The engine can be restarted only after the light sensor reading is low. Use a light sensor threshold of 300. In a real system, you would use the Phidgets digital outputs to send digital signals to control the engine. These are being simulated by calls to repaint() in the GUI in this homework. The figure below is a very simple example of the GUI. The engine is red, the car is black, and the track is blue. The figure shows the starting position, with the engine and car separated. In the solution GUI, the car and engine are filled (rather than drawn) when they are coupled. You must indicate when the car and engine are coupled, but you may do it in any way that you wish. 1.00 Spring 2012 1/5 Problem Set 8

Initial position: After coupling: After the engine pulls and then decouples from the car: 2. Program Use the basic structure from the vehicle example in lecture 26. The GUI must show at least the track, the engine, and the car. The display must show the location, direction and speed of the engine. No text is required; the display must show the movements of the engine and car. After the engine has approached within a meter/pixel of the car, it can then be coupled to the car by pushing the force sensor, but not otherwise. When the engine and car are touching each other but are not coupled, moving the engine in the direction of the car should cause neither the engine nor the car to move. The engine can be coupled to or uncoupled from the car by pushing the force sensor only when the engine is stationary (i.e., only when the slider value is between 450 and 550). Commands for coupling or uncoupling must be ignored when slider has a value outside the 450-550 range. You may get multiple coupling events when pushing the force sensor, since it will generate a number of events at similar pressure values. Implement a simple way to limit this problem if you can see one; it s ok if the user needs to push the force sensor a few times. Your engine and car must stay on the track segments shown in the GUI. If they hit the end of track, speed is set to zero. Have your track go from x=100 to x=800. The GUI can be quite simple it does not need to be beautiful, just functional. 1.00 Spring 2012 2/5 Problem Set 8

Your application must use a model-view-controller pattern. The view just does the drawing, as shown in the examples. The model computes speeds, locations, coupling, etc. The controller draws the frame, opens and closes the Phidgets interface kit, and handles sensor events. The controller should have a quit button so that the text file being written (see below) can be closed correctly. You must write the key events from your simulation to a text file using a Java stream. Let the x location of engine or car be its leftmost coordinate. You must write the following data to the text file: The engine s x location of any coupling event and uncoupling event. The x location if the engine hits the start of the track. The x location if the car hits the end of the track. The engine s x location and sensor value of any light event that causes the engine to stop. The final x locations of both engine and car. Decide the appropriate method and class design to write these events. Also: Write the event type as well as the required data. Call the file HW8Out.txt. Minimize the number of duplicate entries in the text file. Use booleans to detect when you re in a given state, and only write to the text file when the state changes (e.g., if you re at end of track and stay there, write that event only once). When you run your program you must: Move the engine next to the car. Couple to the car. Go to the right end of track. Go to the left end of track. Go back toward the center of the track. Uncouple from the car. Move the engine to the left, and stop it with a light sensor event. These events must be recorded in the text file that you submit. Your sensors must be on the following analog ports: 1. Force sensor 2. (Rotation sensor used only in extra credit) 3. Light sensor 4. Slider We will deduct points if your sensors are not on these ports. (We need to be able to grade your submissions on our test setup efficiently.) Sample output is shown below. Yours will be different, based on how you manipulate your sensors: 1.00 Spring 2012 3/5 Problem Set 8

Coupled at: 600 Engine and car at end of track: 720 Engine at start of track: 100 Uncoupled at: 394 Engine at start of track: 100 Light event: 205 Last position of engine: 205 Last position of car: 394 3. Extra Credit In addition to your solution above, you may implement additional functionality for this problem set and get up to 40 extra credit points. You must first complete and submit the entire standard solution as outlined above. Do not attempt to develop the extra credit solution until you have completed the normal assignment since it will be graded separately. When you submit your solution to the 1.00 Web site, first submit your original solution. Then upload your extra credit solution as a second.zip file. Both versions should contain all the files needed to compile and run your solution. You can get extra credit on only one homework from problem sets 8 to 10. If you don t have time do to the extra credit this time, you still have the opportunity to do so in the future. For extra credit, your program must have two cars on the track in addition to the engine. The user must be able to couple and uncouple either of them, one at a time, with remote control. Use the rotation sensor to select which car to couple or uncouple; place it on analog port 2. Connect two LEDs to digital output ports 1 and 2, and turn the first LED on if and only if engine and the first car are coupled; turn the second LED on if and only if the two cars are coupled. When you write the events to the text file, include which car is being coupled or uncoupled. For the extra credit problem we provide images of the engine and car. See the homework 8 download zip file. Instead of drawing rectangles, you must render pictures of the engine and cars and move them around. You are welcome to use your own images. Images courtesy of Ken Houghton Rail Images, via http://www.rrhistorical.com/ 1.00 Spring 2012 4/5 Problem Set 8

For methods of image loading and rendering, see online documentation at: http://docs.oracle.com/javase/tutorial/2d/images/index.html Below is a snapshot of an engine and two cars when the engine and the first car are coupled. You are welcome to add any additional cool features. Turn In 1. Place a comment with your and your partner s full names, sections, TA names and assignment number at the beginning of all.java files in your solution. In this homework, you will have multiple.java files. 2. Place all of the files in your solution in a single zip file. a. Do not turn in electronic or printed copies of compiled byte code (.class files) or backup source code (.java~ files) b. Do not turn in printed copies of your solution. 3. Submit this single zip file on the 1.00 Web site under the appropriate section and problem set number. For directions see How To: Submit Homework on the 1.00 Web site. 4. Your solution is due at noon. Your uploaded files should have a timestamp of no later than noon on the due date. 5. After you submit your solution, please recheck that you submitted your.java file. If you submitted your.class file, you will receive zero credit. Penalties 30 points off if you turn in your problem set after Friday noon but before noon on the following Monday. You have one no-penalty late submission per term for a turn-in after Friday noon and before Monday noon. No credit if you turn in your problem set after noon on the following Monday. 1.00 Spring 2012 5/5 Problem Set 8

MIT OpenCourseWare http://ocw.mit.edu 1.00 / 1.001 / 1.002 Introduction to Computers and Engineering Problem Solving Spring 2012 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.