question

achuta.kalidindi avatar image
2 Likes"
achuta.kalidindi asked Joerg Vogel edited

Using kinematics to rotate a conveyor

Can you let me know how to use kinematics to rotate a conveyor in a model?

FlexSim 16.0.1
conveyorkinematicsrotationturntable
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ben Wilson avatar image
7 Likes"
Ben Wilson answered Joerg Vogel commented

Attached is a sample model that has some turntables in it. They use kinematics for the rotation.

The left turntable will index the item to the center, then rotate, then convey the item off. The right turntable will rotate and convey at the same time.

To see how the kinematics work, double click the BasicTE, then hit the Properties button. This will open the BasicTE's default properties GUI. From there you can examine the various offset behaviors, plus look at the labels on the object, which are used by the offset code.


basicturntables.png (24.0 KiB)
basicturntables.gif (230.2 KiB)
basicturntables.fsm (57.7 KiB)
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Tuan avatar image Tuan commented ·
Could you tell me how to write the kinematic code ? I can't understand the code
0 Likes 0 ·
Ryan Clark avatar image Ryan Clark Tuan commented ·

Hi @Tuan,

This is a very old post. Please ask your question as a separate question to keep things organized. If you want, you can reference this post in your new post to aid whoever might answer your question. Please see Best practices for using this Answers site - FlexSim Community for more details. Thanks!

2 Likes 2 ·
Tuan avatar image Tuan Ryan Clark commented ·

code.png

Where did you add TurnTable to Flexsim? and What were The custom code in triggers meanning? I can't figure it out, could you have code manual?

0 Likes 0 ·
code.png (46.8 KiB)
Show more comments
Ben Wilson avatar image
5 Likes"
Ben Wilson answered christoph gruber commented

Here are two other examples of rotating conveyors using kinematics.

The left system reorients items 90 degrees, the right by 180 degrees.


· 7
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

christoph gruber avatar image christoph gruber commented ·

@Logan Gold

I figure out it´s not necessarry to change the logic in the OnUnload trigger from the Turntable. If in the Entry Transfer objects from the destination Conveyors the"Hold Transprots if Space is Blocked" is checked the exception is prevent and it´s also not possible for the TurnTable to load another flowitem!

basicturntable-turn-back-1.fsm

1 Like 1 ·
Logan Gold avatar image Logan Gold ♦♦ christoph gruber commented ·

Awesome, good to hear.

0 Likes 0 ·
christoph gruber avatar image christoph gruber commented ·

Hi Ben, I try to use your two models above in new Flexsim 2017 but it doesn´t work. Do you have any ideas why? @Ben Wilson

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ christoph gruber commented ·

@christoph gruber, @Matt Long

FlexSim 2017 introduced a bug in updating kinematics. This will be fixed when 17.0.1 is released.

Unfortunately it looks like the work around mentioned in that post does not fix these models (adding a -1 as the optional 3rd parameter).

We'll have to wait to here from the dev team to see if this is related to the bug already found and fixed, or something new.

0 Likes 0 ·
christoph gruber avatar image christoph gruber commented ·

@Ben Wilson

Ben, I have to modify your basicturntable for my model requirement (see the attached file). First, in my model I have to use only non accumulation conveyors and second, if the turntable had finished his job he should turn back in the start position (also the reset position). For the second requirement I found a solution with a little code on the OnResourceAvailable and the Custom Draw trigger. But I don´t know if this is a smart solution, do you have any idea for a better way to do this?

And for the first requirement I get an error message (Clock overflow, run Stopped.) if the target conveyor is occupied or not working. I don´t know what can I do!?

Thank you very much for your answers in advance.

basicturntable-turn-back.fsm

0 Likes 0 ·
Logan Gold avatar image Logan Gold ♦♦ christoph gruber commented ·

@christoph gruber,

After looking through all the logic and testing different options, the fix for this issue that consistently works without being overly complicated is to set the delay time to 0 if the Conveyor's speed is 0. So in the OnUnload trigger, I changed line 10 from:

double conveytime = itemx/speed;

To these three lines:

double conveytime = 0;
if (speed > 0)
	conveytime = itemx/speed;

This will prevent the exception from happening. However, if an item tries to enter a stopped Conveyor, that item will sit on the Entry Transfer object instead until the Conveyor starts up again. After an item enters the Entry Transfer object and before it gets onto the Conveyor, it is possible for the TurnTable to load another flowitem.

If that is not the behavior you'd like for this model, then I believe the model will need to be adjusted to prevent items from entering the TurnTable if their destination Conveyor is stopped to prevent it from happening.

1 Like 1 ·
Logan Gold avatar image Logan Gold ♦♦ christoph gruber commented ·

@christoph gruber, I am still looking into this model to help answer all of your questions. However, the reason it is throwing a clock overflow error is happening because of the logic in the TurnTable's OnUnload trigger (around time 61.98).

The trigger is used to create a delay task so that the TurnTable will delay for a certain amount of time. The delay time is determined by getting the item's size and dividing by the Conveyor's speed - the Conveyor where the item is to be unloaded. Since it is trying to unload to StraightConveyor67 at this time, but StraightConveyor67 is currently stopped, then the speed is 0 which gives an undefined number when it is divided into the item's size. The delay task is still dispatched, but when it tries to execute with that undefined number as the delay time, the exception is thrown.

Since I am still working through the model, I'm not sure what should be changed to make sure this doesn't happen. Once I have a better understanding of everything, I will let you know any suggestions I have. I will also try to answer your other question at that time as well.

0 Likes 0 ·