Home

Awesome

meArmPi

Inverse Kinematics movement control library in Python for Phenoptix meArm on Raspberry Pi via Adafruit PWM Servo driver.

The meArm has four mini servos - one for the gripper, and one each to rotate the base, shoulder joint and elbow joint. But it's not terribly convenient to be specifying things in terms of servo angles when you're much more interested in where you would like to place the gripper, in normal Cartesian (x, y, z) coordinates.

This library solves the angles required to send to the servos in order to meet a given position, allowing for much simpler coding.

Coordinates are (approximately) measured in mm from the base rotation centre. Initial 'home' position is at (0, 100, 50), i.e. 100mm forward of the base and 50mm off the ground.

Various other versions of this library exist:

meArm moving with Inverse Kinematics

Wiring

This uses an Adafruit 16-channel PWM servo driver board to connect the servos to the Raspberry Pi. Use the first block of four servo connectors, and connect yellow wire to the top, brown wire to the bottom.

Connect the Adafruit PWM Servo driver to the Pi as follows (I used Adafruit Pi Cobbler to help breadboard it):

Usage

import meArm

def main():
    arm = meArm.meArm()
    arm.begin()
	
    while True:
        arm.openGripper()
        arm.closeGripper()
        arm.openGripper()
        arm.closeGripper()
        arm.openGripper()
        
        #Go up and left to grab something
        arm.gotoPoint(-80,100,140) 
        arm.closeGripper()
        #Go down, forward and right to drop it
        arm.gotoPoint(70,200,10)
        arm.openGripper()
        #Back to start position
        arm.gotoPoint(0,100,50)
    return 0

if __name__ == '__main__':
	main()

One usage examples is included:

Installation

Class methods of meArm object