Maestro 12 servo autohotkey speed problem from a newbe

Please can you help
i am trying to use this to open doors on a project i am doing.
I am using 9 servos at the moment ,0-7 open the doors in pairs and servo 8 opens a roller shutter.
What i wanted to happen is the top buttons open the doors and the bottom close them.all at a nice slow speed.
when i did the script i found the speed that it moved was fine, but then found that when i get to servo 7-8-9-10-11 they snap to position not a slow move.
i will later be using all 12 ways
i saw on the Forum that you can use this in the code to control the accel and speed.

RunWait usccmd --accel 0`,12,,Hide
RunWait usccmd --speed 0`,12,,Hide
Run usccmd --servo 0`,7500,,Hide
return

But i cannot get this to make any difference on the code i have done when i inserted it.

my code is with out the first code added

    Gui, Add, Button, x50 y50 w120 h70 , DOOR1 
    Gui, Add, Button, x50 y130 w120 h70 ,DOOR 
    Gui, Add, Button, x200 y50 w120 h70 , DOOR2
    Gui, Add, Button, x200 y130 w120 h70 ,DOOR2/CLOSED  
    Gui, Add, Button, x350 y50 w120 h70 , DOOR3
    Gui, Add, Button, x350 y130 w120 h70 ,DOOR3/CLOSED 
    Gui, Add, Button, x500 y50 w120 h70 , DOOR4 
    Gui, Add, Button, x500 y130 w120 h70 ,DOOR4/CLOSED 
    Gui, Add, Button, x650 y50 w120 h70 , ROLLER
    Gui, Add, Button, x650 y130 w120 h70 ,ROLLER/CLOSED
    Gui, Show, x337 y140 h250 w820, New GUI Window
    Return

    buttonDOOR1:
    Gui, Submit
    RunWait usccmd --servo 0`,4000,,Hide
    RunWait usccmd --servo 1`,4000,,Hide
    Gui, Show,, New GUI Window
    return

    buttonDOOR2:
    Gui, Submit
    RunWait usccmd --servo 2`,4000,,Hide
    RunWait usccmd --servo 3`,4000,,Hide
    Gui, Show,, New GUI Window
    return

    buttonDOOR3:
    Gui, Submit
    RunWait usccmd --servo 4`,4000,,Hide
    RunWait usccmd --servo 5`,4000,,Hide
    Gui, Show,, New GUI Window
    return

    buttonDOOR4:
    Gui, Submit
    Runwait usccmd --servo 6`,4000,,Hide
    Runwait usccmd --servo 7`,4000,,Hide
    Gui, Show,, New GUI Window

    return
    
    buttonROLLER:
    Gui, Submit
    Run usccmd --servo 8`,4000,,Hide
    Gui, Show,, New GUI Window
    return



    buttonDOOR:
    Gui, Submit
    RunWait usccmd --servo 0`,6000,,Hide
    RunWait usccmd --servo 1`,6000,,Hide
    Gui, Show,, New GUI Window
    return


    buttonDOOR2/CLOSED:
    Gui, Submit
    RunWait usccmd --servo 2`,6000,,Hide
    RunWait usccmd --servo 3`,6000,,Hide
    Gui, Show,, New GUI Window
    return


    buttonDOOR3/CLOSED:
    Gui, Submit
    RunWait usccmd --servo 4`,6000,,Hide
    RunWait usccmd --servo 5`,6000,,Hide
    Gui, Show,, New GUI Window
    return

    buttonDOOR4/CLOSED:
    Gui, Submit
    RunWait usccmd --servo 6`,6000,,Hide
    RunWait usccmd --servo 7`,6000,,Hide
    Gui, Show,, New GUI Window
    return

    buttonROLLER/CLOSED:
    Gui, Submit
    Run usccmd --servo 8`,6000,,Hide
    Gui, Show,, New GUI Window
    return

    GuiClose:
    ExitApp

and with the extra code i got

    Gui, Add, Button, x50 y50 w120 h70 , DOOR1 
    Gui, Add, Button, x50 y130 w120 h70 ,DOOR 

    Gui, Add, Button, x200 y50 w120 h70 , DOOR2
    Gui, Add, Button, x200 y130 w120 h70 ,DOOR2/CLOSED 

    Gui, Add, Button, x350 y50 w120 h70 , DOOR3
    Gui, Add, Button, x350 y130 w120 h70 ,DOOR3/CLOSED 

    Gui, Add, Button, x500 y50 w120 h70 , DOOR4 
    Gui, Add, Button, x500 y130 w120 h70 ,DOOR4/CLOSED 

    Gui, Add, Button, x650 y50 w120 h70 , ROLLER
    Gui, Add, Button, x650 y130 w120 h70 ,ROLLER/CLOSED
   
    Gui, Show, x337 y140 h250 w820, New GUI Window
    Return

    buttonDOOR1:
    Gui, Submit
    RunWait usccmd --accel 0`,12,,Hide
    RunWait usccmd --speed 0`,12,,Hide
    Run usccmd --servo 0`,4000,,Hide
    Run usccmd --servo 1`,4000,,Hide
    Gui, Show,, New GUI Window
    return

    buttonDOOR2:
    Gui, Submit
    RunWait usccmd --accel 0`,12,,Hide
    RunWait usccmd --speed 0`,12,,Hide
    Run usccmd --servo 2`,4000,,Hide
    Run usccmd --servo 3`,4000,,Hide
    Gui, Show,, New GUI Window
    return

    buttonDOOR3:
    Gui, Submit
    RunWait usccmd --accel 0`,12,,Hide
    RunWait usccmd --speed 0`,12,,Hide
    Run usccmd --servo 4`,4000,,Hide
    Run usccmd --servo 5`,4000,,Hide
    Gui, Show,, New GUI Window
    return

    buttonDOOR4:
    Gui, Submit
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    Run usccmd --servo 6`,4000,,Hide
    Run usccmd --servo 7`,4000,,Hide
    Gui, Show,, New GUI Window
    return
    
    buttonROLLER:
    Gui, Submit
    RunWait usccmd --accel 0`,12,,Hide
    RunWait usccmd --speed 0`,12,,Hide
    Run usccmd --servo 8`,4000,,Hide
    Gui, Show,, New GUI Window
    return



    buttonDOOR:
    Gui, Submit

    RunWait usccmd --accel 0`,12,,Hide
    RunWait usccmd --speed 0`,12,,Hide
    Run usccmd --servo 0`,6000,,Hide
    Run usccmd --servo 1`,6000,,Hide
    Gui, Show,, New GUI Window
    return


    buttonDOOR2/CLOSED:
    Gui, Submit
    
    RunWait usccmd --accel 0`,12,,Hide
    RunWait usccmd --speed 0`,12,,Hide
    Run usccmd --servo 2`,6000,,Hide
    Run usccmd --servo 3`,6000,,Hide
    Gui, Show,, New GUI Window
    return


    buttonDOOR3/CLOSED:
    Gui, Submit

     RunWait usccmd --accel 0`,12,,Hide
    RunWait usccmd --speed 0`,12,,Hide
    Run usccmd --servo 4`,6000,,Hide
    Run usccmd --servo 5`,6000,,Hide
    Gui, Show,, New GUI Window
    return

    buttonDOOR4/CLOSED:
    Gui, Submit
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    Run usccmd --servo 6`,6000,,Hide
    Run usccmd --servo 7`,6000,,Hide
    Gui, Show,, New GUI Window
    return
   
    buttonROLLER/CLOSED:
     RunWait usccmd --accel 0`,12,,Hide
    RunWait usccmd --speed 0`,12,,Hide
    Run usccmd --servo 8`,6000,,Hide
    Gui, Show,, New GUI Window
    return

    GuiClose:
    ExitApp

(you will see that on door 4 i put an accel as 1 and a speed as 4 as this is the speed i used on Maestro control center)
but when i run this it makes no diffrence to the speed, 0-6 run slow ish 7-8-9-10-11 snap and i now get a uscCmd has stoped working pop up

any help in how i can including speed and accel on all sevos would be great.
many thanks
Mason

Hi, Mason.

The first parameter passed to the speed/acceleration flags is the servo channel you are setting to have that speed/acceleration. You can get a list of commands and their parameters by opening a command prompt and typing “usccmd”. Also, for maximum reliability, I would suggest using RunWait everywhere you are using Run.

I would love to hear if that fixes your problems!

- Ryan

Hi Ryan
thank you for getting back to me so fast.
i think i have done what you have suggested but as i said i am new to this

    Gui, Add, Button, x50 y50 w120 h70 , DOOR1 
    Gui, Add, Button, x50 y130 w120 h70 ,DOOR 

    Gui, Add, Button, x200 y50 w120 h70 , DOOR2
    Gui, Add, Button, x200 y130 w120 h70 ,DOOR2/CLOSED 

    Gui, Add, Button, x350 y50 w120 h70 , DOOR3
    Gui, Add, Button, x350 y130 w120 h70 ,DOOR3/CLOSED 

    Gui, Add, Button, x500 y50 w120 h70 , DOOR4 
    Gui, Add, Button, x500 y130 w120 h70 ,DOOR4/CLOSED 

    Gui, Add, Button, x650 y50 w120 h70 , ROLLER
    Gui, Add, Button, x650 y130 w120 h70 ,ROLLER/CLOSED
   
    Gui, Show, x337 y140 h250 w820, New GUI Window
    Return

    buttonDOOR1:
    Gui, Submit
    Runwait usccmd --servo 0`,4000,,Hide
    Runwait usccmd --servo 1`,4000,,Hide
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    Gui, Show,, New GUI Window
    return

    buttonDOOR2:
    Gui, Submit
    Runwait usccmd --servo 2`,4000,,Hide
    Runwait usccmd --servo 3`,4000,,Hide
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    Gui, Show,, New GUI Window
    return

    buttonDOOR3:
    Gui, Submit
    Runwait usccmd --servo 4`,4000,,Hide
    Runwait usccmd --servo 5`,4000,,Hide
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    
    Gui, Show,, New GUI Window
    return

    buttonDOOR4:
    Gui, Submit
    Runwait usccmd --servo 6`,4100,,Hide
    Runwait usccmd --servo 7`,4100,,Hide
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    
    Gui, Show,, New GUI Window
    return
    
    buttonROLLER:
    Gui, Submit
    Runwait usccmd --servo 8`,4000,,Hide
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    
    Gui, Show,, New GUI Window
    return



    buttonDOOR:
    Gui, Submit
    Runwait usccmd --servo 0`,6000,,Hide
    Runwait usccmd --servo 1`,6000,,Hide
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    Gui, Show,, New GUI Window
    return


    buttonDOOR2/CLOSED:
    Gui, Submit
    Runwait usccmd --servo 2`,6000,,Hide
    Runwait usccmd --servo 3`,6000,,Hide
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    
    Gui, Show,, New GUI Window
    return


    buttonDOOR3/CLOSED:
    Gui, Submit
    Runwait usccmd --servo 4`,6000,,Hide
    Runwait usccmd --servo 5`,6000,,Hide
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    
    Gui, Show,, New GUI Window
    return

    buttonDOOR4/CLOSED:
    Gui, Submit
    Runwait usccmd --servo 6`,5900,,Hide
    Runwait usccmd --servo 7`,5900,,Hide
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    Gui, Show,, New GUI Window
    return
   
    buttonROLLER/CLOSED:
    Runwait usccmd --servo 8`,6000,,Hide
    RunWait usccmd --accel 1`,12,,Hide
    RunWait usccmd --speed 4`,12,,Hide
    Gui, Show,, New GUI Window
    return

    GuiClose:
    ExitApp

(i think this is what you meant)
but i still have the same problem 1-6 run slow 7 -12 snap even when i move them to door 1-2 or 3 which were working fine .
i have run 7-12 on maestro control and they all seem to work fine.
As for what you said about opening a command prompt and typing “usccmd” i do not know where i do this is it in the code or in autohotkey or maestro?.
sorry did say i had no idea.
mason

In all of your code, I only see you setting the acceleration and speed of the servos on channels 1 and 4. If you want to set the acceleration and speed of a servo on, for example, channel 7, you would do this:

RunWait usccmd --accel 7`,1,,Hide
RunWait usccmd --speed 7`,4,,Hide

- Ryan

Hi Ryan
Thank you so much
i now see what you mean,
Have just run it and all seems to work.
top work mate
mason :smiley:

I am glad you got it working. Your project sounds interesting. I hope you post some videos or pictures later!

- Ryan