mikeexplorer

Introduction, new to fourm

12 posts in this topic

Hello everyone, my name is Mike and I thought I would introduce myself. I am new to the fourm board but in the past searching online for answers to my questions has lead me here several times, so I thought it would be better to register and become a member.

 

My project is probably going to seem unusual and not very practical to most. I used to do some computer programming back in the 1980's to 1990's, but only for home use. Over the course of the years with my job as a technician, first with a CD/DVD manufacturing facility, and now plastic sheet and products manufacturing, I have had to troubleshoot PLC's for years. I have had to work on several types, mainly to troubleshoot them and load the programs back into memory when needed.


I wanted to learn how to do actual programming. I purchased a small training kit with an Allen-Bradley ML1000 which has six inputs and four outputs attached with several switches and lights. Seemed to go OK, but I wanted to do something more "real world" then just pushing buttons and such. At the time, the DVD plant was closing up and I was allowed to remove parts from the machines to take home since all was being scrapped.

I do have a model train layout around the wall of my living room. Documented here, the video links are missing and I have to fix that.
 

https://www.nepaview.com/the-wall-mount-counstruction.html


I thought perhaps a good real world example would be to control the layout using a PLC. I used the parts I was able to obtain from my prior job to build this, I found on Ebay the better Micrologix 1000 that has more I/O. I figured for now to stick with this since I already started using a training kit with Allen-Bradley. I did obtain some PLC modules which do have a few more I/O then the ML1000 does. I also obtained several Proface HMI panels, but have had no luck getting them to communicate to the PLC.

I am only using the RSLogix Micro Starter software as it is still free to use. I posted my progress on my website here which also has a few video links for the programs I wrote so far. Since I am using the free software I am limited to the 1000 and 1100 series PLC's Since there is no analog I/O available for these, I cannot control the speeds of the trains.

https://www.nepaview.com/model-train-plc-project.html


If anyone wants to see any code I have written so far, I would appreciate any feedback on how I am doing. It has been a lot of trial and error so far, but its cool to see a program working and running the trains. I did also incorporate a safety circuit which for a model train layout would be not needed, but since PLC's are used in industrial controls, safety circuits are an integrated part of machines and I wanted to follow that idea in the design of the controls for the layout.

Since I had no luck trying to get the Proface panels to work, I purchased a C-more panel since it was not very expensive and the software was free to download. I am having success with the communication with the PLC and the eventual plan is to utilize it to control my layout in my living room.

I still have a long way to go to finishing this project, plus plenty to learn about programming, but it has been a good learning tool so far.


Mike

Share this post


Link to post
Share on other sites

That looks like a very fun project.  Go ahead and post your RSS file here, I'd love to see what you have done.  One note, there are analog versions of the Micrologix 1000 and analog expansion modules for the Micrologix 1100 so later you could do some upgrades to control the train speed.  Good luck and keep us posted!

Share this post


Link to post
Share on other sites

The actual .RSS files or PDF's of the report?

 

Share this post


Link to post
Share on other sites

The RSS file would be easiest

Share this post


Link to post
Share on other sites

Attached is the latest program I wrote.  The main program is only a test for the subroutines. To help understand it better I attached a diagram of the track layout and the PLC assignments.

Originally I wrote the forward-reverse routine as a main program to figure out how to do it, but since I need this for 4 areas on the track, I thought it would be better to make it a subroutine and pass in a binary data which area I want to operate and the direction. I also made a few quick videos of the tests. The first video explains why I need this routine and why the PLC cannot have memory of the trains direction.

 

Second test

 

Mike

 

 

Data files IO.pdf

FWD-REV subroutine test.RSS

Track Diagram.jpg

Share this post


Link to post
Share on other sites

I also recently purchased a C-More HMI panel and started making screens for the layout. These are rather crude as they are the first try to doing this.

 

Second test, motion detection

Third test, showing the check to make sure switches are clear for change.

 

Mike

 

 

 

 

Share this post


Link to post
Share on other sites
On 12/7/2018 at 7:37 AM, TWControls said:

That looks like a very fun project.  Go ahead and post your RSS file here, I'd love to see what you have done.  One note, there are analog versions of the Micrologix 1000 and analog expansion modules for the Micrologix 1100 so later you could do some upgrades to control the train speed.  Good luck and keep us posted!

Have you had a chance to look at what I wrote? I am curious for someone to look at it and give me feedback as far as how I am doing so far.

I have found the model railroad layout has worked very well as a "real world example" compared to a training unit with pushbuttons and switches.

I have had other feedback that I incorporated a safety relay and circuit would seem silly since it is not an industrial control, but I also wanted to follow the principals of industrial controls to have a safety circuit, and that the PLC should NEVER be used as a safety circuit. It has come in useful if a program does not run as expected and two trains are about to collide, I just push the emergency stop button and all power to the track and outputs is cut. The only part that may not follow the standard is the NC contact of the PNOZ relay is tied to the first input of the PLC. It goes high when the safety circuit is not clear. It should probably be high when the safety is clear, but I didn't have a third NO contact on the PNOZ to use. I only use it so the PLC would know that the emergency stop circuit is not clear by seeing a high input. The parts I used to construct this came from machines in a prior job that were being scrapped and I was allowed to take parts off them as I wanted. So the design of this control basically followed what parts I have on hand.

Mike

 

Share this post


Link to post
Share on other sites

Hi Mike.  I got tied up on a rush job and honestly I haven't had a chance to look at it.

Share this post


Link to post
Share on other sites

The latest program I wrote which runs endless. This will be one of the main routines the PLC will do. This is an early version with plans to expand on it.

Video also explains about how the trains act as far as forward & reverse and even some improvements I made to the HMI display.

https://youtu.be/PCPA4QjvoE0

main and side interchange simple.RSS

Share this post


Link to post
Share on other sites

Experimenting with finding ways to eliminate or compensate for the chatter on the inputs observed with the programs I wrote so far.

 

 

 

Share this post


Link to post
Share on other sites

I saved these to Dropbox so I can look at them when I get back to the hotel. Who doesn't like a model train? :o) 

I'll be interested to see what you've come up with. 

Share this post


Link to post
Share on other sites

I am hoping someone would look over the code I have written to see if I am doing it right. I use a lot of step sequence to write the program routines and I am not sure if this is the best way to go about this. Example program attached. Using a Binary data byte, as each sequence is completed, I set the next bit in the data byte so only a certain section of the program's rungs become true. Since I am writing these for a model railroad layout as a teaching tool, this may be the best way to go about it. When planning a program, I write down on paper all the steps needed to do an operation.

Some parts of the program are subroutines. One is to throw the switches, the other I call  "forward - reverse" as I explained in my videos, these trains can run forward or reverse, so I pass data to it to tell it as example, train on the side track, run forward. The video of the main and side interchange shows this well. The train on the throughway track will maintain its forward - reverse sequence no matter how long track power is off (like an older Lionel train) where the one on the side track will revert to forward as its next move if track power is off for more then 10 seconds. I accomplish this by repeatedly jumping to the subroutine until it is finished with its operation (subroutine sets a flag when it completes its program) then I set the next sequence flag and the program moves on.

 

On a different note, my work might be paying off now as I was recently handed a project to do at work to help prevent a problem on the production line and the best way to do this is with a small PLC and program. My original plan was to use an Allen-Bradley Micro810 PLC, but I had problems installing the connected components workbench software package. Not sure how long this will take to resolve, I changed plans and decided to use a Koyo Click PLC. The software installed with no issues, but it does not allow simulation. So I wrote the program using the Rslogix Micro starter that I have been using, simulated it to make sure all my conditions are working properly, then wrote the logic using the Click software. I have to wait for the parts to arrive at the plant then I can hook up the Click unit and actually test it. In RSlogix, I created a pulse input by use of a timer and condition to simulate an encoder wheel. The project does not care about measuring speed from the encoder, it is only to detect if the product flow stops.

STEP TEST.pdf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now