Jointspeed

Hello guys. I have a question. I changed the speed of the axes in the robot controller, but the speed of the axes remains the same during simulation. But modifying the axis speed in the robot program works. Also I would like to ask if there is any way to implement dynamic modification of axis speeds during simulation.

I made a demo with evasion function a long time ago, which included this part. In fact, during the running process, you cannot change the value passed by the servo to the joint, so under normal methods, it will not work if you directly change the speed of the joint. This is why you cannot change the speed in the simulation(root cause). Fortunately, Visual Components provides a way to interrupt OnRun() during the simulation process, debug the parameters, and then run it again. The specific code is as follows:

from vcScript import *
comp = getComponent()
servo = comp.findBehaviour("Controller")
speed = comp.getProperty("Speed")
def OnSignal( signal ):


    if signal.Value:
        suspendRun()
        
        servo.Joints[0].MaxSpeed = 100
        
        speed.Value = 100.0
        
        resumeRun()
    else:
        suspendRun()
        
        servo.Joints[0].MaxSpeed = 10000
        
        speed.Value = 10000.0
        
        resumeRun()
def OnRun():
    servo.Joints[0].MaxSpeed = 10000
    
    speed.Value = 10000.0
    '''
    goal_pos = 15000.0
    
    while True:
        condition(lambda: servo.Joints[0].Dof.VALUE != goal_pos)
        
        servo.move(goal_pos)
    '''
def OnReset():
  speed.Value = 0.0

Here’s a quick code for changing joints, hope it helps, have a nice day! :melting_face:

Thank you! I’m sure this can help me. I have another question, may I ask why I change the speed of the axes in the robot controller but it doesn’t work?

Those are settings for the PM transport controller which it probably does use for Transport tasks (e.g. TransportIn statement in a process).

If you have programmed the robot yourself on the Program tab or modified the PM auto-generated program then those values are probably not used at all.

1 Like

Thank you very much! That’s what I was looking for.