Page 1 of 1

Generic conveyor (belt) speed control

Posted: 05 Sep 2024, 13:52
by vaggkout
I am trying to make the belt stop uppon a proxSensor signal, but it seems like if you give an initial velocity to the belt you cant change it after. Any thoughts on that ?
Thank you

Re: Generic conveyor (belt) speed control

Posted: 05 Sep 2024, 15:26
by fferri
Yes you can change the velocity afterwards.

To command the conveyor externally or from another script, simply do:

Code: Select all

sim.writeCustomTableData(conveyorHandle, '__ctrl__', {vel=0.1})

Re: Generic conveyor (belt) speed control

Posted: 06 Sep 2024, 09:16
by vaggkout
thank you for your answer.
i can't do it. i dont know whether it is a problem of my script, but it looks like if you initialize the belt velocity, then you cant effect its velocity through the script. (i used sim.writeCustomTableData(conveyorHandle, '__ctrl__', {vel=0.1}) and after that sim.writeCustomTableData(conveyorHandle, '__ctrl__', {vel=0.0}) but the belt still move).
i am trying to make it stop through a proximity sensor signal. so when the proxsensor triggers then the velocity of the belt should be 0.0.

Re: Generic conveyor (belt) speed control

Posted: 06 Sep 2024, 12:55
by coppelia
Hello,

what version of CoppeliaSim do you run?
Also, the conveyor will not immediately stop, it will gradually slow-down then stop. If you want it to react faster, modify its Acceleration property upwards.

Cheers

Re: Generic conveyor (belt) speed control

Posted: 07 Sep 2024, 10:02
by vaggkout
thank you for your answer.
I realized that after a while and i did it.
thank you again