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 |
#1
|
|||
|
|||
Crane drop off position
Hi all.
I have a model, where I would like a crane to carry flow items between queues and processors. I have two problems I need to solve: 1) Whenever the crane picks up a flow item, it does so in the correct position, but whenever it drops off an item at a processor or a queue, it does it at a slightly wrong x/y pos. 2) Can I add files to the media file library in a way, so that the index number stays the same? I have had problems with flow items taking on the wrong shape after a 'change 3D shape' trigger. If this subject has been posted before, I apologize. I searched the forum for a similar post, but found none. |
#2
|
|||
|
|||
Hi,
For question number 2 look instead to use frames. It is much easier to use frames instead of change 3D shape. Look in the help for Frames and the setframe command. Lars-Olof |
The Following 3 Users Say Thank You to Lars-Olof Leven For This Useful Post: | ||
Kris Geisberger (10-16-2012) |
#4
|
|||
|
|||
There is an issue with 3D Media being assigned new indexes when other models are being used. This is why it is recommended in the picklist option for Change 3D Shape to set the index number using a global variable. So if I created a global variable called HorseShape which had integer data, then in the OnReset of the model I could put the following code:
HorseShape = getshapeindex("3DMedia\\Horse.3ds"); Then in your picklist option, you can set the shape index number to be HorseShape. |
The Following User Says Thank You to Matt Long For This Useful Post: | ||
Jörg Vogel (10-17-2012) |
#5
|
|||
|
|||
Is there anyone can answer the question 1?
Question 1: Whenever the crane picks up a flow item, it does so in the correct position, but whenever it drops off an item at a processor or a queue, it does it at a slightly wrong x/y pos. |
#6
|
||||
|
||||
What the crane does is ask the queue where to place the products. As a user you don't have access to what the queue tells you so you have to solve it in a different way. The following 4 are possibilities I can think off:
1 translate the 3d model of the queue with the use of the Shape Factors -> Edit on the General tabpage 2 create your own tasksequence with traveltoloc or travelrelative commands 3 Create your won queue, based on the BasicFR and use your own pick/place offset to determine where the crane is travelling to 4 Use a small dummy and invisible queue, bring the product to there and move the productin into the actual queue and move this dummy queue around to the right position. |
The Following 2 Users Say Thank You to Steven Hamoen For This Useful Post: | ||
oliver xie (10-21-2012) |
#7
|
|||
|
|||
hi steven
thank you for your reply! i think the four methods you provided are not the direct access to solve the problem. in order to slove the problem, i find the bottom code which decide the position where the crane would drop off a flow item. the code is something as following: From:library->navigator->cppfunctions->navigator FlexsimObject* destobj = &o(FlexsimObject, destination); TaskExecuter* te = &o(TaskExecuter, traveler); double maxradius = (max(destobj ->b_spatialsx, destobj ->b_spatialsy) / 2) + (te ->b_spatialsx / 2); double relativeloc[3]; vectorproject(destination, destobj->b_spatialsx*.5, -destobj->b_spatialsy*.5,0, up(te ->holder), relativeloc); double xdifference = relativeloc[0] - xcenter(te ->holder); double ydifference = relativeloc[1] - ycenter(te ->holder); double hordistance = sqrt(sqr(xdifference) + sqr(ydifference)); double travelpercent = max(0, 1 - (maxradius / max(.000001,hordistance))); /* pt(" maxradius ");pf(maxradius); pt(" dx ");pf(xdifference); pt(" dy ");pf(ydifference); pt(" hordist ");pf(hordistance); pt(" travelpercent ");pf(travelpercent); */ if(travelpercent == 0) { te->destinationarrival(0); return 0; } // Create the navigation request fsnode* newnode = restorenode(recycledtravelrequests(), node_v_activetravelmembers); if(! newnode) { nodeinsertinto(node_v_activetravelmembers); newnode = last(node_v_activetravelmembers); nodealloc(newnode, sizeof(NavigatorRequest)); } NavigatorRequest * newreq = &o(NavigatorRequest, newnode); // Here I set the initial data on the travel request, like the reference to the traveler, the destination, the begintime, etc. newreq->traveler = traveler;// set the newreq->destination = destination; newreq->begintime = time(); newreq->endspeed = endspeed; treenode kinematics = te->node_v_kinematics; double offsetloc[3] = {travelpercent*xdifference, travelpercent*ydifference, relativeloc[2]-te->b_spatialz}; //pt(" offsetloc ");pf(offsetloc[0]);pt(" ");pf(offsetloc[1]);pt(" ");pf(offsetloc[2]);pr(); double totaltraveldist = sqrt(sqr(offsetloc[0])+sqr(offsetloc[1])+sqr(offsetloc[2])); newreq->totaldist = totaltraveldist; te->v_totaltraveldist += totaltraveldist; initkinematics(kinematics, te->holder,0,0); double traveltime = addkinematic(kinematics, offsetloc[0], offsetloc[1], offsetloc[2], te->v_maxspeed, te->v_acceleration, te->v_deceleration, te->v_lastupdatedspeed, endspeed, time(), KINEMATIC_TRAVEL) - time(); in the code above, i find the variable maxradius is the key to solve the problem, i can change the maxradius value but it would be recovered by the standard code, so the code i changed would not take effect. Now i want to create an user library which contain my custom navigator code to instend of the standard library and change the connection varible of queue object, but i have not did it. so i want to get some advices in this direction. i think the developer of this software maybe can develop the navigator to be an object like dispathcer , which contain a GUI where we can define some varialbes like maxradius and then decide where to drop off the flow item in an easier way. |
#8
|
||||
|
||||
1: You can't change the navigator code unless you want to recompile entire session every time you open Flexsim again
2: I'm a very experienced Flexsim developer and I will NOT touch the navigator 3: Why do you think that a piece of code that is working for almost 10 years would not be right for you? So please stop looking so deep and go for 1 of my solution which can solve your problem just fine. |
The Following 3 Users Say Thank You to Steven Hamoen For This Useful Post: | ||
RalfGruber (10-22-2012) |
#9
|
|||
|
|||
hi steven
thank you for your advices for the sofeware, i have respect for its bottom code and i cannot change its code. but i still think what i advise is right. because positions of all the drop off task to the FixedResource object are all controled by the navigator, but as an user i cannot control where to place item for all the key codes are all in the bottom codes. i have red the four advice you gave to me,but i think advice 1 is not suitable for drop off task from two or more directions. advice 2 is not suitable for the Frload task. advice 3 changes the object. and advice 4 makes the problem more complex. all in all, all advices you gave to me are not direct methods. i think all users who have used flexsim have came across this problem. At last i want to emphasize that i have respect for this software. i just ask for a little change. Quote:
|
#10
|
|||||||
|
|||||||
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
The Following User Says Thank You to Steven Hamoen For This Useful Post: | ||
Carsten Seehafer (10-23-2012) |
#11
|
||||
|
||||
Quote:
i am sorry if i let you feel not good like words above! let me clarify something here about what i am thinking of. i just feel the advices you gave is not direct. Quote:
Quote:
Quote:
all in all the advice 2,3 and 4 will solve the problem. but need some work. i just want to give an advice: if i can change the value of variable: double maxradius = (max(destobj ->b_spatialsx, destobj ->b_spatialsy) / 2) + (te ->b_spatialsx / 2); to double maxradius = 0.0001; i think all the problems will be done. i donnot want to change the bottom code ,because i cannot do it. so i hope to change the variable or something related in a front GUI. Maybe some developer can set a reference from the front GUI to the bottom code. at last, thank you for your sincere advices steven! |
#12
|
||||
|
||||
You can do what you ask with the existing gui. maxradius is calculated with the x- & y-size of your destination object and the x-size of your taskexecuter. You have to resize your objects. (If your are using a crane you should have a look into initializeoffset in the cppfunctions of the crane. It's a little bit different).
If you want a fast solution you should use the suggestions of Steven. There are a lot of dependencies, only changing the navigator is not a solution! |
The Following 2 Users Say Thank You to Carsten Seehafer For This Useful Post: | ||
Steven Hamoen (10-24-2012) |
#13
|
|||
|
|||
Changing maxradius to 0.0001 had no correctional effect in my test model - why don't you post an example of what you're trying to do?
Also - take a look at this post as an example of making pickup and dropoff locations look better (using one of the methods Steven recommended). It's just an example, and uses the first flowitem to calibrate future movements (so ignore it). |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
oliver xie (10-25-2012) |
Thread | Thread Starter | Forum | Replies | Last Post |
how get item position in Conveyor | LINWEIXU | Q&A | 2 | 08-16-2011 12:34 AM |
position of a table cell in a gui | Esther Bennett | Q&A | 1 | 04-14-2010 09:35 AM |
Set Window position and size | Nico Zahn | Q&A | 5 | 09-03-2008 02:09 PM |
Crane Logic: How to find out what a crane currently is doing? | Tom David | Q&A | 5 | 06-02-2008 11:57 PM |
Set reset position | Martijn van Oostenbrugge | Q&A | 1 | 02-25-2008 11:48 AM |