Skip to main content

API for the mumobo device

Project description

README

PyPI

Installation

pip install mumobo

Help

        
    class MuMoBo(builtins.object)
     |  MuMoBo(host, port=80, timeout=20.0, verbose=False)
     |  
     |  Client for MuMoBo microcontroller communication via TCP socket.
     |  
     |  Methods defined here:
     |  
     |  Step_Mode(self, AXIS, SERVO_ID)
     |      Method: Step mode.
     |  
     |  __init__(self, host, port=80, timeout=20.0, verbose=False)
     |      Initialize the client 
     |      
     |      Parameters
     |      ==========
     |      host : str
     |          hostname or ip address of the mumobo
     |      port : int
     |          port on which the socket server is running
     |      timeout : float
     |          timeout for socket communication
     |      verbose : bool
     |          how talkative the API will be   
     |      
     |      ToDo
     |      ====
     |      Implement persistant socket connection with failsafe checking of connection. Currently
     |      each command opens and closes a socket.
     |  
     |  changeID(self, AXIS, SERVO_ID, NEW_ID)
     |      Change the motor ID
     |      
     |      Parameters
     |      ==========
     |      AXIS : int
     |          which axis to address
     |      SERVO_ID : int
     |          which servo to address
     |      NEW_ID : int
     |          new servo ID
     |  
     |  getID(self, AXIS)
     |      Method: Getid.
     |  
     |  move_motor_by(self, AXIS, SERVO_ID, STEPS)
     |      Move a motor.
     |      
     |      Parameters
     |      ==========
     |      AXIS : int
     |          which axis to address
     |      SERVO_ID : int
     |          which servo to address
     |      STEPS : int
     |          how many steps to turn
     |  
     |  move_motor_zero(self, AXIS, SERVO_ID)
     |      Method: Move motor by zero steps.
     |  
     |  ping_1(self, AXIS, SERVO_ID)
     |      Method: Ping 1.

Usage

The mumobo infrastructure allows to control a set of servos via a socket server running on a microcontroller. This python API facilitates the setup and communication with the servo motors. Currently, the microcontroller can operate two independent sets of motors, each of these sets are called an axis, where the intention is that each axis will operate two to three motors on one mirror mount. For each axis there is a patch cable jack available to route the communication from the mumobo to the mirror mount. At the site of the mirror mount, a small breakout board is used to hook up the servos.

How to take servos into operation

Servos are adressed by their unique ID. Before the communication with more than one servo over a shared line can be used they have to be given a unique address. Moreover, one typically wants to operate those servos in step mode, i.e., one wants to tell the servo motor to move by a given number of steps. To stage those motors for operation, the following procedure is foreseen

import mumobo
mmb=mumobo.MuMoBoClient()
# 1. Plug ONLY ONE motor at a time into the breakout board connected to AXIS=1 or 2.
# 2. Find servo-ID: 
mmb.getID(AXIS)
# 3. Change ID from old ID to new ID if the it already exists
mmb.changeID(AXIS, SERVO_ID, NEW_ID)
# 4. Check if the renaming worked 
mmb.ping_1(AXIS, SERVO_ID)
# 5. Switch the motor to Step-mode (this will. like the SERVO_ID be persistantly stored on the servo) 
mmb.Step_Mode(AXIS, SERVO_ID)

This step is to be repeated for all motors in use. After this, they can be adressed with their AXIS and newly assigned ID.

How to turn the servo

AXIS = 1 
Servo_ID = 1
step = 100 
# Number from -10000 (anticlockwise) to  10000 (clockwise). A step of 4096 corresponds to a 360° turn

mmb.move_moto_by_(AXIS, Servo_ID, step)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mumobo-0.0.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mumobo-0.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file mumobo-0.0.0.tar.gz.

File metadata

  • Download URL: mumobo-0.0.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for mumobo-0.0.0.tar.gz
Algorithm Hash digest
SHA256 8289dafe920d4ee62f3f073a4d413c4a55ca6aa4825e7c35ce6f088527e12e56
MD5 735b397c9be5e6f6b5e5394b578a1337
BLAKE2b-256 ebfab8d452d4fb13c3f618f7a23b0eac3d651c0915253e6bb0436c100a228df0

See more details on using hashes here.

File details

Details for the file mumobo-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: mumobo-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for mumobo-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4986a05c7f6d86caf213a474a2c7584ba36f6ef0ae23efac50f13c36e131368c
MD5 6f9155eb8cd4fbb2bd2b0edb28982c87
BLAKE2b-256 0bc17267b634063a8ca2adf715f10cf717afd932c950ebcaf8ef1568c999b0de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page