API for the mumobo device
Project description
README
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mumobo-0.0.3.tar.gz.
File metadata
- Download URL: mumobo-0.0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee8fd5f2eacd5e081565f724cc5c7ae6995898ba1909865b9d536a95b0741523
|
|
| MD5 |
70bc35f85f65c1a68cbcd64a8c8e6941
|
|
| BLAKE2b-256 |
edb15bfe281426f33b98107390e543e9417a304af05237d44c833b5ce6958bcc
|
File details
Details for the file mumobo-0.0.3-py3-none-any.whl.
File metadata
- Download URL: mumobo-0.0.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b35edddf71026c76d57320606165f3e63efba72326a250e0f94e87fbb47b3638
|
|
| MD5 |
a52ed6370fb71630192ceea63bc18d68
|
|
| BLAKE2b-256 |
e7255da37a60b7995893fdfaa0b69e1dbd2a08840d5479bf72baa8ed2d628043
|