COMPUTER BASED REMOTE CONTROL FOR LAYOUT OF SCALED MODEL TRAINS



Similar documents
DSO138 oscilloscope program upgrade method

EDI Distributor Control Interface Wiring and Setup Instructions

Bluetooth HC-06 with serial port module Easy guide

Using Xbee in Serial Communication

Accurate Measurement of the Mains Electricity Frequency

Serial Communications

Freescale Semiconductor, I

EVAL-UFDC-1/UFDC-1M-16

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

Design and Implementation of an Accidental Fall Detection System for Elderly

MSITel provides real time telemetry up to 4.8 kbps (2xIridium modem) for balloons/experiments

Software User Guide UG-461

S7 for Windows S7-300/400

Smart Queue Management System Using GSM Technology

Access Control Using Smartcard And Passcode

Firmware version: 1.10 Issue: 7 AUTODIALER GD30.2. Instruction Manual

UTILITY INSTRUCTION MANUAL BNP-B2196 (ENG)

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

Installing the Gerber P2C Plotter USB Driver

Mitsubishi Electric Q Series PLC Ladder Monitor. Operation Manual

Tutorial for MPLAB Starter Kit for PIC18F

User Manual. AS-Interface Programmer

Operating Instructions Serial Monitor ROBERT RIELE GmbH & Co KG

MCB3101 (Class I) WiRobot Serial Bluetooth Wireless Module User Manual

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Short Manual Intellect v SP2 module Unipos Contents:

Hydras 3 LT Quick Start

7.7 Ethernet Communication (AFPX-COM5)

User Guide Win7Zilla

LEN s.r.l. Via S. Andrea di Rovereto 33 c.s CHIAVARI (GE) Tel Fax mailto: len@len.it url: http//

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual

OWNERS MANUAL. Status Monitor. for Windows 95, 98, ME, NT 4, 2000 & XP. SIGNALCRAFTERS TECH, INC.

DK40 Datasheet & Hardware manual Version 2

1. SAFETY INFORMATION

8051 MICROCONTROLLER COURSE

How do I Check if My Computer is Compatible with Windows 7

Bidirectional Communication With EPABX for Hotel Management Software (HMS) using Handshaking Protocol

Implementing a Digital Answering Machine with a High-Speed 8-Bit Microcontroller

Ocean Controls RC Servo Motor Controller

Remote control circuitry via mobile phones and SMS

Modern Robotics, Inc Core Device Discovery Utility. Modern Robotics Inc, 2015

APPLICATION. Using the PB-100 to Make Calls and Announcements From a Database. Using the PB-100 for All-Call Dialing

PLC Support Software at Jefferson Lab

LDG DTS-4/4R Desktop Coaxial Switch / Remote

A 5 Degree Feedback Control Robotic Arm (Haptic Arm)

CGI-based applications for distributed embedded systems for monitoring temperature and humidity

Single channel data transceiver module WIZ2-434

Date Rev. Details Author

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205]

STIM202 Evaluation Kit

Home Security System Using Gsm Modem

WEA-Base. User manual for load cell transmitters. UK WEA-Base User manual for load cell transmitters Version 3.2 UK

USER MANUAL GUIMGR Graphical User Interface Manager for FRM301/FRM401 Media Racks

Location-Aware and Safer Cards: Enhancing RFID Security and Privacy

RGK60 RGK50 RGAM10 RGAM20 RGAM4 Generator set control units

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

SIEMENS S

Networks and Connections in the Counting Room

User Manual. Thermo Scientific Orion

TCP/IP MODULE CA-ETHR-A INSTALLATION MANUAL

Raghavendra Reddy D 1, G Kumara Swamy 2

Chapter 8 Objectives. Chapter 8 Operating Systems and Utility Programs. Operating Systems. Operating Systems. Operating Systems.

Eureka Technology. Understanding SD, SDIO and MMC Interface. by Eureka Technology Inc. May 26th, Copyright (C) All Rights Reserved

HMI EMBEDDED SYSTEM DESIGN AS A FUNCTION OF TECU

CAN bus board. EB018

Fingerprint Based Biometric Attendance System

APPLICATION PROGRAMMING INTERFACE

Part Number Revision A, January Monitoring System Rack Configuration and Utilities Guide

Synergy Controller Application Note 4 March 2012, Revision F Tidal Engineering Corporation Synergy Controller Bar Code Reader Applications

Computer Automation Techniques. Arthur Carroll

Automation System TROVIS 6400 TROVIS 6493 Compact Controller

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

Lab Experiment 1: The LPC 2148 Education Board

T-BOXN12R. First steps with T-BOXN12R. You can make it wireless. Date: Version 1.0

Vicon Flash Upgrade Software

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

Quick Installation. A Series of Intelligent Bar Code Reader with NeuroFuzzy Decoding. Quick Installation

Microcontroller Based Anti-theft Security System Using GSM Networks with Text Message as Feedback

STEPPER MOTOR SPEED AND POSITION CONTROL

System Integration Software

AC-115 Compact Networked Single Door Controller. Installation and User Manual

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Computer Requirements

2011, The McGraw-Hill Companies, Inc. Chapter 3

Gigabyte Management Console User s Guide (For ASPEED AST 2400 Chipset)

User Manual Software for DSL Digital Speed Switch

SA-9600 Surface Area Software Manual

Development of a GSM based Control System for Electrical Appliances

Microcontrollers in Practice

TEST CHAPTERS 1 & 2 OPERATING SYSTEMS

LDCDP GdW. L force Controls. Ä.GdWä. Software Manual. Industrial PC. WindowsR CE Thin Client. Operating system

1. Introduction... 3 Introduction Deal command... 13

Display Message on Notice Board using GSM

Performance analysis and comparison of virtualization protocols, RDP and PCoIP

Documentation. M-Bus 130-mbx

How To Control Gimbal

Remote PLC system using GSM network with application to home security system

Event Log. Chapter 7 Event Log Event Log Management Excel Editing Create a New Event Log... 9

A DIY Hardware Packet Sniffer

Transcription:

COMPUTER BASED REMOTE CONTROL FOR LAYOUT OF SCALED MODEL TRAINS Ivan Ivanov Monov, Ivan Petrov Gorchev Technical University - Sofia, 8 Kliment Ohridski Blvd., Sofia 1000, Bulgaria, phone: +359 887 204488, +359 886 796456 e-mail: ivanmonov@yahoo.com, ivan.gorchev@gmail.com For the realization of the project a special device was made together with a software application for remote control of a set up electric layout along which scaled model trains move. This program sends commands to the device which controls the layout. The device is designed to work with 8051 based microcontroller and controls the direction of movement, the speed as well as separate element of the layout (switches, signals, etc.). The program is developed in C++ and used for visualizing the layout as well as for visualizing and changing of the variable elements along the layout at a certain moment. Serial port for communication was used for exchanging data between the program and the device. The project was realized and presented at the technical exhibition Expo Intellect at the Technical University of Sofia in November 2004 and was awarded special prizes from the Bulgarian Industrial Association and Association Bulgaria. Keywords: computer, remote, control, trains, layout 1. SOFTWARE APPLICATION 1.1 Basic Functions The software application works in two modes a mode of editing and a mode of control of the layout. In the editing mode elements of the layout may be added, changed or deleted. In the control mode by means of clicking on a certain element of the layout it may change its state, and by sending a command to the hardware device, it may change the state of the responding element of the model layout. On the outlined scheme of the layout, as in a real controller s station, every element which can be controlled is indexed. The user may change the size of the working grid, the speed and the direction of the train s movement along the layout. 1.2 Realization For the implementation of the program a multitude of separate modules was created. The main program links to them with the aim to facilitate the development of the necessary algorithms and the reduction of the amount of written code. By using the so called multiuse instancing memory and disk space are saved. A document-view architecture supplied by MFC (Microsoft Foundation Classes) is used. In this way the data in the document is separated from the view which the user gets about it. The developed program product is an MFC SDI (Single Document Interface) application which uses as a main class of the view CScrollView. This enables the 47

user to move across the screen by means of scroll bars. The main part of the application is concentrated in four classes class of the application, class on the main frame, class of the view and class of the document. The code of the base document class interacts with the menu-elements for work with files (FileNew, FileOpen, FileSave) and the derivative document class does the reading itself and the writing of the document object s data. The base view class is a window contained in the window of the main frame. The derivative view class interacts with the associated to it document class and performs the input-output operations of the application for print on the screen and to the printer. The derivative view class and its base classes process the Windows messages. The MFC libraries dictate all interactions between the documents, views, windows of frames and objectapplication, mainly by virtual functions. Fig. 1 Structure of the view class. 48

Each dialog in the application has its own class in which all the information about it is contained the controls which it has, the variables to them, the functions for processing of certain events as well as all the necessary functionalism. In different cases the dialogs may be loaded modally (e.g. the Splash screen dialog) where the user cannot return and use the main view until he hasn t closed the respective modal dialog. The other way of showing dialogs is non-modal where the user may work simultaneously in the window of the dialog and in the main view (e.g. the dialog of the speed control and the direction of movement). The application stores it s settings in the system registry and at each run they are loaded from it and applied. 2. HARDWARE DEVICE 2.1. Design Description and Basic Functions The purpose of the electronic device is to allow the user to control a scaled train model in real time via PC. The connection between the PC and the device is via serial RS-232 port. The speed is 9600 bits per second, 8 data bits, one stop bit without parity control. The electronic device can manage 128 elements of the layout like switches and signals separated in 16 zones with 8 elements in every zone, the direction of movement forward of backward, 8 steps of the speed of movement of the composition from zero to full speed with smooth acceleration. The device is designed as one Main Unit and Extension Units. The main unit controls the speed and the direction of motion. There are 16 Extension Units, each of them controls 8 elements of the layout. 2.2. Block Structure of the Electronic Device Figure 2 shows the Block structure of the Main electronic device. Fig. 2 Block Structure of the Electronic Device. 2.3. Block Description The Power Supply Unit comprises a transformer, a rectifier and two switching power regulators. The transformer is the original one from the PIKO Train model 49

sets. The Power Supply Unit provides +5V for the integrated circuits and +18V for the switches and the signals. The RS-232 Driver is based on MAX232 IC. Its purpose is to convert the specific levels of RS-232C signal to TTL compatible levels and vice versa. The electronic device is based on АТ89С52 microcontroller, manufactured by ATMEL with Intel 8051 core. Depending on the commands received from the PC the microcontroller generates signals which control the elements of the layout and the speed. Received commands are separated in two classes speed control commands or layout element control commands. The microcontroller keeps information for the condition of each element of the layout in an array in its internal memory. Block Registers contain registers for the layout condition. The information written is a copy of the information stored in the microcontroller memory. When the condition of element is changed the microcontroller rewrites the contents of the corresponding register. Block Buffers is based on MOS transistors. Its purpose is to control the elements of the layout with high current consumption switches and signals. The peak current is almost 1.5А in transient moments. The active output level is 0. There are a couple of transistors for each buffer. The Speed Control Unit is based on a switching power regulator. The speed is controlled by the voltage of the locomotive engine. When the feedback factor is changed the output voltage changes too. There are 8 fixed feedback steps. There are 8 corresponding speeds of motion. The motion direction changes with changing of the locomotive engine voltage polarity. The polarity is changed by a relay. 2.4. Firmware The Firmware is written in Assembler for Intel 8051. The purpose is maximum optimization and optimal usage of the microcontroller resources ROM, Flash, RAM. Figure 3 shows the block structure of the Firmware and the format of the PC commands. The purpose of the Initializing block is to initialize the device after Reset. The main loop contains PC command waiting, command recognition, execution and reply. The commands are two types commands for speed control and commands for element control. The type of command depends on the MSB (Most Significant Bit) - S/ E. If the MSB is set ( S/ E=1), the command is for speed control and the Speed Control procedure runs. The 3 LSBs (Least Significant Bit) indicate the number of the speed from 0 to 7. The MSB of the less significant nibble (D) shows the direction of motion - forward if D=1 and backward if D=0. If the MSB is reset ( S/ E=0), the command is for element control. The Element Control procedure runs. The 4 bits of the less significant nibble indicate the zone where the element is located from 0 to 15, the 3 LSBs of the most significant nibble indicate the index of the element in the zone from 0 to 7. After the procedure is executed a Reply is sent to the PC. This Reply is the code of the executed command. 50

Fig. 3 Block Structure of the Firmware and the Communication Protocol. 3. REFERENCES [1] Monov I., Computer Based Remote Control for Layout of Scaled Model Trains - software, TU-ES, Sofia, 2004. [2] Gorchev I., Computer Based Remote Control for Layout of Scaled Model Trains - hardware, TU-ES, Sofia, 2004. 51

52