Problem: Maestro won’t run sequence and returns error code 0x0100 when trying to trigger sequence from Raspberry Pi
I have a Mini Maestro 12 being used to control 6 servos to move eyes and eyelids on an animatronic head and also to switch on/off leds within the eyes.
I have programmed a single sequence using the Pololu Maestro Control centre on a windows PC.
The serial mode is set to “USB Dual Port”
This sequence can be saved to the Maestro and played without any errors.
See settings file maestro_settings.txt attached.
The Maestro needs to be triggered by a python script running on a Raspberry Pi 3.
The Raspberry Pi has been setup with the Maestro python code using instructions from https://github.com/FRC4564/Maestro.
I can communicate with the Maestro and move one of the servos using the following code on the Rasberry Pi without any errors or issues.
# testServo.py code in python
# Assumes the maestro python files are in a subdirectory call Maestro of /home/pi
import maestro
import time
# Initialize the Maestro controller
# Replace 'COM3' with your specific serial port (e.g., '/dev/ttyACM0' for Linux)
servo = maestro.Controller('/dev/ttyACM0')
# Set acceleration for servo 0 (optional, 0 for unrestricted)
servo.setAccel(2, 4)
# Set speed for servo 0 (optional, 0 for unrestricted)
servo.setSpeed(2, 10)
# Set target position for servo 0 (e.g., 6000 for center position)
# Target values are typically in quarter-microseconds (e.g., 4000 = 1ms, 8000 = 2ms)
servo.setTarget(2, 6000)
# Pause to allow the servo to move
time.sleep(1.5)
# Move to another position
servo.setTarget(2, 4000)
time.sleep(1.5)
# Close the connection to the Maestro
servo.close()
However if I run the following code to trigger the sequence(0) :
# test.py code in python
# Assumes the maestro python files are in a subdirectory call Maestro of /home/pi
import maestro
servo = maestro.Controller('/dev/ttyACM0')
# where (0) is the script number saved to the maestro board
servo.runScriptSub(0)
servo.close()
The red LED on the Maestro board lights up and the sequence stored on the board does not activate.
I can return the error code and clear the error using the attached getMaestroErrors.py file.
Which returns
Maestro Error Flags: 0x00100
Maestro Error cleared.
Which turns off the red LED on the Maestro board.
This was working in the past but after replacing some servos and reinstalling the OS and all the software on the Raspberry Pi, I can’t get it to work again.
When it worked previously the red LED on the Maestro board would appear but it still triggered the sequence and it moved the servos as expected.
I have also tried another new Mini Maestro 12 board and a new Raspberry Pi.
I am at a loss as to what I am doing wrong so any guidance would be appreciated.
Thank you.
John
files attached:
maestro_settings.txt
testServo.py
test.py
getMaestroErrors.py
getMaestroErrors.py (1.6 KB)
maestro_settings.txt (5.9 KB)
test.py (327 Bytes)
testServo.py (847 Bytes)
