Computerized Train Control System by Shawn Lord Christian
Computerized Train Control System by: Shawn Lord Christian Thompson Advisor: Dr. Schertz
Presentation Outline • Project Overview • Digital Train Control • System Components – – – • • Local Controller DCC Format DCC Encoder Switch Controller Sensor Controller Train Layout Design Implementation Results Future Work
Project Overview • Digital Train Control System – Digital Control of Model Trains – Control of Track Equipment – Computer Interface • Goals – Fully control a digitally equipped locomotive – Control of switches and layout features – Sense train locations and layout state – Link all control to a central computer – Provide a train layout for future use – Provide supporting documentation
Digital Train Control • How Digital Control Works – Command Station • Takes User Input • Sends a command signal on rails of layout – Decoder Card • Resides in each locomotive • Derives power and data from signal on rails • Powers locomotives lights and motor
Digital Train Control • Standards – National Model Railroad Association (NMRA) • Sets Industry standards for model railroading • Recently incorporated standards for digital control – Digital Command Control (DCC) • NMRA standard for digital train control • Provides standards for communication with compatible Decoder Cards • Advantages • Locomotives are individually addressable • One signal to all rails on layout • Existing industry standards
System Components Block Diagram and Data Flow Train Layout Controller Application Local Controller DCC Encoder Locomotives Track Accessories Track Sensors Downstream Upstream
Local Controller • Handles low level control of train layout – Receives commands over serial link with PC – Creates serial packet for control of locomotives – Controls switches and accessories – Polls track sensors for position reporting • Implementation – 8051 microprocessor – Programmable Logic Device (FPGA) – Signal buffering circuitry
Local Controller • Command List – Local Controller Commands – Reset All – Locomotive Commands – – – Send Override Packet Send Service Mode Packet Send From Command List Add to Command List Remove from Command List Clear Command List
Local Controller • Command List (contd. ) – Switch/Accessory Commands – – Set one output Clear one output Pulse one output Reset all outputs – Sensor Commands – Reset sensor timer – Return one sensor – Return all sensors
Program Flow Command from PC Command Processing Locomotive Add command to queue Accessory or Switch Write command out to controller Sensor Poll sensor(s) Continuously write commands out to Encoder Transmit sensor reading(s) to PC
Local Controller • Memory Allocation (Memory Mapped IO) – 0 x 00 – 0 x 07 • DCC Encoder – 0 x 08 – 0 x 7 F • Output space – 0 x 80 – 0 x 8 F • Sensor space
DCC Format • Transition based serial encoding • Bit times – 232 us – ‘ 0’ bit – 116 us – ‘ 1’ bit • Fully rectified signal provides power for trains
DCC Format • Basic Packet Format – Preamble – ten ones followed by a zero – Address – eight bits followed by a zero – Data – eight bits followed by a zero – Error Check – eight bits followed by a one {preamble}0{address}0{data}0{error check}1 • Speed Packet – 01 DCSSSS • Other Packet Types
DCC Encoder • • • Receives data from Local Controller Transmits data in DCC format Connected to external bus of Local Controller Interrupts Local Controller upon completion Implemented in VHDL Registers – 0 x 00 – 0 x 07 Command byte DCC Packet to transmit
DCC Encoder Software Flow transmit preamble command byte empty check command byte transmit idle packet command byte present transmit data bytes Interrupt processor on last bit
System Components Block Diagram and Data Flow Train Layout Controller Application Local Controller DCC Encoder Locomotives Track Accessories Track Sensors Downstream Upstream
Track Switches • Allow locomotives to change paths • Solenoid Controlled – Double throw solenoid – Requires 12 v 5 ms pulse • Motor Controlled – Small gear motor – Requires 12 v signal – Motor stalls upon end of travel
Switch / Accessory Controller • Connected to external bus of Local Controller • Latches data from Local Controller • 16 outputs total – 8 switches – 16 accessories – Sinks 600 m. A continuous or 3 A pulsed • Addresses – Address + 0 – Address + 1 Latch A Latch B
Sensors • Allow Location of locomotive on layout – Layout divided into 21 blocks – Current sensor on each block • Current sensing – 1 ohm current sense resistor – Differential voltage amplifier
Sensor Controller • Connected to A/D input of Local Controller • Data Latched from External Bus – 000 C 0 DDD • C – enables controller • DDD – selects 1 of 8 analog inputs • 8 inputs – Selected by analog switch – Inputs filtered using an RC filter
Train Layout
Train Layout • Designed for future use – 2 separate loops – 2 loopbacks – 1 crossover – 5 single ended sidings – 4 track train yard – 1 pass through siding
Train Layout
XS-40 Implementation of Design • XS-40 FPGA Prototyping Board – – Manufactured by XESS Corporation Xilinx 4005 E-pc 84 FPGA chip 8031 u. C 128 byte SRAM • Used to implement Design – Local Controller uses 8031 – DCC Encoder implemented on FPGA – Interface Board Designed • A to D converter • 256 byte EEprom Memory • External Bus
Results • Hardware – Train Layout Built and Wired – Two DCC Compatible Locomotives – Local Controller Designed and Implemented – Sensors Designed and Tested – Switches Designed and Tested – Controller Boards • (Main, Switch, Sensor) • Design and Layout complete • Not manufactured
Results • Software – Serial interface designed and Implemented – Train control designed and implemented – Switch control designed – No software support for sensors – No support for service mode packets
Future Work • Manufacture and Build Controller Boards • Software – Sensor polling – Service mode packets • Decoupling and Crash prevention
Questions ?
Web-based Control Interface For a model train control system By: Kevin Sendra Advisors: Dr. Schertz Dr. Malinowski
Presentation Outline • Overview of the Project • Project Description • Results – Problems – Future work
Project Overview • Add-on to the Local Control System • Allows control and/or view of the layout from the internet
Project Description Block Diagram Client Server and Serial Interface
Client Description • Allows the user to control the speed and direction of multiple trains • Displays connection information and command status (from server) • Image Map for switch control (no switch control currently)
Client Flowchart Start Get Parameters Thread Delay Thread Receive Create GUI Elements Send Command To Server Receive From Server Connect to Server Start Threads Event Handling Close socket End threads Wait. 5 s Append to Text Area
Current GUI
Local Computer • Server – Waits for a connection – Logs connections – Receives commands and sends them to the serial port – Acknowledges commands – Sets session length to 10 minutes • Webcam Software – Dorgem
Server Flowchart Server Start Thread Timeout Wait For A Connection Compare Stored Time To Current Time Log Connection Store Time +10 m Disconnect If Equal Wait For A Command Acknowledge Close Connection
Webcam Viewer
Results • Working graphical user interface – Allows locomotive speed and direction controls – Displays command status • Working Server • Viewable webcam stream
Problems • The computer – Speed – Security and Software • Java versions and Internet Explorer or Netscape
Future Work to be Completed – Implement switch control – Allow a configuration file to set up certain elements of the interface
Train Control 800 x 600
Questions
Local Computer Interface For A Digital Train Controller By: Zachary Kirkpatrick Advisor: Dr. Schertz
Presentation Overview • • Introduction Block Diagram Functional Description Design Accomplishments Complications Conclusion
Introduction • • • Digital Train Controller Local Computer Interface User Input Instruction Send Out Instruction Train Moves
Block Diagram User Input Local Instruction Computer Altered Input Instruction
Functional Description • • Input User Instructions Decipher User Instructions Alter Code Of Instructions Send Out Instructions To Microprocessor
Design Flow Chart User Input Power On Switch Speed Off Up Track Train Go Back To User Input Movement Down Forward Reverse
Design • Write Software To Draw Control Buttons • Output The Appropriate Information For The Corresponding Button Pressed • Use MFC Library of C++
Design Control Buttons • User Buttons – Power On – Power Off – Switch Tracks – Speed Up – Speed Down – Move Forward – Move In Reverse
Accomplishments • Buttons Were Created • Buttons Are Active • Buttons Are Either – Functional – Personal Constructors
Accomplishments
Accomplishments
Accomplishments
Accomplishments
Accomplishments
Accomplishments
Accomplishments
Accomplishments
Complications • Sickness The First Several Weeks • Slider Buttons • Auto-creation Of Files In MFC
Auto-creation Example
Conclusion • Buttons Are Created • Basis For Button Implementation Created • Need To Finish Button Implementation
Questions
- Slides: 64