ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
|
Downloads |
Q&A Using Flexsim and building models |
#1
|
||||
|
||||
Crane Logic: How to find out what a crane currently is doing?
I need to program a crane logic and need to know if a crane is traveling, transport or load/unload.
I had a look into the Crane Logic pick list option in HandleCollsion, but this does not solve my problem. I tried to solve it by find out in which state the crane currently is by reading the tasksequence type he is currently in but this was not successful. I know that this shows normally the next task type and not the current one if it is not connected with a network. Also the information that the crane is travel or load/unload seems not to be enough. After some testing it looks like that I need to know if the crane is moving in x or y direction or in z direction, because this will be a valuable information. If he moves in z direction than he is loading or unloading, right? So my questions is how I can find out if he moves in z direction. Because the crane is using kinematics I am pretty sure that with getkinematics() there must be a way to get this information. I tried this but was not successful. I am not really sure to which node I need to pointer (kinematics node). How can I find out if a crane is moving in z direction so that he has z speed? Or is there another way to find out when the crane is loading or unloading? My model is just a crane with some queues. The crane is always in the travel offset. The crane is standard so with L>XY>D. What I try to do is to control two cranes on one track using collision sphere but the above mentioned picklist option is not enough because it does not take care of some situation e.g. if a crane is loading or unloading. So try to make a control where the cranes have the following states: Travel, Transport, Load or Unload. Depending on this information I like to give them additional tasksequence.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#2
|
||||
|
||||
Tom,
I recently made a new ASRS object with the basic TE for a customer and was surprised to find out that I didn't even need the travel task in the task sequence. I would not be surprised to findout that the crane was the same way and that this is why you are having problems. Try removing the travel task from your task sequences and see if the crane still runs the same way. If it does behave the same way you might be able to get around it by connecting the crane to a network path for it's movements. If that is unacceptable then I would think that the only way you will get what you want is going to be by building it yourself. Good Luck, Brandon
__________________
thats not normal. |
#3
|
||||
|
||||
Yes, I can remove the travel task from the tasksequence, because the crane is using offset and is doing only loading or unloading and travel offset.
But this does NOT solve my problem. I need to find out when the crane is loading or unloading and one way could be to find out over kinematics if he is moving in z direction. So that’s why I am asking is there is a way to check if the crane is moving in z direction. Maybe build in a network could help in a way, but is additional work to place network nodes, etc. So in my eyes not the first direction to go. Also to build an own crane seems in my eyes to much effort to solve the task. There is so much power in Flexsim that I would think building an own object must the last way, but may be I am wrong. All I want to find out when the crane is loading or unloading (not doing travel offset). This can not be that difficult, right?
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#4
|
|||
|
|||
Tom,
The kinematics data node is one of the variables called cranekinematics. To get the z-velocity of a crane, use something like this: Code:
double zvelocity=getkinematics(getvarnode( node("/Crane2",model() ),"cranekinematics"),KINEMATIC_VZ,0,time()); Another trick you might find useful is to only check the X direction for collision checks between two cranes (click Advanced... in the collision tab). This will make the cranes collide, even if one is below the other one. |
The Following 3 Users Say Thank You to Alex Christensen For This Useful Post: | ||
RalfGruber (06-05-2008) |
#5
|
||||
|
||||
Tom,
You where saying that you could get the active taks. Have you tried "gettasktype"? If you pass the right parameters it returns the tasktype of the current active task. Another solution might be to break up your tasksequence and put messages in between. That way you know what a crane is doing exactly. You could for instance use the PLACE_OFFSET task and then do the actual LOADTASK to split the loading and traveling. Or use travelrelative to even get a message when you are finishing the z-movement (using place_offset with parameters 0,0,1 doesn´t seem to work. Probably because of the way the kinematics are constructed internally in the crane) Hope this helps you a bit further. Steven |
#6
|
||||
|
||||
By combining the getcurtask(), zvelocity, and content() of the Crane, you should be able to tell when the crane is doing loading, unloading, travel-offset with load, travel-offset without load, hoisting-up, hoisting-down, or trolleying. For standard tasksequence, the crane only implement task 2 (TASKTYPE_FRLOAD) and task 5 (TASKTYPE_FRUNLOAD) and ignore other tasks, as Alex and Brandon mentioned. So if you only want to know it is doing loading or unloading, getcurtask() should be sufficient.
__________________
Best, Alan |
Thread | Thread Starter | Forum | Replies | Last Post |
Are there any limits using crane and rtg in CT? | qin tian | Container Terminal (CT) Library | 1 | 01-04-2008 03:04 PM |
Rotary Crane | Nico Zahn | Q&A | 2 | 11-13-2007 01:58 AM |
Pull Logic Dillema | William Proctor | Q&A | 2 | 09-14-2007 12:46 PM |
Adjusting 3d shape of a crane | Maurits Brandt | Tips and Tricks | 3 | 09-14-2007 12:25 AM |
Gantry Crane Control (from the old user community) | Bill Nordgren | Q&A | 0 | 08-02-2007 06:34 PM |