'Get Moving State' Implementation

Are there any cases where ‘Get Moving State’ returns an incorrect state? I am trying to track down some bad behavior which appears to be related to ‘Set Target’/‘Get Moving State’ sequences. I am accessing the Micro Maestro at a high-level right now (windows, nodejs->usb serialport->maestro).

I am seeing ‘Get Moving State’ sometimes return false after a ‘Set Target’ (speed and acceleration are set nonzero), and it seems to specifically occur when a previous ‘Set Target’ is still active (the servo is still moving). I’ve tried up to 3 'Get Moving State’s and seen sporadic F/T/T, F/T/F, and T/T/F results. It doesn’t seem to be something like a delay or command ordering problem, since the servo should always be moving if the target is changed fast enough.

Should ‘Get Moving State’ always return true for a situation like this?

Hello.

I am sorry you are having trouble with the Micro Maestro. I checked the Maestro firmware and I found a bug that could make the Get Moving State serial command return 0 when it should return 1. This bug only affects the Micro Maestro’s TTL serial and virtual USB serial port interfaces. It does not affect the GET_MOVING_STATE command in the scripting language, and it does not affect the Mini Maestros. The bug is present in all past versions of the Micro Maestro firmware (1.00, 1.01, and 1.02).

As a workaround, I suggest loading the following script onto the Maestro using the Maestro Control Center:

sub wait_for_movement_to_end
  begin get_moving_state while repeat
  quit

You can then use the “Restart Script at Subroutine” serial command to start the script and use the “Get Script Status” command to see if the script is running. The script loops until the servos have stopped moving and then quits, so if you see that the script is still running then it means that the servos are still moving.

The Micro Maestro was released over 5 years ago and you are the first person to notice and report this problem! Thank you for bringing it to our attention. We plan to update the Maestro user’s guide to document this issue.

–David

Thanks for verifying. I think the proposed workaround will be OK. I will give it a try.