Automated Grocery Shopping in 2050 - PLC Program

skateman

Member
Join Date
Apr 2020
Location
TX
Posts
4
Hi all,

I'm fairly new to the PLC world and am currently working on designing a portion of a ladder logic diagram for a group project. I was hoping someone here could help me find some footing and gain some direction on the project?

Here are further details:

There are 3 sections in “Texas Automated Grocery” store namely Fresh produce section, Meat section and Frozen/ready to go section. A customer entering the store goes to Fresh produce section first and is given 30 minutes to choose a selection and put in their assigned grocery carton. After the 8 minutes at the Fresh produce section they are moved to the Meat section. They can spend 8 minutes in the Meat section and choose whatever they want to be put in their grocery carton. After 8 minutes in Meat section they move to the Frozen/ ready-to-go section. Like the previous time limit, customers can spend 8 minutes here and choose whatever they want. If at any time the grocery carton is loaded with more than 30 items, customers are instructed to choose another grocery carton. The assigned time in each section is limited to 8 minutes to avoid traffic. The store still uses the RSLogics 5000 software for the controlling PLC.

Note: Time in each section is reduced to 2 min and total items in bag to 20 for implementing the scenario.

Steps to do:

1> Entering the grocery store is indicated by IN_1 which starts the 2 min timer, T1. IN_2 is used to count the total number of items being put in the grocery carton from fresh produce section.

2> After the 2 min timer T1 ends another timer T2 starts which runs for a total of 2min. During this time period grocery items added to the carton are incremented using IN_2. Fresh produce section Meat Section Frozen/ Ready to go section Carton Carrier ESET400 Lab Project Assignment Spring 2020 2

3> After the 2 min timer T2 ends another timer T3 starts which runs for a total of 2min. During this time period grocery items added to the carton are incremented using IN_2 for Produce, IN_3 for Meat, and IN_4 for Frozen food.

4> Anytime during the process if the total number of items in the grocery carton becomes more than 20, an indicator LED indicating overload and requests one additional carton to be added to the carrier.

5> Consider a math function to be used to determine the total items that are loaded in the carton and provide OUT_1 to indicate a full carton and request the additional carton. Consider using intermediate outputs A, B, C, D to facilitate a move command from one station to the next and to initiate the addition of the extra carton. (Output A) provides a move command to move the cart from the produce section to the meat section. Output B provides a move command to move the cart from the meat section. Output C provides a move command to move the cart from the meat section to the frozen food section. Finally, Output D provides a command that the carton is full and another carton must be provided to the cart.)

6> OUT_3 turns on the loading robot which has a cycle time of 30-seconds (T4). Once the robot cycle time is completed OUT_4 provides a light to signal the car to leave the store.

7> At the end of the cycle all the timers and counters should be reset indicating the end of process. (Do not use another input to reset the timers and counters)

Thanks in advance to anyone who is able to help me out! If there's anything I can clarify, please let me know.
 
Haha indeed I am. If this isn't appropriate please let me know and I'll take it down or find osmeone to take it down for me. I really lag in the PLC department and could use some help from some of the experts here. :)
 
Any problem or part of a problem that can be laid out in a sequence like that is a good candidate for states. Have they taught you about states and state machines yet? The first steps are to identify and separate the states. What needs to happen in each area? What moves your person from one area to the next? What variables exist in each of those areas for the people in them?


Also, what PLC and software have they got you using?




For the record, I don't like this grocery store of the future. I prefer to enter a store, procure the 4 items I need in a seemingly random manner, and then spend the next 5 minutes checking out the talent while pretending to look for other items. Your store fills me with sadness.
 
Last edited:
For the record, I don't like this grocery store of the future. I prefer to enter a store, procure the 4 items I need in a seemingly random manner, and then spend the next 5 minutes checking out the talent while pretending to look for other items. Your store fills me with sadness.

But in the current world pandemic, this sounds pretty good right now.
 
@Steve thank you for the swift reply,
nCkBPV9r

Here is where I'm at on the problem. I have a basic understanding of the first 4 deliverables for the problem however to get the 4th deliverable I know i need to understand deliverable 5 and how to use some arithmetic and that's where things really get shaky for me.

@Jeev As far as states go we haven't gotten there yet. I'm really an Industrial Engineering major and have a lot of background in statistics and quality and this is a beginner ESET class that I'm struggling to grasp... We were using a Rockwell PLC along with RSLogix5000 which is why all of my presets are in milliseconds. However, the coronavirus has sort of screwed things for our lab and we're no longer physically using the PLC or software.

Thanks in advance for the help, I need it.
 
This is where you need to pause for a moment, go back to the problem and start thinking about all the ins, outs and what the variables mean. What are A,B,C and D doing? What do they mean as per the description given to you and how that relates to what the system is doing?

Your math function can be something simple. Something like addition or a comparison (ADD, EQU, GRT, GEQ, LES, LEQ).

Don't forget to comment your code. If you can't use tags or aliases, at very least use rung comments.
 
I like your last full rung:


Code:
  T3.EN     IN3
---] [------] [-----[CTU.C2; pre=20]
That says to me that


IF
- T3 is enabled (meaning you are in Meat section)
AND
- IN3 has a rising edge (you add a meat item)
THEN
- CTU.C2 will increment by 1

Try to convert the desired behavior into statements like that (I think this is similar to what Jeev is saying).



Logical ANDs are easy to program: you have one already.


What do logical ORs look like?


See here: http://www.contactandcoil.com/patterns-of-ladder-logic-programming/





Also, once that T3 timer is done (hits its preset), T3 may still be enabled, which means another IN3 rising edge will add another item to CTU.C2, even though the shopper has moved on to Frozen. How can that rung be changed to prevent that from happening?




I am a little confused by why you have CTU.C1 (produce counter?) being driven only off a rising edge of IN2 (add produce item): what happens if your shopper is in the Meat or Frozen time and they press IN2?


Also, wouldn't it be possible, given your current scheme and even if the shopper only adds an item using the current correct input, to have 19 produce items in CTU.C1 and 19 Meat items in CTU.C2, so 38 items total in the carton, and yet neither has hit the preset of 20 and your logic did not triggered the "go get another carton" signal eighteen items ago when the shopper cruised by 20 items. So do those presets do you any good? do you even need (or want) separate CTUs for each section? (actually you do want them, or something equivalent, because the problem statement wants you to "Consider a math function to ... determine the total items in the cart" - but you can do it both ways).





Also, if you cannot get to the lab, try a simulator/emulator, online.


Or get the RSEmulate500, RSLinx Classic and RSLogix Micro Starter Light freebies. They are not RSL5000 but you cannot write that program in RSL5000 until you get back into the lab anyway, and it will go quicker if you have your logic sussed out before you get there.


In RSLogix, the [Instruction Help] button under the [Help] menu is really useful.
 
Separation of concerns

(wow this is fun)


Another higher level issue is "separation of concerns" (see the wiki for that).


That term may not strictly apply to a single ladder program, but what I am getting at here with it, is that I look at your preliminary rungs, and I see

  • enter store and run produce timer
  • handle adding produce item into carton
  • run meat timer
  • run frozen time
  • handle adding meat item into carton
Why is the produce item handler mixed in with the timers? I am not saying it won't work that way, but the bigger point is that, looking at the problem description, the timers run independently of item-into-carton handling.


In other words, although item selection may be affected by which section of the store the shopper is in, the timers inexorably cascade through their sequence no matter what is done with the items and the cartons. This is another part of what Jeev may have been suggesting: the problem statement jumbles all the pieces together, but on analyzing the entire process described, it can be seen that the timing pieces comprise an independent whole.



That being the case, it makes sense, at least aesthetically, to group the timers together. At a minimum it is then easier to understand when reading; I am fairly certain it will also make it easier for you to make further insights into your process, but let's leave that to discovery.



Another advantage to looking at it this way is that once you know that the timing logic can be separate, you can program - and test on an emulator/simulator - the entire timing part of the process before you even look at the item-into-carton inputs. So you have less to think about while you are programming the timers - "fewer moving parts," so to speak - which means it is easier to visualize because there are fewer possible interactions, and the result will be that it is easier to program correctly.


I hope I did not overstep the line in providing that insight, but there are several other places it can be applied here. With all programming, not just PLCs, "separating the concerns" of a process usually results in cleaner, easier to understand, and more robust code. In ladder it may be separating the different sections within one ladder, or even into multiple ladder files; in procedural languages it is done with methods/subroutines/functions and classes.
 
Last edited:
Another thing: you have to get stupid, because the PLC is stupid (or maybe simple is a less distressing word).



Specifically, the PLC knows nothing of shoppers or cartons or produce or meat:


  • it ONLY KNOWS the state of its bits;
  • it WILL act on and with those bits EXACTLY how you TELL it to act in the ladder program;
  • (and the big finish is ...)
  • it does NOT matter a fig how you WANT it to act.
And the final bit is that being smart may help you program, but far more important is to be persistent. I doubt there are many experienced persons, myself included, on this list who have not in the past year (maybe month), spent a ridiculous amount of time on something very basic that they simply did not see until that moment of dawning comprehension.
 
Those who have experienced my contributions before knew my OCD could not resist this one.



I tried to hide all the code so it should unfairly help the OP. It took me the better part of a day; I imagine most of the serious players here could do it in a fraction of that, and a few already have a program that does 80-90% of this.


https://youtu.be/juQKetWklrg


I did this with no PLC and instead used the free and freely downloadable A-B software: RSLogix Micro Starter Lite; RSLinx Classic; RSLogix Emulate500.


The original description seemed a little muddled and/or incomplete, with things like intermediate Outputs B and C both moving the cart from the meat section, and descriptions for OUT_1 and OUT_3 but none for OUT_2.


I implemented a generic "move carrier to next section" action using a single output, e.g. that discrete output might turn on the motor for a few seconds to get it away from the "stop here" sensor in the current section, and then the motor stays on until it hits the "stop here" sensor at the next section. Obviously that part would be a lot more complex IRL, with safety concerns and such.



I also implemented the "replace full carton with an empty carton" action as an automated task, represented in the program by a timer that is done in a couple of seconds after the current carton becomes full; the alternative would be another output and a clumsy interface to indicate a manual replacement was complete, all while the time remaining in the current section was running out.


To reiterate the separation-of-concerns concept, here is the TOC from the comments.


========================================================================
Table of contents
========================================================================
Rungs 0000-0000 Initialization
Rungs 0001-0005 Section timers
Rungs 0006-0009 Add items to carton
Rungs 0010-0012 Full carton handling; add new carton
Rungs 0013-0018 Discrete output handling
 
Sincere apologies for O.T...

Timbert said:
But in the current world pandemic, this sounds pretty good right now.

Saw this earlier in the week...

grocer-using-delivery-robots-during-coronavirus-pandemic

These concepts, like the link and this thread, always remind me of an idea I'd had since about 5 years ago or so. I always thought it a "great" concept to try automate shopping carts (trolleys). A cart with a screen, barcode scanner, weigher and pay terminal. Scanner auto tots up items as you pass them into the cart. Weigher would both detect weight added that had not been scanned and prompt you to "pass" the item again, or you would select say "Apples" on the screen and then add loose bag of item to be weighed.

Each time I was at my local store, I'd keep thinking about it and how I could better it. Like adding advertisement space on the screen, recipe information and suggestions, special offers. When done, you pay via the card terminal, no checkout. Bag up items or walk cart out.

I have also thought about an automated cart system in the carpark where you enter your parking spot reference number on the screen when in the store and once you've paid it automatically drives itself out to your vehicle location. Once unloaded you tell it you're finished (or auto when weigher at zero), few warning beeps and then drives itself back to the pickup point. This concept is borne out of my hatred for the 4-wheel drive trolleys where I'm trying to walk as cool as I can (while food shopping) back to my car or van and the damn thing has a mind of it's own.

But last year I had mixed emotions when I read the following article on a company which had virtually read my mind...

This smart shopping cart is a self-service checkout on wheels

...the swines! Mixed emotions because on the one hand I was dissapointed that someone else had stolen "my" idea, but on the other hand validated as the concept had such potential.

Thinking of the current "situation", I was recently thinking how "my" idea could be further adapted as store home delivery services are crazy at the moment. We could pull up, connect to store remotely and fill out order or preorder from home before you leave. An automated in-store cart would travel around (or staff) and fill your cart. It then drives out to your parking spot and back after, reducing social persistence.

How could I keep at any vast distance?
And so, as I say, on the lady's persistence.


Again, apologies for the thread distraction and please, as you were. I am reading it with great interest.

Regards,
George
 
Saw this earlier in the week...


My brother read an article in Time magazine a while back about the robots taking over; I still have the magazine but did not read it yet.



One thing he mentioned, from the article I think: has anyone else noticed that newer shopping carts often have plastic bodies? I think that is retailers thinking ahead, so future RFID readers don't have a Faraday cage blocking them


Roll materials companies that make sticky paper are already putting RFID tags in adhesive tags.


Put those two technologies together and you put the items in the cart, walk the cart past an RFID reader, it adds everything up and then takes your payment. The loss of any errors is more than made up by employing far fewer cashiers and having 100% of your checkout lines open 100% of the time*.


Or maybe there is a reader in every cart that scans each RFID tag coming in, and it communicates the payload total at checkout. I would think having fewer RFID readers at checkout would be more efficient, but who knows?


* Yes I know I am overstating the case.
 
Last edited:

Similar Topics

Hello, I wanted to know if there is software that performs automatic backups and version checking. Additionally, it should support multiple...
Replies
1
Views
483
I have been tasked with building an inventory of all of our automation devices across multiple large sites. Most of our hardware is Rockwell and...
Replies
17
Views
2,399
Hi All. I Used this Post as a Starting Point to get the Files: http://www.plctalk.net/qanda/showthread.php?t=80472 I Then used FTP To grab...
Replies
0
Views
876
Good Evening , Looking to upgrade and automate our motor rewind shop . I was on YouTube looking at some automated coil winders .Who are the...
Replies
0
Views
1,190
New management team at my company is making a big push for automated reporting and OEE. They are also don't want to make any major capital...
Replies
5
Views
2,099
Back
Top Bottom