Builders/pyRepRap

From RepRap
Revision as of 18:27, 15 October 2008 by Greenarrow (talk | contribs)
Jump to: navigation, search

Introduction

  • pyRepRap is a Python library for controlling a serial SNAP RepRap.
  • The library supports the full SNAP v1 specification including Cartesian robot and thermoplast extruder.
  • SNAP v2 support will be added as soon as I get my hands on a Arduino / Sanguino.

Download & Install

SVN Path : https://reprap.svn.sourceforge.net/svnroot/reprap/trunk/users/stef/pyRepRap/

Linux

TODO : List Dependencies

svn checkout https://reprap.svn.sourceforge.net/svnroot/reprap/trunk/users/stef/pyRepRap/
cd pyRepRap
python setup.py build
sudo python setup.py install

Windows

I have used this in Windows and it works fine. I need to add the dependencies list and some instructions.

Example

This simple example sends the reprap to the home position, moves the x & y axes around a bit, then returns to the home position and powers off the motors.

#!/usr/bin/env python

# Import the reprap  modules
import reprap, time

# Initialise serial port, here the first port (0) is used.
reprap.openSerial( 0, 19200, 60 )

# These devices are present in network, will automatically scan in the future.
reprap.cartesian.x.active = True
reprap.cartesian.y.active = True
reprap.cartesian.z.active = True
reprap.extruder.active = True

# Set axies to notify arrivals
reprap.cartesian.x.setNotify()
reprap.cartesian.y.setNotify()
reprap.cartesian.z.setNotify()

# Set stepper speed to 220 (out of 255)
reprap.cartesian.setSpeed(220)
# Set power to 83%
reprap.cartesian.setPower(83)

# The module is now ready to recieve commands #

# Send all axies to home position. Wait until arrival.
reprap.cartesian.homeReset()

# When using seek with no waitArrival = True/False argument, it defaults to true
# Seek to X1000, Y1000
reprap.cartesian.seek( (1000, 1000, None) )

# Pause
time.sleep(2)

# Seek to X500, Y1000
reprap.cartesian.seek( (500, 1000, None) )

time.sleep(2)

# Seek to X1000, Y500
reprap.cartesian.seek( (1000, 500, None) )

time.sleep(2)

# Seek to X100, Y100
reprap.cartesian.seek( (100, 100, None) )

# Send all axies to home position. Wait until arrival.
reprap.cartesian.homeReset()

# Shut off power to all motors.
reprap.cartesian.free()