Actuation Tutorial Python Scripts

The actuation_tutorial folder of the Python examples includes a few command-line Python programs used by the tutorials.

servo_sequence_demo.py

This script can perform a repeated sequence of moves on a set of servos connected via a Mini-Maestro Servo Interface board.

This script is run from the command line (e.g. Terminal.app). To see the available options:

$ /opt/local/bin/python2.7 servo_sequence_demo.py --help

A typical invocation from the command line on an IDeATe cluster MBP will look similar to this:

$ /opt/local/bin/python2.7 servo_sequence_demo.py --debug --list --servos 6 --maestro /dev/tty.usbmodem00146911
actuation_tutorial.servo_sequence_demo.animation_sequence(servos, numservos, step, logger)[source]

Produce an animation motion sequence on a set of servos by issuing motion commands to the servo interface and performing delays using ase.events.sleep(). This is a good starting point for customizing the script.

Parameters:
  • servos – handle to the Mini Maestro transport object
  • numservos – number of servos to assume are connected
  • step – flag to indicate frame-by-frame stepping
  • logger – logging object for debugging and status output
actuation_tutorial.servo_sequence_demo.main(argv)[source]

Main program entry point.

Parameters:argv – list of command line arguments as individual strings

stepper_sequence_demo.py

This script can perform a repeated sequence of moves on up to three stepper motors connected via an Arduino with a CNC Arduino Shield running the DFMocoCNC Arduino firmware for Dragonframe ARC Motion.

This is the same protocol used by Dragonframe; the script acts in the same role as Dragonframe to issue motion commands.

This script is run from the command line (e.g. Terminal.app). To see the available options:

$ /opt/local/bin/python2.7 stepper_sequence_demo.py --help

A typical invocation from the command line on an IDeATe cluster MBP will look similar to this:

$ /opt/local/bin/python2.7 stepper_sequence_demo.py --debug --list --motors 3 --arduino /dev/tty.usbmodem00146911
actuation_tutorial.stepper_sequence_demo.animation_sequence(steppers, nummotors, logger)[source]

Produce an animation motion sequence on a set of stepper motor by issuing motion commands to the stepper interface and performing delays using ase.events.sleep(). This is a good starting point for customizing the script.

Parameters:
  • steppers – handle to the DFMocoCNC interface object
  • nummotors – number of motors to assume are connected
  • logger – logging object for debugging and status output
actuation_tutorial.stepper_sequence_demo.main(argv)[source]

Main program entry point.

Parameters:argv – list of command line arguments as individual strings