Skip to main content

Robot Framework library for driving CNC mill

Project description

This is a Robot Framework library for driving a CNC milling machine. Idea here is that the mill is modified/built so that the cutter is replaced by a tool tip that can be used to touch physical device e.g. device with numpad. With this library you can move the tool tip to predefined locations and use it to press (buttons). This is useful for auomating acceptance testing for devices that can only be accessed physically. Library only contains keywords for driving the tool. Assertions needs to be done with some other way depending on the device under test e.g. camera+image recognition.

In our case we used ShapeOko 2 CNC-milling machine controlled by Arduino based grbl motion controller connected to Raspberry Pi 2 with camera module. The device under test in example is iZettle payment terminal.

Image Recognition library we used with camera for assertions is not included in this library.

Prerequisities

  • Python 2.7

  • pip

  • Robot Framework

Installation

If you have pip, installation is straightforward

$ pip install robotframework-cnclibrary

This will automatically install dependencies as well as their dependencies.

Note: if pip install does not find the package, download, extract and pip install the folder

Configuration file format

Configuration uses simple json format where you define positions in 3D-space.

There is a special location called ‘device_location’ that needs to exist in the configuration. The ‘device_location’ is relative to the home location where you always start the test cases. This ‘device_location’ is also special location in a sense that it must be the highest location in Z-coordinates. This location is used as safe height when raising and moving the tool – ie. no other location can be above the ‘device_location’ - otherwise the tool might collide to the device under test.

Button locations are relative to ‘device_location’ in xy-plane to make it more simple to map the location of the buttons. Z-coodinate is however always relative to the home location ie. Z should never have negative value.

You can also define special locations that are not buttons. e.g. location where the tool should go to take a photo if you have a camera attached. You can use ‘Go To’ keyword to move the tool to such location without lowering/pressing.

See example config in examples/test_device.json.

Keyword documentation

Keyword Documentation

Running tests

To run tests:

$ cd tests/itest/
$ python test_cnclibrary.py

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

CncLibrary-0.1.1.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file CncLibrary-0.1.1.tar.gz.

File metadata

  • Download URL: CncLibrary-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for CncLibrary-0.1.1.tar.gz
Algorithm Hash digest
SHA256 609c8b948ae02913248dd00261c8fc10e5e02ce53ce0b0fc26fd9aec2fa6337e
MD5 4cf2c431d4ac7fe822b41d62165f6386
BLAKE2b-256 596089052be268abed5386dcf87405746fbce49de8c5eb517aef0270a28039c1

See more details on using hashes here.

Supported by

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