Specific Script causes Servo to keep driving in single direction until power is cut. Reproducable

Hello,

I’m using the Pololu Maestro 12 and triggering scripts over UART via a Teensy using the Pololu Arduino lib.

I have 5 Servos connected (0-4) with various manufacturers.

It generally works well but one of the sequences about 60% of the times causes one of the servos to act strange. Specifically, around 25% into the sequence one of the servos just starts driving round and round continuously. It has also happened on two different channels (servo 1 and servo 3).

Once the servo in this state, the servo doesn’t stop driving at full speed until the power is cut. During this error state, the status windows shows the servo target sitting at 2000, breifly flicking away but moving straight back to 2000 (as the sequence I assume is trying to move it). The sequence is not trying to target 2000 during this time.

I can also reproduce this consistantly from the sequence window by using ‘play sequence’. (speech4SingerSeq). Watching the sequence flow dosnt seem to indicate a regular specific place in the sequence that triggers the behaviour.

Once the power resumes the servo seeks to its default position and appears to behave normaly, i.e driving normally via status window and behaving normally when used within other sequences.

I’ve swapped out the servo twice (with different manufacturers) and still see the same behaviour.

I have many sequences (not included here) and can run any number of them in any order but this specific sequence (‘speech4SingerSeq’) seems to roll a dice on this werid behaviour.

Has anyone seen this behavior before?

  • Not all sequences are copied here but I copied the relevant sequences and functions, and all generated frames to ensure I covered all relevant frames for the problem sequence.
  • Servo has a min range enabled
  • Servo is 0 speed and acceleration
  • I trigger script ‘skit1_sub4’ from the ardunio that then calls speech4SingerSeq
  • Note: I added a ‘playsound’ line into the middle of the sequence post generation (to time a command to the ardunio to play a sound). I do this with many other sequences and dont see this issue appearing in any other sequence. Also becuase I can reproduce this inside the sequence windows I dont belive the serial UART functions are cause.
  • I’m driving a few of the servos pretty fast during this sequence. (and many other sequences) e.g 75ms duration.
  • My sequence is a bit messy :stuck_out_tongue:
begin
  900 100
  led_on delay
  led_off delay
repeat

sub playSound	
  5 hardwareSerial
return
 
sub hardwareSerial #222 For sending commands to UART microcontroller.222 Start byte,command int,var int,255 end byte
  222 serial_send_byte serial_send_byte serial_send_byte
  255 serial_send_byte
  10 delay
return

sub skit1_sub4
4 2 hardwareSerial
speech4SingerSeq
QUIT

sub speech4SingerSeq
  350 7418 8000 7542 5846 5076 0 
  0 0 0 0 0 frame_0..10 # Frame 0
  350 7353 frame_2 # Frame 1
  350 8000 frame_0 # Frame 2
  400 7343 7021 frame_0_1 # Frame 3
  400 7910 frame_0 # Frame 4
  400 6821 7058 7696 frame_0..2 # Frame 5
  4 playSound							#<PLAYING SOUND HERE
  200 8000 8000 7169 3968 3968 frame_0..4 # OH
  250 7753 7617 7602 5122 5103 frame_0..4 # WAIT
  75 8000 8000 7105 5100 frame_0..2_4 # Frame 8
  75 7721 frame_2 # Frame 9
  75 7105 frame_2 # Frame 8
  75 7721 5788 5637 frame_2..4 # Frame 9
  75 6042 3968 frame_3_4 # Frame 8
  75 3968 frame_3 # Frame 9
  250 7105 frame_2 # CHANCE
  250 7721 4261 6720 frame_2..4 # WAIT
  350 3968 5250 frame_3_4 # WAIT
  75 7105 5846 3968 frame_2..4 # I
  75 7721 3968 frame_2_3 # Frame 9
  100 7105 frame_2 # Frame 8
  100 7194 7194 7721 frame_0..2 # Frame 9
  75 7105 frame_2 # Frame 8
  75 7721 frame_2 # Frame 9
  100 6464 6464 7105 6238 5571 frame_0..4 # Frame 8
  100 7721 6236 frame_2_3 # Frame 9
  100 7105 frame_2 # Frame 8
  100 delay # Frame 9
  100 7105 3968 3968 frame_0_3_4 # Frame 8
  100 7104 7721 frame_0_2 # Frame 9
  75 7459 7105 frame_1_2 # Frame 8
  250 7459 7721 6121 5878 frame_0_2..4 # Frame 9
  250 8000 8000 6120 frame_0_1_3 # WAIT
  250 7130 3968 3968 frame_2..4 # BA
  250 7781 frame_2 # P
  250 7130 frame_2 # BA
  250 7781 frame_2 # P
  150 7130 frame_2 # BLA
  75 7781 frame_2 # CK
  150 7151 7151 7130 6179 5263 frame_0..4 # SHE
  400 8000 8000 7781 6580 frame_0..3 # P
  400 6180 4128 frame_3_4 # P
  75 7130 5250 frame_2_4 # HA
  75 7781 frame_2 # VE
  75 7130 5064 frame_2_3 # HA
  75 7781 frame_2 # VE
  75 7130 6023 frame_2_3 # HA
  75 7781 6020 frame_2_3 # VE
  75 7130 frame_2 # HA
  250 7781 3968 3968 frame_2..4 # VE
  250 6720 frame_4 # WAIT
  250 7130 5170 frame_2_4 # YES
  100 7726 frame_2 # P
  250 6881 6881 7130 frame_0..2 # YES
  100 7726 5709 frame_2_3 # P
  250 7130 5572 frame_2_3 # YES
  100 8000 8000 7726 6434 5490 frame_0..4 # P
  100 7130 5494 5170 frame_2..4 # YES
  250 7726 3968 3968 frame_2..4 # P
  150 delay # WAIT
  100 7130 frame_2 # YES
  100 7726 frame_2 # P
  100 7130 frame_2 # YES
  100 7726 frame_2 # P
  100 7130 frame_2 # YES
  100 7726 frame_2 # P
  100 7497 5156 frame_2_4 # end
  return

#Not all sequences are copied here but copied all frames to ensure I covered all relevant frames

sub frame_0..10
  10 servo
  9 servo
  8 servo
  7 servo
  6 servo
  5 servo
  4 servo
  3 servo
  2 servo
  1 servo
  0 servo
  delay
  return

sub frame_4
  4 servo
  delay
  return

sub frame_2_4
  4 servo
  2 servo
  delay
  return

sub frame_2
  2 servo
  delay
  return

sub frame_1
  1 servo
  delay
  return

sub frame_2_3
  3 servo
  2 servo
  delay
  return

sub frame_0..2
  2 servo
  1 servo
  0 servo
  delay
  return

sub frame_0_4
  4 servo
  0 servo
  delay
  return

sub frame_0_1
  1 servo
  0 servo
  delay
  return

sub frame_0_1_3_4
  4 servo
  3 servo
  1 servo
  0 servo
  delay
  return

sub frame_3_4
  4 servo
  3 servo
  delay
  return

sub frame_2..4
  4 servo
  3 servo
  2 servo
  delay
  return

sub frame_0..4
  4 servo
  3 servo
  2 servo
  1 servo
  0 servo
  delay
  return

sub frame_0_2..4
  4 servo
  3 servo
  2 servo
  0 servo
  delay
  return

sub frame_3
  3 servo
  delay
  return

sub frame_0_1_4
  4 servo
  1 servo
  0 servo
  delay
  return

sub frame_0
  0 servo
  delay
  return

sub frame_0..2_4
  4 servo
  2 servo
  1 servo
  0 servo
  delay
  return

sub frame_0_3_4
  4 servo
  3 servo
  0 servo
  delay
  return

sub frame_0_2
  2 servo
  0 servo
  delay
  return

sub frame_1_2
  2 servo
  1 servo
  delay
  return

sub frame_0_1_3
  3 servo
  1 servo
  0 servo
  delay
  return

sub frame_0..3
  3 servo
  2 servo
  1 servo
  0 servo
  delay
  return

Hello.

Could you clarify the following?

  1. You mentioned that it has happened on two different channels, 1 and 3. Does it randomly happen on one of those channels without any changes to your sequence? Does the behavior in the “Status” tab look the same for both channels when it is happening (i.e. staying on 2000μs aside from some brief flashes to different positions)?

  2. You mentioned that it only happens about 60% of the time, and that you can reproduce it consistently in the Sequencer. Does it happen 100% of the time when you run your sequence from the Sequencer? If so, is it always the same channel?

  3. Does it happen if you run the system with all of the servos disconnected except the one on the problematic channel?

  4. What servos are you using on each channel and what power supply are you using to power them?

  5. Could you post a copy of your Maestro settings file? You can save a copy of your settings file from the “File” drop-down menu of the Maestro Control Center software while the controller is connected.

Brandon

Thanks for the quick reply and the clear questions Brandon.

Settings File: gdrive link

  1. It’s happened on two channels, it appears to stick to channel 1 now. Previously it was happening on channel 3. This could be a false/noisey information but the only thing that stands out that I changed to cause this after I corrected the servo channel that I was setting the acceleration on an unrelated sub ‘byebye’.

  2. Apologies this wasnt clear. not 100% consistant in sequencer but It appears slightly more consistant (1 in 2 runs) with the sequencer (vs 1 in 3ish with a serial trigger). Most of the time it gets a clean first run in both cases but if keep pushing in the sequencer it can get to the point where it happens every time.

  3. Traveling all day today but will try this asap and report back

  4. 2 x Hiwonder 20KG (Channel 0 and 1) 180 deg, 1 X Savol SC-1258TG (channel 2), 2 x ‘DSServo’ (Channel 3 and 4, also previously Channel 1). Power supply: UNIROI DC bench power supply running at 6.25v, max 5.2A.

  5. Settings File: gdrive link

Have you had time to try it with just one servo connected?

From a brief internet search, it sounds like your servos can draw a combined current upwards of 11A (and that was without taking the DSServos into consideration since I couldn’t find any information on those). So, I suspect a spike of current might be causing the power supply voltage to briefly dip and putting your Hiwonder servo into a weird state.

However, I wouldn’t expect that to change the behavior of the Maestro. If I understood your description correctly, you were seeing a difference in how the channel 1 slider in the Maestro Control Center was behaving when the servo gets stuck in the bad state. I wasn’t able to reproduce your problem with the settings file you attached, but I did notice that when running the speech4SingerSeq sequence, the channel 1 slider is at 2000µs for most of the time (which seems to match how the sequence is configured). If it still happens when you only have 1 servo connected, could you post a video showing the servo’s behavior as well as the behavior you’re seeing from the “Status” tab of the Maestro Control Center?

Brandon