My Model Train PLC Project Update

mikeexplorer

Member
Join Date
Nov 2018
Location
Scranton,PA
Posts
211
I have been doing this project as a means to learn PLC programming. Awhile back I got stuck in a rut with doing this project and I asked some questions here. Thanks to others who pointed out some bad programming practices I was using in designing this project I was able to overcome the problems.



Originally I designed it with a Micrologix 1000 PLC, but soon ran into several problems, one was the limited I/O and that it could not be expanded. Plus its a discontinued model and twice I had to repair it for bad output relays. It also had limited memory and by the time I wrote in one of the train operations, I was nearly out of memory.



This is the "Second generation" project. I upgraded to a Micrologix 1400 which allowed for more I/O and Ethernet capability for the HMI. The RSlogix Micro Starter was not the expensive to purchase (about $160) so for a "home budget" it was a good way to go. I am using a C-more Micro for the HMI panel because it was not expensive. I also had on hand a smaller 4 inch panel which I discovered also has an ethernet port so I plan to use it for a second display. I originally bought this one several years ago to use with my trainer kit and basically has sat off to the side for awhile. Now I can use it.



Eventually this project will be transferred to my living room. I already have an around the ceiling layout now so I designed this project to be basically the same track layout. I have a pedestal from an old take-out robot which is where the HMI panel will be mounted.



This is a tour of the project with the hardware and ladders and a demonstration of routines. At the time I didn't have any written yet but I designed a menu system for the routines. It was originally an idea of the "mission" code that is on the website "contact and coil" but I later designed my own way to run routines and seamlessly hand off to another routine.


https://youtu.be/J8KkBaR-8PE
 
One of my locomotives has been acting weird with its direction control. It is due to the electronic direction control is failing and over time it is getting worse. However, I have been able to exploit this problem as a means to test my programs to react to a situation where things don't go as planned. This is one example where the subroutine gave up after so many tries to get the locomotive to run in the correct direction and shut down the layout.



https://youtu.be/WPXMWCp6vd8
 
The program for this project is large, but as shown above with the train operation routines and the menu system how one routine can hand off to another and the concept of routines that run endlessly and some routines that do an operation and end. If anyone wants to see that part of the code I will post it.



It is kind of a "mission" as described in "contact and coil" but utilizes integers to jump to the selected operation and using a flag that I call "end request" which will tell an endless running routine to end its operation at a given state. Train operations that are not endless would ignore this flag, complete its operation, then end.



I am using integers to indicate what the current running routine is, and what the "next" routine will be and another integer is set as a flag to tell the main ladder that the routine has ended so it knows to hand off to the next routine.


Mike
 

Similar Topics

Hi, does anyone here have expertise in configuring the Daniel Model 2500 series flow computer? I need to configure my Daniel flow computer but...
Replies
0
Views
98
Hi, I have an ACS550 that I have an issue that when I press the run forward or jog forward, the motor chatters or runs in the wrong...
Replies
0
Views
127
Good Evening , I came across a Red Lion MODEL IFMA - DIN-RAIL FREQUENCY TO ANALOG CONVERTER today . I didn’t have time to study up on it . Have...
Replies
4
Views
254
how can I connect with this type of PLC to download the program? Do I need an adapter for communication with laptop or do I only need a db9 cable...
Replies
0
Views
201
I have been trying to connect a Yuanben RFID reader to a Xinje PLC but im unable to display the numbers on the RFID tag onto the display, im not...
Replies
0
Views
218
Back
Top Bottom