|The Errors tab in the Maestro Control Center.|
The Errors tab indicates problems that the Maestro has detected while running, either communications errors or errors generated by bugs in a script.
Each error corresponds to a bit in the two-byte error register. The red LED will be on as long as any of the bits in the error register are set to 1 (it can also be turned on by the led_on script command). The value of the error register is displayed in the upper right corner of the main window.
When an error occurs, the corresponding bit in the error register is set to 1 and the Maestro sends all of its servos and digital outputs to their home positions, as specified in the Settings tab (Section 4.e). Any servos or outputs that are configured to be in the “Ignore” mode will not be changed. The error register is cleared by the “Get Errors” serial command.
The errors and their corresponding bit numbers are listed below:
- Serial signal error (bit 0)
A hardware-level error that occurs when a byte’s stop bit is not detected at the expected place. This can occur if you are communicating at a baud rate that differs from the Maestro’s baud rate.
- Serial overrun error (bit 1)
A hardware-level error that occurs when the UART’s internal buffer fills up. This should not occur during normal operation.
- Serial buffer full (bit 2)
A firmware-level error that occurs when the firmware’s buffer for bytes received on the RX line is full and a byte from RX has been lost as a result. This error should not occur during normal operation.
- Serial CRC error (bit 3)
This error occurs when the Maestro is running in CRC-enabled mode and the cyclic redundancy check (CRC) byte at the end of the command packet does not match what the Maestro has computed as that packet’s CRC (Section 5.d). In such a case, the Maestro ignores the command packet and generates a CRC error.
- Serial protocol error (bit 4)
This error occurs when the Maestro receives an incorrectly formatted or nonsensical command packet. For example, if the command byte does not match a known command or an unfinished command packet is interrupted by another command packet, this error occurs.
- Serial timeout (bit 5)
When the serial timeout is enabled, this error occurs whenever the timeout period has elapsed without the Maestro receiving any valid serial commands. This timeout error can be used to make the servos return to their home positions in the event that serial communication between the Maestro and its controller is disrupted.
- Script stack error (bit 6)
This error occurs when a bug in the user script has caused the stack to overflow or underflow. Any script command that modifies the stack has the potential to cause this error. The stack depth is 32 on the Micro Maestro and 126 on the Mini Maestros.
- Script call stack error (bit 7)
This error occurs when a bug in the user script has caused the call stack to overflow or underflow. An overflow can occur if there are too many levels of nested subroutines, or a subroutine calls itself too many times. The call stack depth is 10 on the Micro Maestro and 126 on the Mini Maestros. An underflow can occur when there is a return without a corresponding subroutine call. An underflow will occur if you run a subroutine using the “Restart Script at Subroutine” serial command and the subroutine terminates with a return command rather than a quit command or an infinite loop.
- Script program counter error (bit 8)
This error occurs when a bug in the user script has caused the program counter (the address of the next instruction to be executed) to go out of bounds. This can happen if your program is not terminated by a quit, return, or infinite loop.
The errors tab also shows which performance flags have been set. This feature only applies to the Mini Maestro 12, 18, and 24. The performance flags indicate that the processor missed a deadline for performing a servo control task, and as a result the Maestro’s servo control got slowed down in some way. Performance flags should not occur during normal operation as long as your settings are within with the limitations described in Section 9.