To Transfer Finished Products from Machines to Warehouse
Idealogy
It will be a Line Follower robot which will transport Products from machines to warehouse.
There will be 20 machines and hence 20 Stops and 1 Start point.
To make Stop Points unique, I've decided to use RFID tags to be placed at the stop point.
Mode of Control will be Radio Frequency ( Please suggest if i could use better things) as it won't be feasible to have 20 Controllers in the same frequency range.
The Controllers will be operated by Human Personnel at the machines. So they can Press a button and a Request to the Cart will be sent and it should traverse the shortest Path to the station.
Problems Faced:
How to implement so that it traverses the shortest Path.
Better way of communication. So that requests from various Personnels don't clash.
How to implement a Queue system?
Cart is currently working with Machine 2 and a request has been lodged. It must complete the job of Machine 2 and then proceed to Next Request from another machine.
Frequency:
imho You should make the robot the master, it checks every (human) slave if it has a request. That should solve the # frequencies needed as the robot just sends the { ID } of the slave and that slave responses { ID, YES } or {ID, NO }. If a slave does not respond, it is skipped after e.g. 20 millisec timeout.. Checking 20 stations (@4800 baud) should take max 400 millis when all timeout. A normal check could take ~10 millis so all stations checked takes ~200 millis.
Note that gathering this information can be done while delivering last packet.
Instead of {ID, YES } the slave could answer { ID, to_ID } so the robot knows where it has to go. THis makes more advanced scheduling possible.
distance math:
If the robot is on a position X it can go CW or CCW. suppose someone at pos Y presses the button. IN code you get something like this math:
if (X > Y)
{
distanceCCW = X - Y;
distanceCW = 20 - distanceCCW;
}
else
{
distanceCW = Y - X;
distanceCCW = 20 - distanceCW;
}
if (distanceCW < distanceCCW) goCW(X, Y)
else goCCW(X, Y);
Schedule per request:
The robot loops through all slaves. If one has a request (e.g. station 9) it is going to serve it. When done it continues to loop through the slaves so it continues with 10-> 20-> 1-> ... This is very easy to implement.
loop()
{
if (check(currentNode))
{
serveNode(currentNode);
}
currentNode++;
if (currentNode >MAXNODE) currentNode = 0; // reset
}
Schedule in batches.
The robot can then build up a queue of the pending requests (with time stamp) and process these. If the list of pending request is done, it polls the slaves again and builds up a new list. This way is not the optimal scheduling, but quite robust as you will not get starvation (thus all requests will be served). Furthermore it is relative easy to implement.
You should define your requirements more explicit. E.g. define what kind of priority you want to have. Do you want a first come first serve, or nearest request first etc.
You will need to be able to tell the cart when a particular machine has finished loading it, otherwise it may disappear before it's fully loaded. As well as a call button, you'll need a 'release' button on the cart. Either that, or a timed stop, which could slow the process down.
Also, you will need some way of knowing when the cart is full, so that it can trundle off to the warehouse to be unloaded.
At the warehouse, will it be unloaded in one place or go to the appropriate storage bays to be partially unloaded in each of them? In that case, it will have to know what products are on board and where they are to be stored. Again, a release button will be needed to tell the cart to move to the next storage bay or when empty, to return to the production line.
Whilst it's moving around the warehouse or travelling between the warehouse and the production line, will you need another cart to be collecting products from the machines, so that there's not a long delay?
Whose job is it to carefully place it back onto the line when it's knocked off accidentally? What if the floor isn't clean enough to distinguish the line from the dirt smudges?
These kinds of things in real factories tend to use buried wire loops as they are more difficult to disrupt by poor cleaning or other traffic.