Tray Motions

"Hi everyone, I’m working on a custom conveyor system in VC 4.8 Premium. I have a Python script that calculates the distance for several nodes (T1 to T11) based on simulation time.

The script successfully finds the nodes and assigns values to their ‘Distance’ properties. I can see the values updating in the output/properties panel, but the 3D geometry stays still. Even if I manually type a value into the ‘Distance’ field during simulation, the tray doesn’t move.

Are these nodes locked by a Servo Controller or a specific Kinematic setting? How can I ‘unlock’ them so the script can drive their positions?" “If anyone has a spare moment, could you please check if my joint configuration is correct for script-based control? Thank you so much in advance for your kindness.”

Tray motion.vcmx (713.8 KB)

hello bobby.

You have a good habit of putting indeterminate operations inside the try, but that also causes him not to report errors. Pull for outside of try and you can see the error being reported:

image
Actually, as you can see from the front, your tray gets vcNode, and you can also try to print it:

image
You can look through the VC help file and you’ll see that vcNode doesn’t have Properties, and by the sound of what you’re saying, you want to control the joints? That should be controlled with vcNode.Dof.VALUE, but the current version looks strange:

1 Like

Hi @BAD “Thank you so much for your continuous support! The trays are finally moving now thanks to your advice. However, the movement direction is currently incorrect. Could you please guide me on how to adjust or flip the direction? Should I modify the value to be negative in my script, or is there a setting in the joint properties I should look at? Thanks again!”

I’m not at work right now, so I don’t have a VC environment to give you directly. But as far as I can see, it looks more like you have the wrong origin of rotation, and changing the value to a negative number in the script is just changing the direction of the error. What you should do is, select the link, and then use Snap to change the center of rotation. Of course, I strongly recommend you to use “Selected” mode instead of “Hierarchy” mode, otherwise the model will be messed up.

1 Like

okay @BAD “I’m trying to adjust it myself for now. I’ll wait for you when you’re ready.”

hey, bobby.

I’m sorry I can’t help you with this more often as I have my own job, but if you have any specific questions you can just ask here and I’ll choose to respond if I’m available or if someone else is available.:smile: