I created a lift unit and defined its joint motion relationship with pyhon. It looks normal in manual mode. I think the axis motion relationship is correct. But when OnRun, it becomes slow and even the joints become misaligned, I think because of the speed of the system. I knew it would improve a lot if I let it convert to joint expressions instead of using python. But I find it more convenient to use python, because every step of the calculation can be verified, and it is easy to check for errors. Anyway, what are some good ways to improve a python program so that it runs smoothly in onrun mode?
English is not my native language, so I don’t know if this is clear.
剪刀测试.vcmx (12.8 MB)
Uncheck “Rebuild” option for each property, then you’re good to go.
Thank you for your reply, which is very helpful to me; It’s amazing how it suddenly works.
When do we need to ‘Rebuild’, when do we need to ‘Update simulation’?. There are some simple descriptions in the help file, but I still don’t really understand them, and I don’t know in what specific cases we need to check them. So can you help with that?
One more question: the values of all joints except ‘link_1’ are no longer updated in the simulation. Why? I tried adding servo controllers to them, but it seems the result is the same.
When you update your own calculated values, you only translate or rotate geometry, you did not change the geometry appearance, so there is no need to rebuild, rebuild geometry is heavy loading, try to avoid unless necessary.
VALUE_link6 != J6, VALUE_link6 is your calculated value according to mechanism, so only VALUE_link6 changes, and this is normal, in reality, you only have 1 motor, which is J1. Others are driven by mechanism, not motor.
Your explanation is clear, I understand, thank you!