0x0080 Error on 12-Channel after hours of running

I’ve been using the 12 Channel microcontrollers to drive 4 servos through an identical movement patern. This pattern runs for 7 minutes and then repeats indefinitely. After a few hours of running, the microcontroller’s red LED blinks and the 0x0080 “Subroutine Overflow/Underflow” error appears. I’ve attached my full code, but below is the main portion as the rest is a simple repetition of the pattern.

# Pololu Scripting Code

perpetualmotion:

2 0 speed
2 1 speed
2 2 speed
2 3 speed

begin 

6000      6000      6000      6000 resetcycle           
repeat
  
sub resetcycle 
    begin
     depth 
    while
     3 servo 2 servo 1 servo 0 servo
     3000 delay
    repeat

begin 
6080      6080      6080      6080
6070      6070      6070      6070
5950      5950      5950      5950
6080      6080      6080      6080
6080      6080      6080      6080
6100      6100      6100      6100
6060      6060      6060      6060
6100      6100      6100      6100
6060      6060      6060      6060
6130      6130      6130      6130
5940      5940      5940      5940
6090      6090      6090      6090
6130      6130      6130      6130
6150      6150      6150      6150
6080      6080      6080      6080
6070      6070      6070      6070
6060      6060      6060      6060
6060      6060      6060      6060
6130      6130      6130      6130
6070      6070      6070      6070
6070      6070      6070      6070
6070      6070      6070      6070
6060      6060      6060      6060
5930      5930      5930      5930
6070      6070      6070      6070
6120      6120      6120      6120
6100      6100      6100      6100
6060      6060      6060      6060
6080      6080      6080      6080
6060      6060      6060      6060
6100      6100      6100      6100

routine  

repeat
  
sub routine 
    begin
     depth 
    while
     3 servo 2 servo 1 servo 0 servo
     1200 delay
    repeat

……
(The previous subroutine repeats 13 more times with various movement patterns)
……

(The script then finishes with the line below directing it to return to the beginning)

goto perpetualmotion

quit

As a reminder, this 7 min long code works fine typically. After several hours of running, it is then that the error appears. Thank you for your help.
Final Code.txt (11.1 KB)

For additional information. I have the servos opperating with a proper power supply. Runs at 5V and pulls max current of about 3.6 amps. My power supply ranges voltage from 0-60V and current from 0-5A.

I now realize I had a ton of fluff in my subroutines. This is a simplified version of my code which sticks to using 2 subroutines. I’ll update if this fixes my problems.

# Pololu Scripting Code

2 0 speed
2 1 speed
2 2 speed
2 3 speed

6000	6000	6000	6000
resetcycle	

sub resetcycle 
    begin
     depth 
    while
     3 servo 2 servo 1 servo 0 servo
     3000 delay
    repeat
 
6080	6080	6080	6080
6070	6070	6070	6070
5950	5950	5950	5950
6080	6080	6080	6080
6080	6080	6080	6080
6100	6100	6100	6100
6060	6060	6060	6060
6100	6100	6100	6100
6060	6060	6060	6060
6130	6130	6130	6130
5940	5940	5940	5940
6090	6090	6090	6090
6130	6130	6130	6130
6150	6150	6150	6150
6080	6080	6080	6080
6070	6070	6070	6070
6060	6060	6060	6060
6060	6060	6060	6060
6130	6130	6130	6130
6070	6070	6070	6070
6070	6070	6070	6070
6070	6070	6070	6070
6060	6060	6060	6060
5930	5930	5930	5930
6070	6070	6070	6070
6120	6120	6120	6120
6100	6100	6100	6100
6060	6060	6060	6060
6080	6080	6080	6080
6060	6060	6060	6060
6100	6100	6100	6100

movementenvelope

6050	6050	6050	6050
6110	6110	6110	6110
6120	6120	6120	6120
6080	6080	6080	6080
6050	6050	6050	6050
6070	6070	6070	6070
6070	6070	6070	6070
6100	6100	6100	6100
6090	6090	6090	6090
6100	6100	6100	6100
6100	6100	6100	6100
6050	6050	6050	6050
6060	6060	6060	6060
6070	6070	6070	6070
6060	6060	6060	6060
6050	6050	6050	6050
6060	6060	6060	6060
6070	6070	6070	6070
5930	5930	5930	5930
6070	6070	6070	6070
6110	6110	6110	6110
6070	6070	6070	6070
6070	6070	6070	6070
6090	6090	6090	6090
6080	6080	6080	6080
6110	6110	6110	6110
5940	5940	5940	5940
5920	5920	5920	5920
6060	6060	6060	6060
6090	6090	6090	6090
6050	6050	6050	6050

movementenvelope

5930	5930	5930	5930
6060	6060	6060	6060
6070	6070	6070	6070
5920	5920	5920	5920
5950	5950	5950	5950
6080	6080	6080	6080
6110	6110	6110	6110
6160	6160	6160	6160
6090	6090	6090	6090
6070	6070	6070	6070
6110	6110	6110	6110
5920	5920	5920	5920
6050	6050	6050	6050
6080	6080	6080	6080
6090	6090	6090	6090
6090	6090	6090	6090
6050	6050	6050	6050
5880	5880	5880	5880
5910	5910	5910	5910
5950	5950	5950	5950
6080	6080	6080	6080
6080	6080	6080	6080
5940	5940	5940	5940
5920	5920	5920	5920
6080	6080	6080	6080
5860	5860	5860	5860
5910	5910	5910	5910
5960	5960	5960	5960
6080	6080	6080	6080
6070	6070	6070	6070
6100	6100	6100	6100

movementenvelope

6120	6120	6120	6120
6080	6080	6080	6080
6110	6110	6110	6110
5940	5940	5940	5940
5890	5890	5890	5890
5950	5950	5950	5950
6060	6060	6060	6060
6080	6080	6080	6080
6090	6090	6090	6090
6070	6070	6070	6070
6110	6110	6110	6110
6060	6060	6060	6060
6080	6080	6080	6080
5960	5960	5960	5960
6060	6060	6060	6060
6050	6050	6050	6050
6060	6060	6060	6060
6080	6080	6080	6080
6080	6080	6080	6080
6070	6070	6070	6070
5940	5940	5940	5940
6060	6060	6060	6060
6050	6050	6050	6050
6080	6080	6080	6080
6060	6060	6060	6060
5900	5900	5900	5900
5800	5800	5800	5800
5950	5950	5950	5950
5950	5950	5950	5950
6090	6090	6090	6090
6100	6100	6100	6100

movementenvelope

6060	6060	6060	6060
6070	6070	6070	6070
6070	6070	6070	6070
6070	6070	6070	6070
6060	6060	6060	6060
6090	6090	6090	6090
6070	6070	6070	6070
6060	6060	6060	6060
5930	5930	5930	5930
5930	5930	5930	5930
5950	5950	5950	5950
6070	6070	6070	6070
6090	6090	6090	6090
6050	6050	6050	6050
5930	5930	5930	5930
5940	5940	5940	5940
5960	5960	5960	5960
6050	6050	6050	6050
6060	6060	6060	6060
6080	6080	6080	6080
6070	6070	6070	6070
6090	6090	6090	6090
6070	6070	6070	6070
6050	6050	6050	6050
6070	6070	6070	6070
6090	6090	6090	6090
6050	6050	6050	6050
6100	6100	6100	6100
6080	6080	6080	6080
6060	6060	6060	6060
6070	6070	6070	6070

movementenvelope

6100	6100	6100	6100
6120	6120	6120	6120
6110	6110	6110	6110
6100	6100	6100	6100
6050	6050	6050	6050
6050	6050	6050	6050
6060	6060	6060	6060
6080	6080	6080	6080
6080	6080	6080	6080
6090	6090	6090	6090
6110	6110	6110	6110
6100	6100	6100	6100
6090	6090	6090	6090
6080	6080	6080	6080
6060	6060	6060	6060
6070	6070	6070	6070
6060	6060	6060	6060
6090	6090	6090	6090
6060	6060	6060	6060
6050	6050	6050	6050
6080	6080	6080	6080
6050	6050	6050	6050
6070	6070	6070	6070
6090	6090	6090	6090
6060	6060	6060	6060
6070	6070	6070	6070
6110	6110	6110	6110
6070	6070	6070	6070
6090	6090	6090	6090
6050	6050	6050	6050
6060	6060	6060	6060

movementenvelope

6070	6070	6070	6070
6080	6080	6080	6080
6050	6050	6050	6050
6070	6070	6070	6070
6090	6090	6090	6090
6050	6050	6050	6050
6110	6110	6110	6110
6110	6110	6110	6110
6050	6050	6050	6050
6080	6080	6080	6080
6070	6070	6070	6070
6130	6130	6130	6130
6130	6130	6130	6130
6100	6100	6100	6100
6070	6070	6070	6070
5900	5900	5900	5900
6070	6070	6070	6070
6060	6060	6060	6060
6080	6080	6080	6080
6120	6120	6120	6120
6050	6050	6050	6050
6050	6050	6050	6050
6060	6060	6060	6060
6070	6070	6070	6070
6060	6060	6060	6060
6050	6050	6050	6050
6110	6110	6110	6110
6080	6080	6080	6080
6100	6100	6100	6100
6050	6050	6050	6050
6050	6050	6050	6050

movementenvelope

6090	6090	6090	6090
6110	6110	6110	6110
6080	6080	6080	6080
6070	6070	6070	6070
6050	6050	6050	6050
6050	6050	6050	6050
6070	6070	6070	6070
6080	6080	6080	6080
6060	6060	6060	6060
6080	6080	6080	6080
6060	6060	6060	6060
6060	6060	6060	6060
6100	6100	6100	6100
5920	5920	5920	5920
6060	6060	6060	6060
6080	6080	6080	6080
6050	6050	6050	6050
6130	6130	6130	6130
6120	6120	6120	6120
6090	6090	6090	6090
5950	5950	5950	5950
6080	6080	6080	6080
6090	6090	6090	6090
6070	6070	6070	6070
6080	6080	6080	6080
6060	6060	6060	6060
6090	6090	6090	6090
6090	6090	6090	6090
6110	6110	6110	6110
6060	6060	6060	6060
6070	6070	6070	6070

movementenvelope

6050	6050	6050	6050
6070	6070	6070	6070
6100	6100	6100	6100
6070	6070	6070	6070
6060	6060	6060	6060
6060	6060	6060	6060
6090	6090	6090	6090
6080	6080	6080	6080
6080	6080	6080	6080
5930	5930	5930	5930
6080	6080	6080	6080
6080	6080	6080	6080
6080	6080	6080	6080
6060	6060	6060	6060
6060	6060	6060	6060
6080	6080	6080	6080
6070	6070	6070	6070
6060	6060	6060	6060
6050	6050	6050	6050
6070	6070	6070	6070
6050	6050	6050	6050
6050	6050	6050	6050
6070	6070	6070	6070
6090	6090	6090	6090
6050	6050	6050	6050
6050	6050	6050	6050
6050	6050	6050	6050
6060	6060	6060	6060
6070	6070	6070	6070
6080	6080	6080	6080
6050	6050	6050	6050

movementenvelope

6070	6070	6070	6070
6100	6100	6100	6100
5940	5940	5940	5940
5920	5920	5920	5920
6090	6090	6090	6090
6080	6080	6080	6080
6100	6100	6100	6100
6070	6070	6070	6070
5920	5920	5920	5920
6060	6060	6060	6060
5940	5940	5940	5940
6060	6060	6060	6060
5930	5930	5930	5930
6060	6060	6060	6060
6080	6080	6080	6080
5890	5890	5890	5890
5800	5800	5800	5800
6100	6100	6100	6100
6090	6090	6090	6090
6100	6100	6100	6100
6070	6070	6070	6070
6120	6120	6120	6120
5940	5940	5940	5940
6100	6100	6100	6100
6140	6140	6140	6140
5950	5950	5950	5950
6100	6100	6100	6100
6050	6050	6050	6050
5950	5950	5950	5950
5930	5930	5930	5930
5930	5930	5930	5930

movementenvelope

6080	6080	6080	6080
6050	6050	6050	6050
6070	6070	6070	6070
6100	6100	6100	6100
5950	5950	5950	5950
6090	6090	6090	6090
5910	5910	5910	5910
5940	5940	5940	5940
5880	5880	5880	5880
6050	6050	6050	6050
5940	5940	5940	5940
5920	5920	5920	5920
5870	5870	5870	5870
5880	5880	5880	5880
5930	5930	5930	5930
5940	5940	5940	5940
5920	5920	5920	5920
5900	5900	5900	5900
5940	5940	5940	5940
5920	5920	5920	5920
5900	5900	5900	5900
5920	5920	5920	5920
5940	5940	5940	5940
5930	5930	5930	5930
6070	6070	6070	6070
5940	5940	5940	5940
5900	5900	5900	5900
5870	5870	5870	5870
5940	5940	5940	5940
6100	6100	6100	6100
6140	6140	6140	6140

movementenvelope

5870	5870	5870	5870
5930	5930	5930	5930
5920	5920	5920	5920
6130	6130	6130	6130
6060	6060	6060	6060
5880	5880	5880	5880
5890	5890	5890	5890
5840	5840	5840	5840
6070	6070	6070	6070
5910	5910	5910	5910
5950	5950	5950	5950
6080	6080	6080	6080
5930	5930	5930	5930
5930	5930	5930	5930
5900	5900	5900	5900
6070	6070	6070	6070
5890	5890	5890	5890
6100	6100	6100	6100
5880	5880	5880	5880
5880	5880	5880	5880
5930	5930	5930	5930
6170	6170	6170	6170
5950	5950	5950	5950
5950	5950	5950	5950
5860	5860	5860	5860
5900	5900	5900	5900
5900	5900	5900	5900
5940	5940	5940	5940
5930	5930	5930	5930
5900	5900	5900	5900
5930	5930	5930	5930

movementenvelope

5910	5910	5910	5910
5930	5930	5930	5930
5940	5940	5940	5940
5960	5960	5960	5960
5860	5860	5860	5860
5890	5890	5890	5890
5920	5920	5920	5920
5890	5890	5890	5890
5900	5900	5900	5900
6070	6070	6070	6070
6220	6220	6220	6220
6060	6060	6060	6060
5940	5940	5940	5940
5950	5950	5950	5950
5820	5820	5820	5820
6090	6090	6090	6090
6050	6050	6050	6050
5950	5950	5950	5950
5890	5890	5890	5890
5920	5920	5920	5920
5910	5910	5910	5910
6080	6080	6080	6080
6080	6080	6080	6080
5920	5920	5920	5920
5870	5870	5870	5870
5950	5950	5950	5950
6150	6150	6150	6150
5850	5850	5850	5850
6080	6080	6080	6080
5910	5910	5910	5910
5920	5920	5920	5920

movementenvelope

5860	5860	5860	5860
5920	5920	5920	5920
5880	5880	5880	5880
6190	6190	6190	6190
5920	5920	5920	5920
5950	5950	5950	5950
5930	5930	5930	5930
6060	6060	6060	6060
6060	6060	6060	6060
6050	6050	6050	6050
5930	5930	5930	5930
5940	5940	5940	5940
5940	5940	5940	5940
5910	5910	5910	5910
5900	5900	5900	5900
5890	5890	5890	5890
6050	6050	6050	6050
6130	6130	6130	6130
6090	6090	6090	6090
6070	6070	6070	6070
6060	6060	6060	6060
5920	5920	5920	5920
6110	6110	6110	6110
6060	6060	6060	6060
6110	6110	6110	6110

movementenvelope

sub movementenvelope
    begin
     depth 
    while
     3 servo 2 servo 1 servo 0 servo
     1200 delay
	 repeat
return

Hello.

Your script is causing a “Script call stack error”, which is described in the “Errors” section of the Maestro User’s Guide. To help explain why your script is causing a call stack error, I removed all the code from it that has no effect on the call stack. The remaining code just consists of subroutine calls, subroutine definitions, and return statements:

resetcycle   

sub resetcycle

movementenvelope
movementenvelope
movementenvelope
movementenvelope
movementenvelope
movementenvelope
movementenvelope
movementenvelope
movementenvelope
movementenvelope
movementenvelope
movementenvelope
movementenvelope
movementenvelope

sub movementenvelope
return

After you call resetcycle the first time, your code is allowing the execution of the script to fall through and start executing the code in the resetcycle subroutine again, even though you didn’t call it. When resetcycle starts executing the second time, the call stack will be empty. As a result, when the end of the resetcycle subroutine is reached for the second time, there is nothing to return to and the RETURN command should cause a call stack underflow.

A general rule you can use to avoid these problems would be to never allow control to fall through into a subroutine. The code immediately before a subroutine definition should be a QUIT command, a RETURN command, or an infinite loop.

I am not sure exactly what you want your program to do, but you might try fixing it to have this structure, which will call a series of subroutines in an infinite loop:

begin
  resetcycle
  movementenvelope
  movementenvelope
  movementenvelope
repeat

sub resetcycle
  # code for resetcycle
  return

sub movementenvelope
  # code for movementenvelope
  return

You can monitor your usage of the call stack by looking in the upper right corner of the Script tab in the Maestro Control Center as the program runs, where it will show you the number of levels of the call stack you are using and the maximum number you can use.

–David

Thank you for the advice David. I’ll let you know if the problem persists after making these changes. I went ahead and removed the “resetcycles” subroutine from code and adpated its function to work with my “movementenvelope” subrountine. Now the code looks like this:

# Pololu Scripting Code

2 0 speed
2 1 speed
2 2 speed
2 3 speed

begin
6000	6000	6000	6000
6000	6000	6000	6000
6000	6000	6000	6000
movementenvelope

6080	6080	6080	6080
6070	6070	6070	6070
5950	5950	5950	5950
6080	6080	6080	6080
6080	6080	6080	6080
6100	6100	6100	6100
6060	6060	6060	6060
6100	6100	6100	6100
6060	6060	6060	6060
6130	6130	6130	6130
5940	5940	5940	5940
6090	6090	6090	6090
6130	6130	6130	6130
6150	6150	6150	6150
6080	6080	6080	6080
6070	6070	6070	6070
6060	6060	6060	6060
6060	6060	6060	6060
6130	6130	6130	6130
6070	6070	6070	6070
6070	6070	6070	6070
6070	6070	6070	6070
6060	6060	6060	6060
5930	5930	5930	5930
6070	6070	6070	6070
6120	6120	6120	6120
6100	6100	6100	6100
6060	6060	6060	6060
6080	6080	6080	6080
6060	6060	6060	6060
6100	6100	6100	6100

movementenvelope

6050	6050	6050	6050
6110	6110	6110	6110
6120	6120	6120	6120
6080	6080	6080	6080
6050	6050	6050	6050
6070	6070	6070	6070
6070	6070	6070	6070
6100	6100	6100	6100
6090	6090	6090	6090
6100	6100	6100	6100
6100	6100	6100	6100
6050	6050	6050	6050
6060	6060	6060	6060
6070	6070	6070	6070
6060	6060	6060	6060
6050	6050	6050	6050
6060	6060	6060	6060
6070	6070	6070	6070
5930	5930	5930	5930
6070	6070	6070	6070
6110	6110	6110	6110
6070	6070	6070	6070
6070	6070	6070	6070
6090	6090	6090	6090
6080	6080	6080	6080
6110	6110	6110	6110
5940	5940	5940	5940
5920	5920	5920	5920
6060	6060	6060	6060
6090	6090	6090	6090
6050	6050	6050	6050

movementenvelope

5930	5930	5930	5930
6060	6060	6060	6060
6070	6070	6070	6070
5920	5920	5920	5920
5950	5950	5950	5950
6080	6080	6080	6080
6110	6110	6110	6110
6160	6160	6160	6160
6090	6090	6090	6090
6070	6070	6070	6070
6110	6110	6110	6110
5920	5920	5920	5920
6050	6050	6050	6050
6080	6080	6080	6080
6090	6090	6090	6090
6090	6090	6090	6090
6050	6050	6050	6050
5880	5880	5880	5880
5910	5910	5910	5910
5950	5950	5950	5950
6080	6080	6080	6080
6080	6080	6080	6080
5940	5940	5940	5940
5920	5920	5920	5920
6080	6080	6080	6080
5860	5860	5860	5860
5910	5910	5910	5910
5960	5960	5960	5960
6080	6080	6080	6080
6070	6070	6070	6070
6100	6100	6100	6100

movementenvelope

6120	6120	6120	6120
6080	6080	6080	6080
6110	6110	6110	6110
5940	5940	5940	5940
5890	5890	5890	5890
5950	5950	5950	5950
6060	6060	6060	6060
6080	6080	6080	6080
6090	6090	6090	6090
6070	6070	6070	6070
6110	6110	6110	6110
6060	6060	6060	6060
6080	6080	6080	6080
5960	5960	5960	5960
6060	6060	6060	6060
6050	6050	6050	6050
6060	6060	6060	6060
6080	6080	6080	6080
6080	6080	6080	6080
6070	6070	6070	6070
5940	5940	5940	5940
6060	6060	6060	6060
6050	6050	6050	6050
6080	6080	6080	6080
6060	6060	6060	6060
5900	5900	5900	5900
5800	5800	5800	5800
5950	5950	5950	5950
5950	5950	5950	5950
6090	6090	6090	6090
6100	6100	6100	6100

movementenvelope

6060	6060	6060	6060
6070	6070	6070	6070
6070	6070	6070	6070
6070	6070	6070	6070
6060	6060	6060	6060
6090	6090	6090	6090
6070	6070	6070	6070
6060	6060	6060	6060
5930	5930	5930	5930
5930	5930	5930	5930
5950	5950	5950	5950
6070	6070	6070	6070
6090	6090	6090	6090
6050	6050	6050	6050
5930	5930	5930	5930
5940	5940	5940	5940
5960	5960	5960	5960
6050	6050	6050	6050
6060	6060	6060	6060
6080	6080	6080	6080
6070	6070	6070	6070
6090	6090	6090	6090
6070	6070	6070	6070
6050	6050	6050	6050
6070	6070	6070	6070
6090	6090	6090	6090
6050	6050	6050	6050
6100	6100	6100	6100
6080	6080	6080	6080
6060	6060	6060	6060
6070	6070	6070	6070

movementenvelope

6100	6100	6100	6100
6120	6120	6120	6120
6110	6110	6110	6110
6100	6100	6100	6100
6050	6050	6050	6050
6050	6050	6050	6050
6060	6060	6060	6060
6080	6080	6080	6080
6080	6080	6080	6080
6090	6090	6090	6090
6110	6110	6110	6110
6100	6100	6100	6100
6090	6090	6090	6090
6080	6080	6080	6080
6060	6060	6060	6060
6070	6070	6070	6070
6060	6060	6060	6060
6090	6090	6090	6090
6060	6060	6060	6060
6050	6050	6050	6050
6080	6080	6080	6080
6050	6050	6050	6050
6070	6070	6070	6070
6090	6090	6090	6090
6060	6060	6060	6060
6070	6070	6070	6070
6110	6110	6110	6110
6070	6070	6070	6070
6090	6090	6090	6090
6050	6050	6050	6050
6060	6060	6060	6060

movementenvelope

6070	6070	6070	6070
6080	6080	6080	6080
6050	6050	6050	6050
6070	6070	6070	6070
6090	6090	6090	6090
6050	6050	6050	6050
6110	6110	6110	6110
6110	6110	6110	6110
6050	6050	6050	6050
6080	6080	6080	6080
6070	6070	6070	6070
6130	6130	6130	6130
6130	6130	6130	6130
6100	6100	6100	6100
6070	6070	6070	6070
5900	5900	5900	5900
6070	6070	6070	6070
6060	6060	6060	6060
6080	6080	6080	6080
6120	6120	6120	6120
6050	6050	6050	6050
6050	6050	6050	6050
6060	6060	6060	6060
6070	6070	6070	6070
6060	6060	6060	6060
6050	6050	6050	6050
6110	6110	6110	6110
6080	6080	6080	6080
6100	6100	6100	6100
6050	6050	6050	6050
6050	6050	6050	6050

movementenvelope

6090	6090	6090	6090
6110	6110	6110	6110
6080	6080	6080	6080
6070	6070	6070	6070
6050	6050	6050	6050
6050	6050	6050	6050
6070	6070	6070	6070
6080	6080	6080	6080
6060	6060	6060	6060
6080	6080	6080	6080
6060	6060	6060	6060
6060	6060	6060	6060
6100	6100	6100	6100
5920	5920	5920	5920
6060	6060	6060	6060
6080	6080	6080	6080
6050	6050	6050	6050
6130	6130	6130	6130
6120	6120	6120	6120
6090	6090	6090	6090
5950	5950	5950	5950
6080	6080	6080	6080
6090	6090	6090	6090
6070	6070	6070	6070
6080	6080	6080	6080
6060	6060	6060	6060
6090	6090	6090	6090
6090	6090	6090	6090
6110	6110	6110	6110
6060	6060	6060	6060
6070	6070	6070	6070

movementenvelope

6050	6050	6050	6050
6070	6070	6070	6070
6100	6100	6100	6100
6070	6070	6070	6070
6060	6060	6060	6060
6060	6060	6060	6060
6090	6090	6090	6090
6080	6080	6080	6080
6080	6080	6080	6080
5930	5930	5930	5930
6080	6080	6080	6080
6080	6080	6080	6080
6080	6080	6080	6080
6060	6060	6060	6060
6060	6060	6060	6060
6080	6080	6080	6080
6070	6070	6070	6070
6060	6060	6060	6060
6050	6050	6050	6050
6070	6070	6070	6070
6050	6050	6050	6050
6050	6050	6050	6050
6070	6070	6070	6070
6090	6090	6090	6090
6050	6050	6050	6050
6050	6050	6050	6050
6050	6050	6050	6050
6060	6060	6060	6060
6070	6070	6070	6070
6080	6080	6080	6080
6050	6050	6050	6050

movementenvelope

6070	6070	6070	6070
6100	6100	6100	6100
5940	5940	5940	5940
5920	5920	5920	5920
6090	6090	6090	6090
6080	6080	6080	6080
6100	6100	6100	6100
6070	6070	6070	6070
5920	5920	5920	5920
6060	6060	6060	6060
5940	5940	5940	5940
6060	6060	6060	6060
5930	5930	5930	5930
6060	6060	6060	6060
6080	6080	6080	6080
5890	5890	5890	5890
5800	5800	5800	5800
6100	6100	6100	6100
6090	6090	6090	6090
6100	6100	6100	6100
6070	6070	6070	6070
6120	6120	6120	6120
5940	5940	5940	5940
6100	6100	6100	6100
6140	6140	6140	6140
5950	5950	5950	5950
6100	6100	6100	6100
6050	6050	6050	6050
5950	5950	5950	5950
5930	5930	5930	5930
5930	5930	5930	5930

movementenvelope

6080	6080	6080	6080
6050	6050	6050	6050
6070	6070	6070	6070
6100	6100	6100	6100
5950	5950	5950	5950
6090	6090	6090	6090
5910	5910	5910	5910
5940	5940	5940	5940
5880	5880	5880	5880
6050	6050	6050	6050
5940	5940	5940	5940
5920	5920	5920	5920
5870	5870	5870	5870
5880	5880	5880	5880
5930	5930	5930	5930
5940	5940	5940	5940
5920	5920	5920	5920
5900	5900	5900	5900
5940	5940	5940	5940
5920	5920	5920	5920
5900	5900	5900	5900
5920	5920	5920	5920
5940	5940	5940	5940
5930	5930	5930	5930
6070	6070	6070	6070
5940	5940	5940	5940
5900	5900	5900	5900
5870	5870	5870	5870
5940	5940	5940	5940
6100	6100	6100	6100
6140	6140	6140	6140

movementenvelope

5870	5870	5870	5870
5930	5930	5930	5930
5920	5920	5920	5920
6130	6130	6130	6130
6060	6060	6060	6060
5880	5880	5880	5880
5890	5890	5890	5890
5840	5840	5840	5840
6070	6070	6070	6070
5910	5910	5910	5910
5950	5950	5950	5950
6080	6080	6080	6080
5930	5930	5930	5930
5930	5930	5930	5930
5900	5900	5900	5900
6070	6070	6070	6070
5890	5890	5890	5890
6100	6100	6100	6100
5880	5880	5880	5880
5880	5880	5880	5880
5930	5930	5930	5930
6170	6170	6170	6170
5950	5950	5950	5950
5950	5950	5950	5950
5860	5860	5860	5860
5900	5900	5900	5900
5900	5900	5900	5900
5940	5940	5940	5940
5930	5930	5930	5930
5900	5900	5900	5900
5930	5930	5930	5930

movementenvelope

5910	5910	5910	5910
5930	5930	5930	5930
5940	5940	5940	5940
5960	5960	5960	5960
5860	5860	5860	5860
5890	5890	5890	5890
5920	5920	5920	5920
5890	5890	5890	5890
5900	5900	5900	5900
6070	6070	6070	6070
6220	6220	6220	6220
6060	6060	6060	6060
5940	5940	5940	5940
5950	5950	5950	5950
5820	5820	5820	5820
6090	6090	6090	6090
6050	6050	6050	6050
5950	5950	5950	5950
5890	5890	5890	5890
5920	5920	5920	5920
5910	5910	5910	5910
6080	6080	6080	6080
6080	6080	6080	6080
5920	5920	5920	5920
5870	5870	5870	5870
5950	5950	5950	5950
6150	6150	6150	6150
5850	5850	5850	5850
6080	6080	6080	6080
5910	5910	5910	5910
5920	5920	5920	5920

movementenvelope

5860	5860	5860	5860
5920	5920	5920	5920
5880	5880	5880	5880
6190	6190	6190	6190
5920	5920	5920	5920
5950	5950	5950	5950
5930	5930	5930	5930
6060	6060	6060	6060
6060	6060	6060	6060
6050	6050	6050	6050
5930	5930	5930	5930
5940	5940	5940	5940
5940	5940	5940	5940
5910	5910	5910	5910
5900	5900	5900	5900
5890	5890	5890	5890
6050	6050	6050	6050
6130	6130	6130	6130
6090	6090	6090	6090
6070	6070	6070	6070
6060	6060	6060	6060
5920	5920	5920	5920
6110	6110	6110	6110
6060	6060	6060	6060
6110	6110	6110	6110

movementenvelope

repeat

sub movementenvelope
    begin
     depth 
    while
     3 servo 2 servo 1 servo 0 servo
     1200 delay
	 repeat
return

That fixed the problem. Thank you very much David.