The Mystery of the Batch Simulator

Educ8me

Member
Join Date
Jul 2017
Location
WV
Posts
10
Good Morning Programmers,

I have been working on self-training using LogixPro, and I have written a program for a Batch Simulator. Its not perfect, but it works....mostly.

It seemed to be working fine at first. I was called away from my desk and left the simulation running. Something went wrong while i was gone and I can't figure out what it was.

What I am attempting to do is allow pumps 1 & 2 to fill the tank. Mix and for a selected amount of time while maintaining a constant temp. Then energize pump 3 to empty the tank, and have the process start all over again.

The issues noticed:

- The Mixer and Pump 3 ran continuously.
- Pumps 1 & 2 were being controlled by the high level sensor, but once it changed states, the pumps would run again instantly filling the tank back up.

The only thing that seemed to be working as intended was the burner and thermostat. Anyways, that's the gist of what I am dealing with. Hopefully this description makes sense.

Attached is my program and a pic of the simulation I am trying to operate. I am asking for someone to look at my program to help me figure out what went wrong, and to help me understand my mistake. Any feedback you can provide would be greatly appreciated. Thanks in advance. :geek:

Batch_Sim.jpg Batch_Sim_ProgJPG.jpg
 
This should do what you're looking for (didn't test it though). Let me know if you have any questions, I added a bit of simulation logic into yours.

1.jpg 2.jpg 3.jpg
 
Last edited:
I didn't put any simulator for the TEMP_OK bit, so you would have to toggle that one manually to simulate the temperature sensor reading a good temp before your mixing process will start.
 
Appreciate the input. However, I was hoping for a bit more feedback regarding my code. Don't mean to come off as ungrateful. I want to understand my mistake.
 
Not at all! I figured you could extrapolate some of your problems by comparing your code to my code but I would be happy to point some stuff out.

First off, just for the sake of clarity reading your code, I wouldn't use outputs for multiple purposes unless it makes sense. Your output engaging your RUN_LIGHT shouldn't really be used to enable your pumps. In my code, you'll notice I used a software bit to do so in parallel to the light. On a smaller program like this, it might not seem like such a big deal, but it's always better to practice for how you will program with more complicated tasks down the road.

As far as your filling pumps, you want to ENGAGE them when your LOW level sensor is uncovered (using an XIO), as that is what signals to your PLC that the tank is empty. Currently, you are examining whether or not the tank is FULL to engage them. This means as soon as the tank drops below completely full, your fill pumps will engage. You want to use the HIGH_LVL_SENSOR to STOP your fill pumps (break the seal), not start them.

To answer why your pump 3 and mixer are running continuously, I would need to know how you are controlling your high and low sensors, because I don't see any OTEs engaging or disengaging them. Is there more logic further down? Or are you toggling them manually?
 
Using software bits makes a lot of sense.

I am using the low level sensor to shut off Pump 3 and i am using a Timer to re-engage pumps 1 & 2 to fill the tank once the tank is empty. The High level sensor is being used to shut off the Fill Pumps. Not when the tank is full.

Hopefully you can view this video without troubles to see my code in action. You will notice it works. I just can't explain why it went haywire on me.
 
I see the high level sensor will stop the fill pumps as soon as it's covered, but the problem is they will also START again as soon as it is uncovered. Your permissives to start the fill pumps are that your system is engaged (piggy backed on the run light) and that the HIGH_LEVEL_SENSOR is not made. Because of that, the pumps will STOP as soon as you reach HIGH level and then immediately start again as soon as HIGH level is lost (right as it starts emptying). You want to delay the fill pumps from starting again until the tank is completely empty, which means you need to use the LOW level sensor as a permissive for them to start.

I don't see a video link in your post...
 
Last edited:
It may be too large of a video file, I'm not really sure if videos are allowed. I thought they were but I never tried to post one before becoming a supporting member...
 
Looking at the attachment list, it doesn't look like they are allowed. If you can host it on youtube or something like that, you can share the link here.
 
Just glancing at the code and watching that video of it freaking out:

It's trying to run all the pumps all conditions go everything on go go go.

Think about adding a timer reset next to your run light on the first rung.
When T4:1 is DN, start the new batch, but once the new batch is started (I believe when you output to RUN_LIGHT), you need to remove the BEGIN_BATCH.

I hope that made enough sense.

EDIT:
Or maybe just one shot the Begin_Batch on the last rung.
 
Last edited:
The upload resolution is only at 240p so it's very difficult to see what each instruction is, and it's also looping extremely fast. If you could upload a higher resolution I might be able to offer some help, or if you could export the project itself and zip it and upload it to the forum so I could look at it that way.
 
You could also use a step index with timers for each step to slow the process down. That helps troubleshoot problems like this immensely. Are you familiar with step logic using an indexer?
 

Similar Topics

Hi all, Working on a system with a CompactLogix 43 processor, Kinetix 6000 servo drives, and a sercos interface between them. The 6000 is using...
Replies
1
Views
1,016
I recently installed 4 PoE security cameras at my church. Since part of the cable run was outdoors, I searched for outdoor cat5e cable. I found...
Replies
5
Views
2,438
Factory Talk ME station V10.01 Studio is v32 Below is a pallet with password visibility. I have rendered this before in other applications but it...
Replies
3
Views
2,074
I get pack of these in every Micro expansion module... I still haven't found a use for them..?
Replies
9
Views
1,929
Hello, I've taken on yet another basket case old machine running an 7 slot SLC 5/03 PLC.... I have run into a situation where I see the same 4...
Replies
3
Views
5,622
Back
Top Bottom