better documentation

This commit is contained in:
Nikolay Khabarov
2017-05-13 13:23:56 +03:00
parent 94a32ebb35
commit bb0f74c6d9
2 changed files with 43 additions and 16 deletions
+42 -16
View File
@@ -1,4 +1,4 @@
This project bring CNC control for ARM based Linux boards like Raspberry Pi. This project bring CNC control for Raspberry Pi or any ARM based Linux boards.
Typically there is no way to control stepper motors from Linux runtime Typically there is no way to control stepper motors from Linux runtime
environment due to the lack of real time GPIO control. Even kernel based environment due to the lack of real time GPIO control. Even kernel based
modules can not guarantee precise control of pulses for steppers. There is modules can not guarantee precise control of pulses for steppers. There is
@@ -17,25 +17,47 @@ Video demo - [YouTube video](https://youtu.be/vcedo59raS4)
# Current command support # Current command support
G0, G1, G4, G20, G21, G28, G90, G91, G92, M2, M3, M5, M30 G0, G1, G4, G20, G21, G28, G90, G91, G92, M2, M3, M5, M30
Commands can be easily added, see [gmachine.py](./gmachine.py) file. Commands can be easily added, see [gmachine.py](./cnc/gmachine.py) file.
# Config # Config
All config is stored in [config.py](./config.py) and contains hardware properties, limitations All config is stored in [config.py](./cnc/config.py) and contains hardware
and pin names for hardware control. properties, limitations and pin names for hardware control.
Raspberry Pi implementation should be connected to A4988, DRV8825 or any other
stepper motor controllers with DIR and STEP pin inputs.
Default config is created for Raspberry Pi 2-3 and this wiring diagram:
![](https://cloud.githubusercontent.com/assets/8740775/26024664/bc13d5a6-37de-11e7-98ed-9391109fcfd0.jpg)
So having Raspberry Pi connected this was, there is no need to configure
pin map for project.
_Note: spindle control is not implemented yet_
# Hardware # Hardware
Currently, this project supports Raspberry Pi 1-3. But there is a way to add new boards. Currently, this project supports Raspberry Pi 1-3. Tested with RPI2. But there
See [hal.py](./hal.py) file. is a way to add new boards. See [hal.py](./cnc/hal.py) file.
# Usage
Just clone this repo and run `./pycnc` from repo root. It will start in
interactive terminal mode where gcode commands can be entered manually.
To run file with gcode commands, just run `./pycnc filename`.
Optionally, `pycnc` can be installed. Run
```bash
sudo pip install .
```
in repo root directory to install it. After than, `pycnc` command will be added
to system path. To remove installation, just run:
```bash
sudo pip remove pycnc
```
# Performance notice # Performance notice
Pure Python interpreter wouldn't provide great performance for high speed machines. Pure Python interpreter wouldn't provide great performance for high speed
Overspeeding setting causes motors mispulses and probably lose of trajectory. According machines. Overspeeding setting causes motors mispulses and probably lose of
to my tests, Raspberry Pi 2 can handle axises with 400 pulses on mm with top velocity ~800 mm trajectory. According to my tests, Raspberry Pi 2 can handle axises with 400
per min. There is always way out! :) Use JIT Python implementation like PyPy. RPi2 can handle pulses on mm with top velocity ~800 mm per min. There is always way out! :)
up to 18000 mm per minute on the machine with 80 steps per millimeter motors with PyPy. Use JIT Python implementation like PyPy. RPi2 can handle up to 18000 mm per
_Note: Raspbian has outdated PyPy version in repositories(v4.0). Moreover v4.0 has issue with minute on the machine with 80 steps per millimeter motors with PyPy.
`mmap` module implementation. Use PyPy v5.0+, download it for your OS from _Note: Raspbian has outdated PyPy version in repositories(v4.0). Moreover v4.0
[here](https://pypy.org/download.html)._ has issue with `mmap` module implementation. Use PyPy v5.0+, download it for
your OS from [here](https://pypy.org/download.html)._
PyPy installation: PyPy installation:
```bash ```bash
wget wget https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-linux-armhf-raspbian.tar.bz2 wget wget https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-linux-armhf-raspbian.tar.bz2
@@ -44,12 +66,16 @@ sudo tar xvf pypy2-v5.7.1-linux-armhf-raspbian.tar.bz2 --directory /opt/pypy/ --
sudo ln -s /opt/pypy/bin/pypy /usr/local/bin/pypy sudo ln -s /opt/pypy/bin/pypy /usr/local/bin/pypy
``` ```
# Project architecture
![](https://cloud.githubusercontent.com/assets/8740775/26024663/bc12d214-37de-11e7-91d7-eb94f7e79035.png)
# Dependencies # Dependencies
Nothing. Just pure Python code. Nothing. Just pure Python code.
# GCode simulation # GCode simulation
Just a link to a nice web software for gcode files emulation (very helpful for manual creating of Just a link, mostly for myself :), to a nice web software for gcode files
gcode files): [https://nraynaud.github.io/webgcode/](https://nraynaud.github.io/webgcode/) emulation (very helpful for manual creating of gcode files):
[https://nraynaud.github.io/webgcode/](https://nraynaud.github.io/webgcode/)
# License # License
see [LICENSE](./LICENSE) file. see [LICENSE](./LICENSE) file.
+1
View File
@@ -48,3 +48,4 @@ if 'move_linear' not in locals():
raise NotImplementedError("hal.move_linear() not implemented") raise NotImplementedError("hal.move_linear() not implemented")
if 'join' not in locals(): if 'join' not in locals():
raise NotImplementedError("hal.join() not implemented") raise NotImplementedError("hal.join() not implemented")