Maestro cmd not set after disable servo

I am using a Micro Maestro 6 to control a slide motion table in my project. As I need to control the speed, acceleration and power of servo whenever I set a target pos, I’m modifying the UscCmd C# project to insert an additional option in it.

But what I noticed is some feature is not being set in the controller:

  1. Set Speed, Accel, Pos of servo.
  2. Wait for servo to reach target.
  3. Send pos 0 to servo to disable it’s power.
  4. Send another pos to servo with different speed and accel.
  5. Notice this time speed and accel is reset back to 0, only pos is working.

Is it becasue I am sending pos 0 to servo on every cmd which causes this problem?
How do I fix it because I need my servo to power down after reaching a pos to prevent it from overheating. :frowning:

         '''''' 
            else if (opts["set"] != null)
            {
                string[] parts = opts["set"].Split(',');
                if (parts.Length != 4)
                    opts.error("Wrong number of commas in the argument.");
                byte servo = 0;
                ushort pos = 0;
                ushort speed = 0;
                byte accel=0 ;
                servo = byte.Parse(parts[0]);
                pos = ushort.Parse(parts[1]);
                speed = ushort.Parse(parts[2]);
                accel = byte.Parse(parts[3]);
                    
                //Set Speed
                 usc.setSpeed(servo, speed);
                 //Set Accel
                 usc.setAcceleration(servo, accel);
                 //Set Pos
                 usc.setTarget(servo, pos);
                 //Wait for servo to reach target
                 ServoStatus[] target;
                 do
                 {
                     Thread.Sleep(100);
                     device.getVariables(out target);
                 } while (target[servo].position != pos);
                 //Disable servo power to prevent over heating
                 usc.setTarget(servo, 0);
                 //Clear Error
                 usc.clearErrors();
            }

Hello.

Yes, when you set a servo’s target/position to 0, the Maestro loses its memory of where the servo was. Then when you send the next Set Target command, the Maestro will move the servo at full speed to get there. The solution is that when you want to re-enable power to the servo, your program should send a Set Target command telling the servo to go to the position that it is already at. After you send that command you might need to delay for a little bit, but then you can send a Set Target command which should make the servo slowly move to its next position.

–David