10-30-2008 02:50 AM
Hi.
I am presently working on this project - anti-collision system for tower cranes. There will be 2 or more cranes operating in one construction area and must prevent them from crashing to each other. Each crane will have set of sensors, controller, monitor and wireless receiver. The result of the sensors are coordinate values which i want to pass to other crane and at the same time receive theirs too. The Wireless Receiver that I am planning to use is 1-Master with Multiple Slaves. It will be connected to the PC controller using LAN port (TCP). The reason for passing the coordinate data is for each crane to know each others positions. Knowing each others position the crane can stop anytime if it sense the other crane is getting near. I have already a basic idea for the control algorithm. But for the TCP algorithm i am still looking for it.
Kindly see the attached. This is only an example for Three Towers.
I am seeking the forums assistance if anyone have similar application (not specifically tower cranes) on passing data using wireless communication with one master and multiple slaves. I still cant comprehend how can I Receive and Send specific coordinate data to/from a specific crane.
Any advise, any idea i would greatly appreciate.
Thanks.
10-30-2008 03:31 AM - edited 10-30-2008 03:33 AM
Hi jtc,
it sounds very interesting. Your Master can create a TCP Listener and wait for connections. I think a good idea is, to first check if already a master exists and if not this one becomes a master and creates the TCP Listener. So each crane should first check if already a master exists. If you have your connection you can send the messages you need with TCP Send. See therefore the shipped examples from the example finder. You should also insert a check routine, to react on the masters shutdown.
Mike
10-30-2008 06:02 AM
There is only a small set of TCP functions which is covered in the examples. So not to much work on that side.
The main issue will be the software architecture, where I strongly recommend you to use a state machine. At first you should model your states before coding and document these. Especially you will need handling of different possibilities of lost communication (like shutdown, broken LAN cables, ... so modle and document these use cases as well). You will need to have a kind of heartbeat (that could be the transmission of the coordinates) to monitor the connection.
I've worked on less sensitive implementations, and from my experience most of the work was the modelling+documentation+testing and much less the implementation (programming) itself.
Felix
10-30-2008 08:37 PM
Hi Mike,
Thanks for the reply.
The Master and Slave Crane will be decided prior to installation. Its not which is first turned ON or not.
In case of Master's or Slave's shutdown or loss of communication because of noise for instance, it will trigger
another logic that the crane CAN'T operate on the overlapped portion.
Which of the shipped examples is good to start with?
Thanks a lot.
10-30-2008 08:49 PM
Hi Felix,
Thank you for the advise too.
What do you mean by "model your states"?
In any case the VI will keep on running even there is lost in communication, shutdown, communication interference, etc. If these happens it will just trigger another logic that crane CANT operate on the overlapped portion as a safety.
I also have to monitor the heartbit (coordinates transmission) ALWAYS and if there is some delay in the transmission (i.e. 2 seconds) then it will trigger the same above logic that it CANT operate on the overlapped area.
The VI must keep on running even there is lost in communication or one crane is powered down.
There must be no rule that the slave must be powered ON first than Master or vise versa.
So far i am on this stage of layouting what my conditions will be.
I really wish i can see some example VI similar to my application.
Thanks a lot.
10-31-2008 09:06 AM
What Felix was talking about was the design of your system. You need to carefully design the system before you start writing any software.
For your crane controls you could have states like: Initialization, communications error handling, coordinate measurements, motion calculation, safety checks, motion commands, interprocess communications, and so on. The model could be a state diagram or flow chart or other means of examining what can happen next from each state. For example suppose Crane B is moving in an area which Crane A can also reach. All the safety checks were satisfied. Now the communications between Cranes A and B fails. Does Crane B continue its move? Does it reverse and withdraw from the area of potential conflict? Is there a way that this can always be done safely? Does the crane shut down? Is there an option for manual override? Can the systems be re-initialized without moving a crane?
The model and the design help answer all these questions before any code is written. A well done design makes writing the code much easier.
This application is sufficiently different that it is unlikely you will find any examples which resemble your system at all closely. Things like the producer/consumer design patterns can show several ways to build robust programs which have independent processes for entering commands and acting upon them. The details will be up to you.
Lynn
10-31-2008 07:04 PM
Hi Lynn,
Thanks for all the detail advises.
I understood what you want me to do first.
regards,