Package: bCNC
bCNCGrblHAL (formerly GRBL) CNC command sender, autoleveler, g-code editor, digitizer, CAM
and swiss army knife for all your CNC needs.An advanced fully featured g-code sender for grblHAL (formerly GRBL). bCNC is a cross platform program (Windows, Linux, Mac) written in python. The sender is robust and fast able to work nicely with old or slow hardware likeRaspberry Pi(As it was validated by the GRBL maintainer on heavy testing).IMPORTANT! If you have any troubles using bCNC, please readWIKIandDISCUSSit first. Only create newissueswhen you are certain there is a problem with actual bCNC code.Please note that all pull requests should pass the Travis-CI build in order to get merged.
Most pull requests should also pass CodeFactor checks if there is not good reason for failure.
Before making pull request, please test your code on both python2 and python3.Installation (using pip = recommended!)This is a short overview of the installation process, for more details see thewiki page.This is how you install (or upgrade) bCNC along with all required packages.
You can use any of these commands (you need only one):pip install --upgrade bCNC
pip install --upgrade git+https://github.com/vlachoudis/bCNC
pip install . #in git directory
python -m pip install --upgrade bCNCThis is how you launch bCNC:python -m bCNCOnly problem with this approach is that it might not install Tkinter in some cases.
So please keep that in mind and make sure it's installed in case of problems.If you run thepython -m bCNCcommand in root directory of this git repository it will launch the git version.
Every developer should always use this to launch bCNC to ensure that his/her code will work after packaging.Note that on Windows XP you have to usepyserial==3.0.1or older as newer version do not work on XP.PyPI project:https://pypi.org/project/bCNC/Installation (manual)You will need the following packages to run bCNCtkinter the graphical toolkit for python
Depending your python/OS it can either be already installed,
or under the names tkinter, python3-tkinter, python-tkpyserial or under the name python-serial, python-pyserialnumpyOptionally:python-imaging-tk: the PIL libraries for autolevel height mappython-opencv: for webcam streaming on web pendantscipy: for 100 times faster 3D mesh slicingExpand the directory or download it from github
and run the bCNC commandInstallation (Linux package maintainers)CopybCNCsubdirectory of this repo to/usr/lib/python3.x/site-packages/Launch usingpython -m bCNCor install bCNC.sh to /usr/binAlternatively you can fetch the bCNC Python package using pip when building Linux packagerefer to your distro, eg.:https://wiki.archlinux.org/index.php/Python_package_guidelinesPy2deb to build Debian package from Python package:https://pypi.org/project/py2deb/Installation (Compile to Windows .exe)Note that you might probably find some precompiled .exe files on github "releases" page:https://github.com/vlachoudis/bCNC/releasesBut they might not be up to date.This is basic example of how to compile bCNC to .exe file.
(given that you have working bCNC in the first place, eg. usingpip install bCNC).
Go to the directory where is your bCNC installed and do the following:pip install pyinstaller
pyinstaller --onefile --distpath . --hidden-import tkinter --paths lib;plugins;controllers --icon bCNC.ico --name bCNC __main__.pyThis will take a minute or two. But in the end it should createbCNC.exe.
Also note that there ismake-exe.batfile which will do just that for you.
This will also create rather large "build" subdirectory.
That is solely for caching purposes and you should delete it before redistributing!If you are going to report bugs in .exe version of bCNC,
please check first if that bug occurs even when running directly in python (without .exe build).IMPORTANT! Motion controller (grblHAL) settingsWe strongly recommend you to use 32b microcontroller with grblHAL firmware for the new machine builds.https://github.com/grblHAL(Original GRBL firmware is still supported, but it is currently reaching the end-of-life due to limitations of 8b microcontrollers)GRBL should be configured to useMPosrather thanWpos. This means that$10=should be set to odd number. As of GRBL 1.1 we recommend setting$10=3. If you have troubles communicating with your machine, you can try to set failsafe value$10=1.CADs, bCNC and GRBL all work in millimeters by default. Make sure that$13=0is set in GRBL, if you experience strange behavior. (unless you've configured your CAD and bCNC to use inches)Before filing bug please make sure you use latest stable official release of GRBL. Older and unofficial releases might work, but we frequently see cases where they don't. So please upgrade firmware in your Arduinos to reasonably recent version if you can.Also read about all possible GRBL settings and make sure your setup is correct:https://github.com/gnea/grbl/wiki/Grbl-v1.1-ConfigurationGrblHAL also has "Compatibility level" settings which have to be correctly configured during firmware compilation:https://github.com/grblHAL/core/wiki/Compatibility-levelConfigurationYou can modify most of the parameters from the "CAM -> Config/Controller" page.
You can also enable (up to) 6-axis mode in Config section,
but bCNC restart is required for changes to take place.
Only the changes/differences from the default configuration
file will be saved in your home directory ${HOME}/.bCNC  or ~/.bCNCThe default configuration is stored on bCNC.ini in the
installation directory.PLEASE DO NOT CHANGE THIS FILE, IT'S GOING TO BE OVERWRITTEN ON EACH UPGRADE OF BCNCFeatures:simple and intuitive interface for small screens3-axis and 6-axis GUI modesimport/exportg-code,dxfandsvgfiles3D mesh slicingstlandplyfilesfast g-code sender (works nicely on RPi and old hardware)workspace configuration (G54..G59 commands)user configurable buttonsg-codefunction evaluationwith run time expansionfeed override during the running for fine tuningEasy probing:simple probingcenter finder with a probing ringauto leveling, Z-probing and auto leveling by altering the g-code during
sending (or permanently autoleveling the g-code file).height color map displaycreate g-code by jogging and recording points (can even use camera for this)manual tool changeexpansion and automatic tool length probingcanned cyclesexpansionVarious Tools:user configurable database of materials, endmills, stockproperties database of materials, stock, end mills etc..basicCAMfeatures (profiling, pocketing, drilling, flat/helical/ramp cutting, thread milling, cutout tabs, drag knife)User g-code plugins:bowl generatorfinger joint box generatorsimple spur gear generatorspirograph generatorsurface flattenplay melody from MIDI file using stepper motor frequency...G-Code editor and displaygraphical display of the g-code, and workspacegraphically moving and editing g-codereordering code andrapid motion optimizationmoving, rotating, mirroring the g-codeWeb pendant to be used via smart phonesDebuggingYou can log serial communication by changing the port to something like:spy:///dev/ttyUSB0?file=serial_log.txt&raw
spy://COM1?file=serial_log.txt&rawIf a file isn't specified, the log is written to stderr.
The 'raw' option outputs the data directly, instead of creating a hex dump.
Further documentation is available at:https://pyserial.readthedocs.io/en/latest/url_handlers.html#spyDisclaimerThe software is made available "AS IS". It seems quite stable, but it is in
an early stage of development.  Hence there should be plenty of bugs not yet
spotted. Please use/try it with care, I don't want to be liable if it causes
any damage :)