กลับไปหน้ารวมไฟล์
dcc-andor-analogic-railway-controller-ac0c57-en.md

Hybrid Smart Model Railway Control System: Integrating DCC and Analog Systems

This project extends and develops upon the valuable work of Gregg E. Berman and Steve Massikker, with the primary objective of solving a classic problem for model railway enthusiasts: enabling older Analog trains, which lack DCC (Digital Command Control) circuitry, to run smoothly alongside modern control systems.

This development began between 2021 and 2022 by EMA (mbmngt@gmail.com) to expand the capabilities of the original system to support more complex functionalities, particularly the control of trains on segmented tracks (Blocks or Cantons) and automatic train position detection.

System Architecture

To accommodate a large railway network installation, consisting of 3 main circuits and 2 secondary circuits, the system is designed with a Distributed Control architecture, dividing its operation into 3 main parts:

  1. Processing (on PC): Functions as the User Interface (GUI) and the central brain for logistical calculations.
  2. Arduino Mega (Master Controller): Acts as the communication intermediary and manages traffic logic.
  3. Arduino Nano (Peripheral Controllers): Directly controls voltage and detects current in each track section.

View File Railway Controller Elect Synoptic


Hardware Integration

The key to this system's precise Analog train control is the selection of appropriate electronic components:

  • ACS712 Current Sensor: We use a Hall Effect current sensor to detect the presence of trains in each "Canton" (track block). When a locomotive moves into a designated track section, its motor draws current, causing the ACS712 to send an analog voltage signal back to the Arduino Nano. This data is processed to confirm train positions on the Processing software in Real-time, without the need for additional light or magnetic sensors on the train itself.
  • L298N Dual H-Bridge Driver: For Analog trains, speed control is achieved by adjusting voltage (PWM - Pulse Width Modulation). The L298N module allows us to independently control both the speed and direction of trains in each block, via signals from the Arduino Nano.

Software and Control Logic Management

The software system is designed to operate in coordination through various communication protocols:

1. Processing Section (Interface & Autopilot)

The PC software not only displays the visual position of trains on screen but also incorporates updated Autopilot logic, which continuously monitors status from the current sensors and automatically commands trains to stop or move to prevent collisions. Additionally, control windows have been added for accessories such as railway traffic signals and turnouts.

2. Arduino Mega Section (The Bridge)

The Arduino Mega functions as a "Gateway," communicating with Processing via Serial Communication (USB) and distributing commands to all 5 Arduino Nanos via the I2C Bus. The logic in this section is crucial for managing the data queue, ensuring that user speed control commands reach the correct train at the most stable time.

3. Arduino Nano Section (Local Control)

Each Nano is responsible for a specific track block, receiving a specific Address command via I2C and converting it into a PWM signal to drive the L298N Driver. This separation of duties reduces the processing load on the main board and makes the system easily Scalable.


Development Details and New Features

In this project, several improvements have been made over the original prototype system:

  • Customizable ControllerConfig: Users can define the railway network structure (Network Topology) themselves via a configuration sheet in Processing, making the system highly flexible.
  • DCC Standard Compliance: Although focused on Analog trains, the ability to transmit signals according to the NMRA DCC standard remains fully intact. Thus, you can control both systems of trains simultaneously on the same track.
  • User Interface: Keyboard Shortcuts have been improved for faster control, and the "Read Operation Track Current" function has been disabled on the main page to increase the responsiveness (Latency) of the control system.

Future Development Plan (Roadmap)

We are currently in the process of developing further extensions, as follows:

  1. Turnout Control System: Direct control of turnout motors via the Processing screen through the Mega board.
  2. Railway Traffic Lights System: Automatic red-green light changing logic correlated with train positions in each Canton.
  3. Accessory Control Section: Such as station lighting or ambient sound effects, controlled via the Nano.

If you are looking for a way to bring old trains back to life in the digital age, this Hybrid Controller system is the perfect answer, blending classic and modern technology seamlessly.

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x processing"
  - "1x Arduino IDE"
author: "mbmngt"
category: "Motors & Robotics"
components:
  - "1x pc computer"
  - "5x Arduino Nano"
  - "1x 500w generic pc power supply"
  - "1x Arduino Mega 2560 Rev3"
  - "12x CURRENT SENSOR ACS712"
  - "8x Motor Driver L298"
description: "The objectives of this project were therefore to control old analog locomotives (without DCC) and new DCC locomotive on the same tracks with Processing, Arduino Mega and Nano."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles:
  - "https://github.com/MBNGT/DCC-and-or-ANALOGIC-Railway-Controller/tree/Nano"
  - "https://github.com/MBNGT/DCC-and-or-ANALOGIC-Railway-Controller"
  - "https://github.com/MBNGT/DCC-and-or-ANALOGIC-Railway-Controller/tree/Mega"
encryptedPayload: "U2FsdGVkX18gkaKJYzy8RlAhe0agCMMLfO0MKuRns4gsAAQRfAvxz0NH+kv8epksKFMDqMzYuZN8ODUn1Cwq9+JAdtfJoof1BtMj4vtmpkc/EMB2ePqyV1c+PotU8ffI"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/dcc-andor-analogic-railway-controller-ac0c57_cover.jpg"
lang: "en"
likes: 1
passwordHash: "9bab4d3f48e708abb0d4bebded3bea8b806a33d1fb86716e69d08f4215c1ac27"
price: 2450
seoDescription: "Control both analog and DCC locomotives on the same tracks using Arduino Mega, Nano, and Processing."
tags:
  - "Toys"
  - "Remote Control"
  - "Communication"
title: "DCC and/or ANALOGIC Railway Controller"
tools: []
videoLinks: []
views: 1498