Fun with PWM  0.32
Documentation

Introduction

AllMyServos is a robotics app for Raspberry Pi, written in Python, to help it interface with:

  • Pi Camera
  • Adafruit PCA9685 16 Channel Servo Driver
  • Invensense MPU6050 Accelerometer and Gyro
  • Motor Drivers: L298N, TB6612FNG and BTS7960

The app provides a user friendly interface for configuration, a command line version for running over SSH and now supports headless operation. To get started, make sure the directory which contains this file is copied to the SD card of your Raspberry Pi, open a terminal, change to this directory and run 'sudo python GUI.py'

For more information visit:

Supported Models and Operating Systems

AllMyServos has been tested with:

  • Raspberry Pi Model B+
  • Raspberry Pi 2
  • Raspberry Pi 3
  • Raspberry Pi Zero

OS Versions:

  • Raspbian Wheezy
    • 2015-05-05
  • Raspbian Jessie
    • 2015-11-21
    • 2016-05-10
    • 2016-09-23
    • 2016-11-25
    • 2017-01-11

Installation

Open a terminal on a Raspberry Pi and run the following commands:

Step 1: Download the app

git clone https://github.com/allmyservos/allmyservos.git

Step 2: Change directory

cd allmyservos

Step 3: Start the app

sudo python GUI.py

The first time the application runs, it performs some initial setup checks. Any problems can be resolved by clicking the accept button at the bottom of the page.

Modules

Camera

The camera module provides a user interface for all of the available settings on the Pi camera. see: TkCameraManager.TkCameraManager

Camera Manager

Console

The console provides a copy of anything output to the terminal in the app. see: TkConsole.TkConsole

Console

Dependencies

Where parts of the app require packages to be installed, the app provides a user interface to install them all with a single click. see: TkDependencyManager.TkDependencyManager

Dependencies

Help

The help section provides information about using the app. see: TkHelpManager.TkHelpManager

Help

IMU

An Inertial Measuring Unit is a combined gyroscope and accelerometer. The app provides a suite of tools for managing and testing a connected IMU.

see:

IMU Features

Joystick

The joystick module provides a service which registers USB or Bluetooth joysticks / gamepads as they are connected. Other objects can add a callback function which will be executed when a joystick action happens. The configure page displays all detected joysticks and their axis / buttons maps. see: TkJoystickManager.TkJoystickManager

Joystick

Keyboard

The keyboard module provides a user interface for configuring keymaps. These are used to trigger motions or chains when keys are pressed. It also allows other modules to plugin and perform any action when a key is pressed. see: TkKeyboardManager.TkKeyboardManager

Keyboard

Metrics

Parts of the application require measurements to be taken. Metrics can be used like variables but they can retain previous values in memory and archive them according to the time the value was set. see: TkMetricManager.TkMetricManager

Metric Snapshot

Motions

When the servo configuration is complete, motions can be created which orchestrate the angles of the servos over time. see: TkMotionManager.TkMotionManager

Motions

DC Motors

The DC motor module provides support for several motor driver boards. Each motor reserves a set of GPIO pins on the Raspberry Pi for use with a drive board. Motors have a drive state which controls the speed and direction of the motor by setting a value between -1 and 1. The DC motor module is also integrated with the Keyboard and Joystick module. see: TkMotorManager.TkMotorManager

DC Motor

Stepper Motors

Stepper motors can also be connected to the Raspberry Pi using Dual H Bridge motor driver boards. These boards allow 4 input wires (from the Pi GPIO) and 4 output wires from a stepper motor to be connected. Sending a HIGH signal from a GPIO pin will cause the motor driver to energize a coil in the stepper motor with a particulary polarity. This turns the stepper motor to align with that coil. AllMyServos allows stepper motors to be configured by providing the steps per revolution and maximum revolutions per minute (normally available on the stepper motor datasheet). As with DC motors, AllMyServos allows the speed and direction of the motor to be changed by setting the drive state (-1 to 1). When editing a stepper motor, this can be done using a slider. The angle of the stepper motor is tracked by AllMyServos allowing the motor to turn to a given angle.

see: TkMotorManager.TkMotorManager

Stepper Motor

Notifier

The notifier allows modules to push messages to the interface which will be displayed for at least 10 seconds before being removed. see: TkNotifier.TkNotifier

Notifier

PreFlight

Pre flight checks are performed before any modules are loaded to ensure that the essential configuration changes have been made to enable I2C which is required to work with servos. see: TkPreFlightManager.TkPreFlightManager

Pre Flight

Resources

The resource manager provides a user interface for monitoring system resources. see: TkResourceManager.TkResourceManager

Resource Manager

Schedule

Threaded tasks can be run on their own schedule and managed using the provided user interface. see: TkScheduleManager.TkScheduleManager

Scheduled Tasks

Servos

Servos are a core feature of the application. These objects represent servos connected to the Adafruit PCA9685 servo driver. see: TkServoGrid.TkServoGrid

Servo Grid

Settings

The Setting object can be referred to anywhere a script imports it. Settings are accessed statically using Setting.get() and Setting.set('setting_name',default), the class uses SQLite to check if a value exists, if not the default value is saved. Use the menu: 'Settings' -> 'List Settings' to see any stored settings and modify their values. For example: 'motion_slow_factor' is an integer which controls how many times slower to play slow motions. Simply delete a setting to restore its default value. see: TkSettingManager.TkSettingManager

Settings

Specification

Specifications provide a way of keeping all of the information about a robot together. These can be packaged up in the application and shared as a single file. see: TkSpecificationManager.TkSpecificationManager

Specification

SRPC

One method of communicating with All My Servos is using Remote Procedure Calls. The app provides a server with built in SSL support and authentication to securely accept requests from RPC clients. see: TkRPCManager.TkRPCManager

SRPC

System

The system section of the app provides a user interface for checking information about the environment and managing the startup settings. see: TkSystemManager.TkSystemManager

Startup

TrayIcon

When either the GUI or CLI is run, the app will attempt to add a status icon to the LXDE taskbar if it is available. see: TrayIcon.TrayIcon

Tray Icon