Efficient curved conveyor using angular velocity instead of path

Typically: "How do I... ", "How can I... " questions
Justus
Posts: 9
Joined: 24 Jan 2017, 07:37

Efficient curved conveyor using angular velocity instead of path

Postby Justus » 17 May 2017, 07:31

Hi,

The circular conveyor in the example model browser (equipment->conveyor belts->"circular conveyor belt.ttm") uses a path. This works, but is not very efficient. So I tried to create a more efficient one using the same method as used with the "conveyor belt (very efficient).ttm", but using sim_shapefloatparam_init_velocity_g instead of sim_shapefloatparam_init_velocity_x/y/z:

Code: Select all

if (sim_call_type==sim_childscriptcall_initialization) then
    forwarder=simGetObjectAssociatedWithScript(sim_handle_self)
    speed=0.1
end

if (sim_call_type==sim_childscriptcall_actuation) then
    simResetDynamicObject(forwarder)
    simSetObjectFloatParameter(forwarder,sim_shapefloatparam_init_velocity_g,speed)
end


This works but rotation is relative to the geometric centre of the shape. Fine when creating 360 degree conveyors, but not for 90 degree conveyors. I can move the centre by grouping a extra shape to the plane, like so: http://imgur.com/ewUpSX4

But now I have a extra shape responding to the environment. Is there any other way to change the geometric centre, or a different way to create a very efficient angular conveyor?

Regards,
Justus

coppelia
Site Admin
Posts: 5719
Joined: 14 Dec 2012, 00:25

Re: Efficient curved conveyor using angular velocity instead of path

Postby coppelia » 17 May 2017, 16:28

Hello Justus,

ok, if I understood you correctly, you have other ways, next to what you did. For example:

  • If the rotation center is not where the shape center is, then you will have to add an initial rotation and an initial translation
  • Use a combination of two shapes and two joints, and move the first joint by a few degrees, while the other shape is non-respondable. Then reset the first joint, make its shape non-respondable. And make the second shape respondable, then move the joint of the second shape. Once you have moved the second joint by a few degrees, reset it, set the second shape to non-respondable, and start all over with the first joint and its shape.

Cheers

Justus
Posts: 9
Joined: 24 Jan 2017, 07:37

Re: Efficient curved conveyor using angular velocity instead of path

Postby Justus » 17 May 2017, 19:19

The 2nd option works (thanks!) but adds some extra shapes and joints, so I'm trying to work out your first suggestion.

I can rotate the shape around the correct axis (using simRotateAroundAxis), like so:

Code: Select all

m=simRotateAroundAxis(m,{0,0,1},{-2,0,0},math.rad(speed))
simSetObjectMatrix(forwarder,-1,m)


Should I use this matrix to calculate a combination of linear and angular velocities? Maybe you can explain a bit more about adding initial rotation and an initial translation?


Return to “General questions”

Who is online

Users browsing this forum: Google [Bot] and 16 guests