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
|
|||
|
|||
Kinematics
Can someone provide an advice regarding kinematcs. We are trying to make items rotating while traveling to the conveyor. Definitivelly that something is missing there.
Last edited by Iulian Marin Ion; 09-03-2008 at 09:24 PM. Reason: Changing the attachment with the correct one |
#2
|
|||
|
|||
You want an object to rotate around its Z axis while traveling down the conveyor? The conveyor manages the Z rotations of objects inside it. If you add a curved section, you'll notice the ZR value changes when it goes around a turn. The only way I can think of to make this happen is to put an object inside another object, then turn the object inside its container.
|
#3
|
|||
|
|||
Thanks for the reply. The curvature handling I understood. Simply kinematics applied to the item it should not be enough? I was also suspecting that not fuctioning it is due to the compiler that is not installed (currently I am trying to install the compiler as well and to make some few more tests).
|
#4
|
|||
|
|||
Quote:
|
#5
|
|||
|
|||
I've adapted your model to change the rotation in the OnDraw of the conveyor instead of using a kinematic on the item. I use a label on the item called startx and inspect the conveyor kinematicX which reflects its position along the conveyor. There's probably a better way of doing this, but this was the first that sprang to mind. I added a conveyor on the front to show the orientation of the item before it enters the rotation phase.
|
The Following 2 Users Say Thank You to Jason Lightfoot For This Useful Post: | ||
Tom David (09-04-2008) |
#6
|
|||
|
|||
Quote:
|
#7
|
|||
|
|||
Here's an updated model that allows a curved conveyor to be used by adding zrot(item) to minof(360,kinx);
|
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Cliff King (09-05-2008) |
#8
|
|||
|
|||
Quote:
Thank you very much for your recommendation. It was quite usefull for the model. Regards |
#9
|
||||
|
||||
I was going to add a post here about how you should probably use the shape offsets instead of setting the rotation of the object, but I tried it and found that the shape offsets rotate the object around its x/y/z origin, instead of around its x/y/z center, which makes the object rotate weird. And it seems Jason already tried this in his code. Anyway, it looks like Jason's method is the best way to do it. Good job Jason.
|
#10
|
|||
|
|||
rotating item on conveyor
I was asked about this the other day, so I put together a model that includes both Jason's and Alex's solutions. The nested flowitem approach is more difficult, but offers the advantage of using kinematic commands that include acceleration and deceleration. Note that you could also translate the item normal to conveyor while traveling on it. If you don't need accel/decel motion, I would not recommend this approach.
In the flowitem bin I copied a pallet inside of another pallet, then checked the hide 3D shape check box on the parrent pallet. I also modified the OnReceive eventfunction to move objects into its child (the visible pallet) allowing this nested item to work correctly with a standard combiner. I modified a processor to act like a separator for this special flowitem, because the standard separator would not handle it correctly. Last edited by Kris Geisberger; 03-19-2009 at 09:16 PM. Reason: minor edits for clarity |
#12
|
|||
|
|||
It's tricky because the shape you see in the flowitem bin is the visible child of the invisible flowitem SpinnerFlowItem object. Although it's possible to get to it from the flowitem bin, you might learn a little more if you approach from the model tree. Regardless you need to be in tree view to find the OnReceive event function of the SpinnerFlowItem (you can't get at it with the evaluation version). I'll show both.
Getting to the SpinnerFlowItem from flowitem bin: 1. Open flowitem bin 2. Go to last flowitem called "SpinnerFlowItem" 3. Right-click on the item object in the 3d view and select "Explore Tree" from the pop-up menu 4. Now you are looking at the tree view of the 'visible pallet' as I called it. Since this is the child of the SpinnerFlowItem (the one with the code) we need to go up in the tree. Right-click in the tree edit window and choose View -> Up from the pop-up menu. 5. See Getting to OnReceive node below Getting to the SpinnerFlowItem from model tree: 1. Open model tree 2. Click on the + sign of the Tools folder immediately under model 3. Click on the + sign of the FlowItemBin object 4. Click on the + sign of the SpinnerFlowItem folder 5. Click on the + sign of the SpinnerFlowItem object (optional - just to see the nested 'visible pallet' object) 6. See Getting to OnReceive node below Getting to OnReceive node: 1. In tree view click on the SpinnerFlowItem object icon, then click on the > to dive into the object's data 2. Click on the + sign of the "behaviour" node 3. Click on the + sign of the "eventfunctions" node 4. Click on the "OnReceive" node (not the + sign) to view the code See the attached screenshot. Note, if you modify the code you will need to Build FlexScript under the Build menu. Last edited by Kris Geisberger; 08-04-2009 at 09:07 PM. |
#13
|
|||
|
|||
thanks Kris Geisberger
this,"nodefunction(node("/project/exec/globals/nodefunctions/palletentry"),c,i);" or "Flexscript byte code instr 1: nodefunction(instr 4,instr 3,instr 2 ) nr instr's: 5 instr 2: i() nr instr's: 1 instr 3: c() nr instr's: 1 instr 4: node(instr 5 ) nr instr's: 2 instr 5: STRING_LITERAL: "/project/exec/globals/nodefunctions/palletentry"??? and i want to know what situation will use this operation?? Last edited by Kris Geisberger; 08-04-2009 at 07:55 PM. Reason: no need to quote entire post, just reply |
#14
|
|||
|
|||
LINWEIXU,
I'm not really sure what you are asking. What are you trying to do? Don't concern yourself with the byte code. The OnReceive eventfunction is executed when an item is moved into the SpinnerFlowItem, like in a Combiner pack. The default code of a standard pallet flowitem is: nodefunction(node("/project/exec/globals/nodefunctions/palletentry"),c,i);which calls a function that is responsible for trying to position items as best possible 'on top' of the pallet. In the SpinnerFlowItem I replaced the default code with: moveobject(i,first(c),0);which tells Flexsim to move the item into the visible pallet... thus executing the OnReceive of the visible pallet where I kept the call to the palletentry function. |
#15
|
|||
|
|||
thanks Kris Geisberger ,but i do not see anything code about "then checked the hide 3D shape check box on the parrent pallet".i want to know why you use "In the flowitem bin I copied a pallet inside of another pallet, then checked the hide 3D shape check box on the parrent pallet."?
Last edited by Tom David; 08-06-2009 at 01:36 AM. Reason: Useless Quote |
#16
|
|||
|
|||
I attached a better screenshot to post #12.
Again, you need tree view to find the OnReceive eventfunction. I placed one pallet inside another pallet to be able to rotate/translate a pallet flowitem while it is moving along a conveyor using kinematic acceleration/deceleration. A Conveyor won't allow you do to this to the flowitem it is handling, but we can do anything we want to the contents of the flowitem. So I let the conveyor handle the SpinnerFlowItem, which in the model it is invisible, and in the model we see the visible pallet (nested pallet) that the kinematics rotate. |