Programming a Concrete Mixer

domster2003

Member
Join Date
Mar 2022
Location
Louisiana
Posts
3
Hello all,

I am working on a batch computer for a concrete mixer, and the computer that was running the plant before has stopped functioning. It was an old PC running MS DOS. The code is encrypted and replacing it is not a cost effective option.

I therefore am looking into using a PLC to control this batch plant. I have a setup that was in progress by another employee who no longer works for us, it is a CLICK PLC from Automation Direct, and it is supposed to be paired with a EA9 T8CL touch screen HMI from the same company. I would like some advice on just some basics, I would greatly appreciate some input.

I essentially only have one input, and that is an analog scale, 0-20mA input. I have digital outputs for sand, gravel, cement powder, and a water meter for adding water to the mixture. I have one final output, an additive for reducing the required water in the concrete.

What I would like to create is a program that when it is told to start, looks at the scale, and if the scale is less than say 100 pounds, opens sand until it hits 1700 pounds (as an example), then turns it off. Then it turns on the gravel and adds that for another 1700 (again for example, all these are variable), turning the gravel off after. Next the cement, and so on. I don’t need someone to write the program for me, but can someone point me in the right direction on using an analog input to turn digital outputs on and off? Again, your help would be greatly appreciated.

Thanks for taking the time to read this long post.
 
Assuming a zero mA signal represents zero pounds, you need to know the weight represented by a 20 mA signal and then scale the analog raw data accordingly. After you've done that, it's a simple matter of using comparison instructions ( >= for example) to make things happen at the appropriate weights.
 
Look at comparison instructions: greater than, less than, greater than or equal to, LIMit (greater than or equal to a low limit AND less than or equal to a high limit).

Two test instructions in series composes a boolean AND between their results and with the rung state feeding the first e.g.
running_a_batch AND (scale_weight is between 1700 and 3400) => open_gravel
You cannot do better than watching this series and committing these patterns to memory.
 
So, I know the part about scaling the analog signal, and I have done so, it is a 10,000 lb scale and is reading correctly. I was mostly curious about the ability to use the values it spits out to control the PLC. The part about seeing that it is in between two values is definitely what I am looking to do, does it basically just turn off the output once it is out of range?

Another question I had is how to structure these logical statements. The software I am using is pretty simple, its just basically asking me to fill out ladder logic, but I want to make sure that I am filling it out the way that it needs to be filled out. Does each output get a line of its own?

For example, say the scale reads under 100, sand=open between 100 and 1700. That is the output, sand. But if I wanted to move onto the next part, which is that it now has to look at the scale and add gravel, is that a separate rung? Im super new to this type of programming so I figured I should ask people who know more than me.
 
Does each output get a line of its own?
Yes
But if I wanted to move onto the next part, which is that it now has to look at the scale and add gravel, is that a separate rung?
Yes
Do you have the programming software for the Click? If not, it is a free download from Automation Direct.

The Click follows classic PLC architecture. It reads all of the inputs (those are the sensors that tell it what is happening. The analog input is one of these). Then it evaluates each rung of the ladder logic program in sequential order, keeping track of of the results of each rung. Then it sends the results of the program execution to the outputs (those are the things that make something happen on the machine). Then, after a bit of housekeeping, it repeats the sequence until something tells it to stop.

If a rung says to turn on an output when the analog input value is >= to some setpoint then the output will be on when those conditions are true as long as the PLC is running its program.

If you want, post a printout of the work in progress. We'll comment on what's already been done and offer suggestions on how best to complete it.
 
If I get what you are trying to say assuming the mix silo (the one that receives the batch components i.e. sand, cement etc) is the only one with load cells then first of all you need to ensure they are calibrated, the 4-20ma signal from the load cell controller will be say for example 0-20,000 pounds.
The PLC analogue card will see this a a value perhaps 4-20 equates to 0-32000 as a raw value (some PLC analog cards can be set to scale the raw value to what ever you want), however, assume you have the scaled value in pounds then first stage is to check the empty weight of the vessel, if within limits say +-100 lb then you need to tare to 0, the best way if you cannot control the weigh controller is to store that offset into a register, & then use a second register to record the added weight so for example
Before adding the first product check the max/min weight of the vessel is within your tollerances i.e. > -100 < +100
Step 1: copy the current weight to a register we would call this perhaps previous weight.
move zero into another register called Current Added weight
Then while adding the product sub the previous weight from the actual & store it into the Current added weight, this gives you the weight of the product minus the start offset.
Compare this with the required weight, when equal or above then stop the feed, do the same for all the ingredients.
So
Step 1 initial check before adding ingredients i.e. is the vessel empty
Step 2 assume ok store current weight get current ingredient i.e. recipe first addition Zero Current addition variable
Step 3 Add ingredient, sub stored current weight with vessel weight & poke into current stage added weight. When it is equal or greater then stop feed,
Get next ingredient weight & go back to step 1.
pic shows typical batching system of a vessel on load cells.

Vessel Weight.png
 
Another question I had is how to structure these logical statements. ...


There are many tutorials for teaching and ladder logic available on the web, including YouTube. At the top of this page you will find a link to [LEARN PLCS]. I provided a couple of links.

As much as I am tempted, explaining PLC programming in this single thread is a sub-optimal use of this forum. Please pursue those options and then come back here with any questions. This is how it's done; cf. this link.

One thing I will say is that you need to understand the scan cycle, which defines

  • when the inputs are read into memory bit boxes
  • when the outputs are written from memory bit boxes
  • when the PLC executes its housekeeping,
    • which will read and/or affect memory bit boxes
  • when the programmed instructions are executed to read and/or write memory bit boxes,
    • the time (when) order of which executions determines the logic implemented by the arrangement of the instructions,
      • which arrangement of instructions, i.e. the "rails" and "rungs" of the "ladder" logic, determines when (i.e. the order in which) each instruction is executed.
That summary, though vastly oversimplified and I am sure there are exceptions, is a list of pretty much all the things that a PLC does.

It's about time (it's about space, about two men in the strangest place ... ;)).

You will find tutorials that make analogies between digital ladder logic and analog (i.e. physical electrical) relay logic, where power or current "flows" or does not "flow," and that has some utility, but that approach is flawed. What is actually happening in a PLC, and knowing how to get a PLC to do what you want, means you have to first understand when a PLC is going to do something.

A final piece of advice, from decades of programming experience, for when you are scratching your head diagnosing some unexpected behavior: the PLC cares not a whit what you wanted it to do, but it will always* be doing exactly what you told it to do.

* when functioning properly
 
I'd rather not be embarrassed :whistle:


Being embarrassed is the least painful way to learn.

If you want to be less embarrassed, make sure each rung of your code has comments. And not the "when discrete input bit box X is 0 or internal memory bit box Y is 1, make discrete output bit box Z to be 1" kind of comments. Make the comments about the process e.g. "when [the mixer program] is told to start, have it look at the scale, and if the scale is less than say 100 pounds, [then open] the sand [gate to the scale]."

If you do that, what will happen is that you will be forced to look at your code as a model of your process, you will find bugs and better ways to implement the process logic before you post the code here, and you will learn faster; cf. this link.
 
Last edited:
A few thing for you to think about with any weighting system
First never use a 0 – 20 ma scale output on any weighting system it will generate all kinds of errors that you will not even be aware of but the will affect the final product

The way to set you your scale is first choice would be digital (Ethernet connection preferred)
If you use analog then 4 – 20 ma output from the scales amplifier. Set up the plc input for 0 – 20 ma
The scaling for 0 would be – 25% of full scale and full scale (20 ma) of course would be 100%
this way when the scale weight drops a little below 0 (and it will) you will still read it actuarially.
Then you have to consider the ingredient feed control for each. Including any liquids
The free fall for each ingredient and don’t forget your mixing time there may be other things you must take into consideration as well.
I would chose at a minimum a compact Logix processor this no time to cut corn
 
I don't know how many ingredients you need to add but I assume at the very least sand, cement & water, also does the mix vary depending on the type of concrete being produced, are the ingredients always added in the same sequence i.e. sand, cement then water ?.
Things to think about.
Do you need some sort of recipe of more than one type ?
Are their some mixes that may require extra ingredients.
How flexible does it have to be ?.
I suggest you use a sequence based on an integer & compares for example:
0 = idle
10-99 perhaps start up checks i.e. is the weight of the vessel within limits to allow a batch to be produced (I believe you stated +- 100lb.

100 - 199 ingredient A addition
200 - 299 ingredient B addition
300 - 399 ingredient C addition
400 - 499 mix sequence
500 - 599 Discharge sequence.
Reasons for using a sequence based on an integer & possibly steps of 10 i.e. 100 > Store current weight 110 Step on to open supply etc.
is that if you suddenly need to add another step for something you missed you do not have to move the steps as there are enough between each 10 steps i.e. if originally step 100 is completed then would step on to 110 but for some reason the customer suddenly introduces some other check then it can be quickly added i.e. instead of 100, then jump to 110, it jumps to 105 before the 110 step.
Also think about some sort of recipe handling.
If it is possible that the ingredients at some point will be different or in a different order then perhaps a recipe structure like this.

Each stage for example has the following:
Ingredient type : integer (for example 0 = no addition, 1 = sand 2 = cement 3 = water & so on.
Weight: this could be either an integer (perhaps a float is not required as cement etc. would be in lbs so no decimal places required) Note: this is the weight required for that ingredient for a batch.
Weight Limits : a figure lets' say +- 100lb so if for some reason the addition was out of tolerance by more than that it went into alarm.
A in-flight value so if the product is dropped or blown in you may need to stop the feed a few lbs before the actual weight is reached to allow time for the load cells to react i.e. give a stable reading. so for example if you wait until the actual weight is reached then it may continue to feed i.e. motor slow to stop or the amount of product still in transit & load cell reaction time.
A mix time to blend the mix before adding the next ingredient perhaps these fields would have two values i.e. mix required & a time.
And so on maybe you need a mix before adding the next ingredient etc.

So for example if your recipe had a max number of ingredients of 4 then each recipe would have 6 stages:
These being:
1 add ingredient 1 the fields would be type of ingredient (0-3 integer) weight (0-1500), limits (0-100)& mix required (0-1) Mix time (0-x mins)
2. Add ingredient 2 as above
3. mix so all the fields are 0 apart from mix required & the time.
4 Add ingredient 3
5. Mix for time
6 Spare just in case.
This makes it flexible so any ingredient can be added in any order.
to make this work you then load the recipe (perhaps these recipes are either stored on the HMI (if it has recipe capabilities) or in retentive memory in the PLC.
Perhaps your process will be a lot simpler & no flexible recipe structure is required
Attached, is part of a complex batching system but only 3 types of ingredients are shown for simplicity, note this was written using FBD type programming & the use of function blocks perhaps a little harder for a learner but may give you some ideas.
This uses indirect addressing to loop through the recipe stages for example if the recipe contained 500 registers but each stage only uses 30 then at start up it moves the first 30 registers to some working recipes (current stage, the logic checks the type of addition or operation then sets the sequence word to the start value of that addition, this then processes the addition FB that is associated with that sequence step number, when complete it steps to another number i.e. perhaps 2000 this loads the next stage registers into the current stage & sets the sequence number back to the start (well not the idle state but where the process will snapshot the current weight & where it deterimines the type of ingredients.
 

Similar Topics

Hi, I am trying to set up a plc. I've never done any programming with ladder logic previously. I'm trying to set up a a program to turn a device...
Replies
7
Views
201
Dear all, I have fx2n plc on my hand but I don't have the programming cable sc-09 and it would not be easy for me to get one. I need the cable...
Replies
3
Views
133
Hi all, i am the new controls guy at the plant and i have inherited a pc from the previous controls guy with Siemens tia portal version 16 and 17...
Replies
20
Views
935
I need to pull the program off of an old 90-30 so I can convert it to Allen Bradley. This is my first time messing with GE and I don't have the...
Replies
2
Views
92
New to vfds. I put in parameters. IP, but I get ethernet flashing and link solid. What did I do wrong?
Replies
9
Views
490
Back
Top Bottom