## v0.4.16
- Improved axis under/over warning tooltip.
- Added support for DMM DYN4 VFD.
- - Only enable ``rapid-auto-off`` in PWM mode. #272
+ - Only enable ``rapid-auto-off`` and ``dynamic-power`` in PWM mode. #272
- Support more gamepads.
- Added copyright to LCD boot up.
- Fixed default units handling. #206
- Fix zero-all when some axes are homed and some are unhomed.
+ - Fixed LCD axis offset position display.
+ - Set ``max-arc-error`` with ``max-deviation``.
+ - Improved modbus debugging.
+ - Fixed demo estop.
## v0.4.15
- Set GCode variables ``#5400`` and ``#<_tool>``.
recursive-include src/py/bbctrl/http *
+include src/py/bbctrl/camotics.so
include package.json README.md scripts/install.sh
include src/avr/bbctrl-avr-firmware.hex
include src/bbserial/bbserial.ko
include scripts/rc.local
include scripts/bbctrl.service
include scripts/11-automount.rules
-recursive-include src/py/camotics *
global-exclude .gitignore
TEMPLS := $(wildcard src/pug/templates/*.pug)
AVR_FIRMWARE := src/avr/bbctrl-avr-firmware.hex
-GPLAN_MOD := rpi-share/camotics/gplan.so
-GPLAN_TARGET := src/py/camotics/gplan.so
-GPLAN_IMG := gplan-dev.img
+CAMOTICS_MOD := rpi-share/camotics/build/camotics.so
+CAMOTICS_TARGET := src/py/bbctrl/camotics.so
+CAMOTICS_IMG := camotics-dev.img
RSYNC_EXCLUDE := \*.pyc __pycache__ \*.egg-info \\\#* \*~ .\\\#\*
RSYNC_EXCLUDE := $(patsubst %,--exclude %,$(RSYNC_EXCLUDE))
bbserial:
$(MAKE) -C src/bbserial
-gplan: $(GPLAN_TARGET)
+camotics: $(CAMOTICS_TARGET)
-$(GPLAN_TARGET): $(GPLAN_MOD)
+$(CAMOTICS_TARGET): $(CAMOTICS_MOD)
cp $< $@
-$(GPLAN_MOD): $(GPLAN_IMG)
- ./scripts/gplan-init-build.sh
+$(CAMOTICS_MOD): $(CAMOTICS_IMG)
+ ./scripts/camotics-init-build.sh
git -C rpi-share/cbang fetch
git -C rpi-share/cbang reset --hard FETCH_HEAD
git -C rpi-share/camotics fetch
git -C rpi-share/camotics reset --hard FETCH_HEAD
- cp ./scripts/gplan-build.sh rpi-share/
- sudo ./scripts/rpi-chroot.sh $(GPLAN_IMG) /mnt/host/gplan-build.sh
+ cp ./scripts/camotics-build.sh rpi-share/
+ sudo ./scripts/rpi-chroot.sh $(CAMOTICS_IMG) /mnt/host/camotics-build.sh
-$(GPLAN_IMG):
- ./scripts/gplan-init-build.sh
+$(CAMOTICS_IMG):
+ ./scripts/camotics-init-build.sh
.PHONY: $(AVR_FIRMWARE)
$(AVR_FIRMWARE):
dist-clean: clean
rm -rf node_modules
-.PHONY: all install clean tidy pkg gplan lint pylint jshint bbserial
+.PHONY: all install clean tidy pkg camotics lint pylint jshint bbserial
* [Python 3](https://www.python.org/)
* [Tornado Web](https://www.tornadoweb.org/)
- * GPlan - Path Planner Python Module
+ * CAMotics - Path Planner Python Module
* [C++](http://www.cplusplus.com/)
* [CAMotics](https://camotics.org/)
cd bbctrl-firmware
make
-## Build GPlan Module
+## Build CAMotics Module
-GPlan is a Python module written in C++. It must be compiled for ARM so that
+CAMotics is a Python module written in C++. It must be compiled for ARM so that
it can be used on the Raspberry Pi. This is accomplished using a chroot, qemu
and binfmt to create an emulated ARM build environment. This is faster and
more convenient than building on the RPi itself. All of this is automated.
- make gplan
+ make camotics
The first time this is run it will take quite awhile as it setups up the build
environment. You can run the above command again later to build the latest
git clone --depth=1 https://github.com/CauldronDevelopmentLLC/camotics
export CBANG_HOME=/opt/cbang
scons -C cbang -j8 disable_local="re2 libevent"
- scons -C camotics -j8 gplan.so with_gui=False
+ scons -C camotics -j8 build/camotics.so with_gui=False
cd bbctrl
python3 setup.py install
- cp /opt/camotics/gplan.so /usr/local/lib/python*/dist-packages/bbctrl-$VERSION-py*.egg/camotics/gplan.so
+ cp /opt/camotics/build/camotics.so /usr/local/lib/python*/dist-packages/bbctrl-$VERSION-py*.egg/camotics.so
mkdir -p /var/lib/bbctrl/upload
useradd -u 1001 bbmc
--- /dev/null
+G21
+(File: 'buildbotics_logo.tpl')
+G0 Z3
+F1600
+M3 S10000
+M6 T2
+G0 X59.25 Y5.85
+G1 Z-1.5
+G1 X61.68 Y6.7
+G1 X63.86 Y8.07
+G1 X65.68 Y9.89
+G1 X67.05 Y12.07
+G1 X67.9 Y14.5
+G1 X68.2 Y17.09
+G1 Y56.6
+G1 X67.73 Y59.04
+G1 X50.8
+G1 Y34.9
+G1 X50.65 Y34.55
+G1 X50.3 Y34.4
+G1 X23.46
+G1 X23.1 Y34.55
+G1 X22.96 Y34.9
+G1 X22.98 Y49.88
+G1 X22.96 Y59.05
+G1 X22.41
+G1 X19.26
+G1 X6.04
+G1 X5.56 Y56.53
+G1 Y17.09
+G1 X5.85 Y14.5
+G1 X6.7 Y12.07
+G1 X8.07 Y9.89
+G1 X9.89 Y8.07
+G1 X12.07 Y6.7
+G1 X14.5 Y5.85
+G1 X17.09 Y5.56
+G1 X56.67
+G1 X59.25 Y5.85
+G0 Z3
+G0 X64.26 Y64.72
+G1 Z-1.5
+G1 X61.78 Y66.52
+G1 X58.91 Y67.68
+G1 X56.54 Y68.08
+G1 X17.22
+G1 X14.84 Y67.68
+G1 X11.97 Y66.52
+G1 X9.49 Y64.72
+G1 X8.08 Y63.16
+G1 X27.35
+G1 X27.89 Y63.45
+G1 X27.96 Y63.48
+G1 X31.48 Y64.75
+G1 X31.52 Y64.76
+G1 X31.56 Y64.77
+G1 X35.19 Y65.41
+G1 X35.26
+G1 X35.97 Y65.44
+G1 X36.04 Y65.45
+G1 X36.07
+G1 X36.82 Y65.44
+G1 X36.83
+G1 X36.89
+G1 X36.95
+G1 X36.97
+G1 X37.72 Y65.43
+G1 X37.74
+G1 X37.8
+G1 X37.81
+G1 X37.88
+G1 X37.89
+G1 X38.65 Y65.38
+G1 X38.68
+G1 X38.75 Y65.37
+G1 X39.38 Y65.32
+G1 X39.44 Y65.31
+G1 X42.68 Y64.64
+G1 X42.76 Y64.62
+G1 X45.87 Y63.44
+G1 X45.93 Y63.41
+G1 X46.4 Y63.16
+G1 X65.67
+G1 X64.26 Y64.72
+G0 Z3
+G0 X36.88 Y9.4
+G1 Z-1.5
+G1 X37.31 Y9.64
+G1 X39.58 Y13.48
+G1 X39.63 Y13.6
+G1 X39.65 Y13.73
+G1 Y27.54
+G1 X41.67
+G1 Y25.39
+G1 X41.75 Y25.12
+G1 X41.97 Y24.93
+G1 X46.41 Y22.92
+G1 Y19.97
+G1 X45.44
+G1 X45.08 Y19.82
+G1 X44.94 Y19.47
+G1 Y13.73
+G1 X45.08 Y13.38
+G1 X45.44 Y13.23
+G1 X49.94 Y13.24
+G1 X50.29 Y13.39
+G1 X50.44 Y13.74
+G1 Y19.47
+G1 X50.29 Y19.83
+G1 X49.93 Y19.97
+G1 X48.92
+G1 Y23.61
+G1 X48.84 Y23.88
+G1 X48.63 Y24.06
+G1 X44.19 Y26.12
+G1 Y27.54
+G1 X49.22
+G1 X49.33 Y27.56
+G1 X49.44 Y27.6
+G1 X50.13 Y27.94
+G1 X50.25 Y28.02
+G1 X50.34 Y28.13
+G1 X50.73 Y28.77
+G1 X50.78 Y28.89
+G1 X50.8 Y29.03
+G1 Y33.05
+G1 Y34.25
+G1 Y34.65
+G1 X50.66 Y35.01
+G1 X50.3 Y35.15
+G1 X23.46
+G1 X23.1 Y35.01
+G1 X22.96 Y34.65
+G1 Y29.07
+G1 X22.97 Y28.94
+G1 X23.02 Y28.82
+G1 X23.4 Y28.17
+G1 X23.49 Y28.06
+G1 X23.6 Y27.98
+G1 X24.29 Y27.6
+G1 X24.4 Y27.56
+G1 X24.52 Y27.54
+G1 X25.55
+G1 Y26.4
+G1 X23.4 Y25.52
+G1 X23.17 Y25.33
+G1 X23.09 Y25.06
+G1 Y17.54
+G1 X23.23 Y17.19
+G1 X23.59 Y17.04
+G1 X24.6
+G1 Y10.36
+G1 X24.62 Y10.23
+G1 X24.66 Y10.11
+G1 X24.8 Y9.88
+G1 X24.88 Y9.77
+G1 X24.99 Y9.68
+G1 X25.25 Y9.54
+G1 X25.37 Y9.5
+G1 X25.49 Y9.48
+G1 X26.53
+G1 X26.65 Y9.49
+G1 X26.76 Y9.54
+G1 X27.01 Y9.66
+G1 X27.12 Y9.74
+G1 X27.21 Y9.85
+G1 X27.35 Y10.09
+G1 X27.41 Y10.22
+G1 X27.43 Y10.35
+G1 Y10.43
+G1 X27.47 Y17.04
+G1 X28.57
+G1 X28.92 Y17.19
+G1 X29.07 Y17.54
+G1 Y24.64
+G1 X30.72 Y25.3
+G1 X30.95 Y25.49
+G1 X31.03 Y25.77
+G1 X31.02 Y27.54
+G1 X34.03
+G1 Y13.73
+G1 X34.05 Y13.59
+G1 X34.1 Y13.47
+G1 X36.45 Y9.64
+G1 X36.88 Y9.4
+G0 Z3
+G0 X49.94 Y10.82
+G1 Z-1.5
+G1 X50.29 Y10.97
+G1 X50.44 Y11.32
+G1 Y13.34
+G1 X50.29 Y13.69
+G1 X49.94 Y13.84
+G1 X45.44
+G1 X45.08 Y13.69
+G1 X44.94 Y13.34
+G1 Y11.32
+G1 X45.08 Y10.97
+G1 X45.44 Y10.82
+G1 X49.94
+G0 Z3
+G0 X48.46 Y9.7
+G1 Z-1.5
+G1 X48.59 Y9.72
+G1 X48.71 Y9.77
+G1 X50.03 Y10.53
+G1 X50.21 Y10.71
+G1 X50.28 Y10.96
+G1 X50.14 Y11.31
+G1 X49.78 Y11.46
+G1 X45.62
+G1 X45.14 Y11.09
+G1 X45.37 Y10.53
+G1 X46.69 Y9.77
+G1 X46.81 Y9.72
+G1 X46.94 Y9.7
+G1 X48.46
+G0 Z3
+G0 X50.3 Y34.4
+G1 Z-1.5
+G1 X50.66 Y34.55
+G1 X50.8 Y34.9
+G1 Y49.88
+G1 X50.79 Y59.52
+G1 X50.76 Y59.69
+G1 X50.67 Y59.84
+G1 X50.09 Y60.52
+G1 X50.06 Y60.55
+G1 X50.02 Y60.58
+G1 X47.89 Y62.26
+G1 X47.85 Y62.28
+G1 X47.81 Y62.31
+G1 X44.46 Y64.03
+G1 X44.41 Y64.05
+G1 X44.37 Y64.06
+G1 X40.69 Y65.1
+G1 X40.62 Y65.12
+G1 X37.86 Y65.45
+G1 X37.8 Y65.46
+G1 X36.89 Y65.44
+G1 X36.83
+G1 X36.82
+G1 X36.07 Y65.45
+G1 X36.04 Y65.44
+G1 X35.97
+G1 X35.1 Y65.41
+G1 X35.04 Y65.4
+G1 X32.44 Y64.99
+G1 X32.37 Y64.97
+G1 X28.94 Y63.9
+G1 X28.89 Y63.88
+G1 X28.85 Y63.86
+G1 X25.74 Y62.2
+G1 X25.7 Y62.18
+G1 X25.66 Y62.15
+G1 X23.68 Y60.56
+G1 X23.65 Y60.53
+G1 X23.62 Y60.5
+G1 X23.08 Y59.87
+G1 X22.99 Y59.71
+G1 X22.96 Y59.54
+G1 X22.98 Y49.88
+G1 X22.96 Y34.9
+G1 X23.1 Y34.55
+G1 X23.46 Y34.4
+G1 X50.3
+G0 Z3
+G0 X55.2 Y43.67
+G1 Z-1.5
+G1 Y51.34
+G1 X55.11 Y51.94
+G1 X54.83 Y52.88
+G1 X54.39 Y53.88
+G1 X53.8 Y54.85
+G1 X53.09 Y55.74
+G1 X52.28 Y56.47
+G1 X51.41 Y56.98
+G1 X51.07 Y57.09
+G1 Y43.67
+G1 X55.2
+G0 Z3
+G0 X22.69 Y43.63
+G1 Z-1.5
+G1 Y57.09
+G1 X22.35 Y56.98
+G1 X21.47 Y56.47
+G1 X20.67 Y55.74
+G1 X19.95 Y54.85
+G1 X19.36 Y53.88
+G1 X18.92 Y52.88
+G1 X18.64 Y51.94
+G1 X18.55 Y51.34
+G1 Y43.63
+G1 X22.69
+G0 Z3
+G0 X28.55 Y35.84
+G1 Z-0.99
+G1 X30.11 Y36.15
+G1 X31.43 Y37.03
+G1 X32.32 Y38.35
+G1 X32.63 Y39.91
+G1 X32.32 Y41.47
+G1 X31.43 Y42.79
+G1 X30.11 Y43.68
+G1 X28.55 Y43.99
+G1 X26.99 Y43.68
+G1 X25.67 Y42.79
+G1 X24.79 Y41.47
+G1 X24.48 Y39.91
+G1 X24.79 Y38.35
+G1 X25.67 Y37.03
+G1 X26.99 Y36.15
+G1 X28.55 Y35.84
+G0 Z3
+G0 X45.33 Y35.93
+G1 Z-0.99
+G1 X46.88 Y36.24
+G1 X48.21 Y37.12
+G1 X49.09 Y38.45
+G1 X49.4 Y40
+G1 X49.09 Y41.56
+G1 X48.21 Y42.88
+G1 X46.88 Y43.77
+G1 X45.33 Y44.08
+G1 X43.77 Y43.77
+G1 X42.45 Y42.88
+G1 X41.56 Y41.56
+G1 X41.25 Y40
+G1 X41.56 Y38.45
+G1 X42.45 Y37.12
+G1 X43.77 Y36.24
+G1 X45.33 Y35.93
+G0 Z3
+G0 X45.2 Y39.12
+G1 Z-0.99
+G1 X45.7 Y39.19
+G1 X46.07 Y39.52
+G1 X46.22 Y40
+G1 X46.07 Y40.49
+G1 X45.7 Y40.81
+G1 X45.2 Y40.89
+G1 X44.74 Y40.68
+G1 X44.47 Y40.26
+G1 Y39.75
+G1 X44.74 Y39.33
+G1 X45.2 Y39.12
+G0 Z3
+G0 X28.43 Y39.03
+G1 Z-0.99
+G1 X28.92 Y39.1
+G1 X29.3 Y39.43
+G1 X29.44 Y39.91
+G1 X29.3 Y40.4
+G1 X28.92 Y40.72
+G1 X28.43 Y40.8
+G1 X27.97 Y40.59
+G1 X27.7 Y40.16
+G1 Y39.66
+G1 X27.97 Y39.24
+G1 X28.43 Y39.03
+G0 Z3
+G0 X55.76 Y0
+G1 Z-1.5
+G1 X59.27 Y0.35
+G1 X62.65 Y1.37
+G1 X65.76 Y3.03
+G1 X68.49 Y5.27
+G1 X70.73 Y8
+G1 X72.39 Y11.11
+G1 X73.42 Y14.49
+G1 X73.76 Y18
+G1 Y55.69
+G1 X73.42 Y59.2
+G1 X72.39 Y62.57
+G1 X70.73 Y65.69
+G1 X68.49 Y68.41
+G1 X65.76 Y70.65
+G1 X62.65 Y72.31
+G1 X59.27 Y73.34
+G1 X55.76 Y73.69
+G1 X18
+G1 X14.49 Y73.34
+G1 X11.11 Y72.31
+G1 X8 Y70.65
+G1 X5.27 Y68.41
+G1 X3.03 Y65.69
+G1 X1.37 Y62.57
+G1 X0.35 Y59.2
+G1 X0 Y55.69
+G1 Y18
+G1 X0.35 Y14.49
+G1 X1.37 Y11.11
+G1 X3.03 Y8
+G1 X5.27 Y5.27
+G1 X8 Y3.03
+G1 X11.11 Y1.37
+G1 X14.49 Y0.35
+G1 X18 Y0
+G1 X55.76
+G0 Z3
+M5
+G0 X40 Y75
+M2
--- /dev/null
+#!/bin/bash -ex
+
+cd /mnt/host
+export V8_INCLUDE=/opt/embedded-v8/include/ V8_LIBPATH=/opt/embedded-v8/out/
+scons -C cbang disable_local="re2 libevent"
+export CBANG_HOME="/mnt/host/cbang"
+scons -C camotics build/camotics.so with_gui=0
--- /dev/null
+#!/bin/bash -ex
+
+IMG_DATE=2017-11-29
+IMG_BASE=${IMG_DATE}-raspbian-stretch-lite
+BASE_URL=https://downloads.raspberrypi.org/raspbian_lite/images
+IMG_URL=$BASE_URL/raspbian_lite-2017-12-01/$IMG_BASE.zip
+CAMOTICS_IMG=camotics-dev.img
+
+# Create dev image
+if [ ! -e $CAMOTICS_IMG ]; then
+
+ # Get base image
+ if [ ! -e $IMG_BASE.img ]; then
+ if [ ! -e $IMG_BASE.zip ]; then
+ wget $IMG_URL
+ fi
+
+ unzip $IMG_BASE.zip
+ fi
+
+ # Copy base image
+ cp $IMG_BASE.img $CAMOTICS_IMG.tmp
+
+ # Init image
+ mkdir -p rpi-share
+ cp ./scripts/camotics-init-dev-img.sh rpi-share
+ sudo ./scripts/rpi-chroot.sh $CAMOTICS_IMG.tmp /mnt/host/camotics-init-dev-img.sh
+
+ # Move image
+ mv $CAMOTICS_IMG.tmp $CAMOTICS_IMG
+fi
+
+# Get repos
+function fetch_local_repo() {
+ mkdir -p $1
+ git -C $1 init
+ git -C $1 fetch -t "$2" $3
+ git -C $1 reset --hard FETCH_HEAD
+}
+
+mkdir -p rpi-share || true
+
+if [ ! -e rpi-share/cbang ]; then
+ if [ "$CBANG_HOME" != "" ]; then
+ fetch_local_repo rpi-share/cbang "$CBANG_HOME" master
+ else
+ git clone https://github.com/CauldronDevelopmentLLC/cbang \
+ rpi-share/cbang
+ fi
+fi
+
+if [ ! -e rpi-share/camotics ]; then
+ if [ "$CAMOTICS_HOME" != "" ]; then
+ fetch_local_repo rpi-share/camotics "$CAMOTICS_HOME" master
+ else
+ git clone https://github.com/CauldronDevelopmentLLC/camotics \
+ rpi-share/camotics
+ fi
+fi
--- /dev/null
+#!/bin/bash -e
+
+export LC_ALL=C
+cd /mnt/host
+
+# Update the system
+apt-get update
+#apt-get dist-upgrade -y
+
+# Install packages
+apt-get install -y scons build-essential libssl-dev python3-dev nodejs-dev
+++ /dev/null
-#!/bin/bash -ex
-
-cd /mnt/host
-scons -C cbang disable_local="re2 libevent"
-export CBANG_HOME="/mnt/host/cbang"
-scons -C camotics gplan.so with_gui=0 with_tpl=0
+++ /dev/null
-#!/bin/bash -ex
-
-IMG_DATE=2017-11-29
-IMG_BASE=${IMG_DATE}-raspbian-stretch-lite
-BASE_URL=https://downloads.raspberrypi.org/raspbian_lite/images
-IMG_URL=$BASE_URL/raspbian_lite-2017-12-01/$IMG_BASE.zip
-GPLAN_IMG=gplan-dev.img
-
-# Create dev image
-if [ ! -e $GPLAN_IMG ]; then
-
- # Get base image
- if [ ! -e $IMG_BASE.img ]; then
- if [ ! -e $IMG_BASE.zip ]; then
- wget $IMG_URL
- fi
-
- unzip $IMG_BASE.zip
- fi
-
- # Copy base image
- cp $IMG_BASE.img $GPLAN_IMG.tmp
-
- # Init image
- mkdir -p rpi-share
- cp ./scripts/gplan-init-dev-img.sh rpi-share
- sudo ./scripts/rpi-chroot.sh $GPLAN_IMG.tmp /mnt/host/gplan-init-dev-img.sh
-
- # Move image
- mv $GPLAN_IMG.tmp $GPLAN_IMG
-fi
-
-# Get repos
-function fetch_local_repo() {
- mkdir -p $1
- git -C $1 init
- git -C $1 fetch -t "$2" $3
- git -C $1 reset --hard FETCH_HEAD
-}
-
-mkdir -p rpi-share || true
-
-if [ ! -e rpi-share/cbang ]; then
- if [ "$CBANG_HOME" != "" ]; then
- fetch_local_repo rpi-share/cbang "$CBANG_HOME" master
- else
- git clone https://github.com/CauldronDevelopmentLLC/cbang \
- rpi-share/cbang
- fi
-fi
-
-if [ ! -e rpi-share/camotics ]; then
- if [ "$CAMOTICS_HOME" != "" ]; then
- fetch_local_repo rpi-share/camotics "$CAMOTICS_HOME" master
- else
- git clone https://github.com/CauldronDevelopmentLLC/camotics \
- rpi-share/camotics
- fi
-fi
+++ /dev/null
-#!/bin/bash -e
-
-export LC_ALL=C
-cd /mnt/host
-
-# Update the system
-apt-get update
-#apt-get dist-upgrade -y
-
-# Install packages
-apt-get install -y scons build-essential libssl-dev python3-dev
license = pkg['license'],
url = pkg['homepage'],
package_dir = {'': 'src/py'},
- packages = ['bbctrl', 'inevent', 'lcd', 'camotics'],
+ packages = ['bbctrl', 'inevent', 'lcd'],
include_package_data = True,
entry_points = {
'console_scripts': [
}
+static void _debug_transfer() {
+ if (!cfg.debug) return;
+
+ char out[state.command_length * 2 + 1];
+ char in[state.response_length * 2 + 1];
+ format_hex_buf(out, state.command, state.command_length);
+ format_hex_buf(in, state.response, state.response_length);
+
+ STATUS_DEBUG("modbus: out=0x%s in=0x%s", out, in);
+}
+
+
static bool _check_response() {
// Check CRC
uint16_t computed = _crc16(state.response, state.response_length - 2);
if (computed != expected) {
if (cfg.debug) {
- char sent[state.command_length * 2 + 1];
- char response[state.response_length * 2 + 1];
- format_hex_buf(sent, state.command, state.command_length);
- format_hex_buf(response, state.response, state.response_length);
-
STATUS_WARNING(STAT_OK, "modbus: invalid CRC, received=0x%04x "
- "computed=0x%04x sent=0x%s received=0x%s",
- expected, computed, sent, response);
+ "computed=0x%04x", expected, computed);
+ _debug_transfer();
}
state.crc_errs++;
if (state.command[0] != state.response[0]) {
STATUS_WARNING(STAT_OK, "modbus: unexpected slave id, expected=%u got=%u",
state.command[0], state.response[0]);
+ _debug_transfer();
state.status = MODBUS_INVALID;
return false;
}
if (state.command[1] != state.response[1]) {
STATUS_WARNING(STAT_OK, "modbus: invalid function code, expected=%u got=%u",
state.command[1], state.response[1]);
+ _debug_transfer();
state.status = MODBUS_INVALID;
return false;
}
}
if (state.rw_cb) state.rw_cb(false, state.addr, 0);
+ STATUS_WARNING(STAT_OK, "modbus: unexpected response to read");
+ _debug_transfer();
}
}
if (state.rw_cb) state.rw_cb(false, state.addr, 0);
+ STATUS_WARNING(STAT_OK, "modbus: unexpected response to write");
+ _debug_transfer();
}
float power = _speed_to_power(spindle.speed);
// Handle dynamic power
- if (spindle.dynamic_power && spindle.inv_feed) {
+ if (spindle.type == SPINDLE_TYPE_PWM && spindle.dynamic_power &&
+ spindle.inv_feed) {
float scale = spindle.inv_feed * exec_get_velocity();
if (scale < 1) power *= scale;
}
case 'UNDER':
title = 'Current program would move ' +
this._length_str(min - pathMin - off) + ' below axis bounds. ' +
- 'Offsets must be adjusted of soft limits set correctly.';
+ 'Offsets must be adjusted or soft limits set correctly.';
break;
case 'NO FIT':
#[a(href=base + "#gcode:g64", target="_blank") G64] also affect path
planning accuracy.
+ p.
+ This also affects the maimum error when interpolating
+ #[a(href=base + "#gcode:g2-g3", target="_blank") G2 and G3] arcs.
+
h2 Cornering Speed (Advanced)
templated-input(name="junction-accel",
:model.sync="config.settings['junction-accel']",
except: pass
self._close_dev()
- self.log.info('Closed camera\n')
+ self.log.info('Closed camera')
except: self.log.exception('Exception while closing camera')
finally: self.dev = None
self.camera = app.camera
+ def finish(self): pass # Don't let it finish and end the response
+
+
def get(self):
self.request.connection.stream.max_write_buffer_size = 10000
elif state.is_axis_enabled(axis):
position = state.get(axis + 'p', 0)
- position += state.get('offset_' + axis, 0)
+ position -= state.get('offset_' + axis, 0)
position /= scale
self.text('% 10.3f%s' % (position, axis.upper()), 9, row)
row += 1
import time
import datetime
from collections import deque
-import camotics.gplan as gplan # pylint: disable=no-name-in-module,import-error
+
+try:
+ import bbctrl.camotics as camotics # pylint: disable=no-name-in-module,import-error
+except:
+ print('Error loading camotics')
+
import bbctrl.Cmd as Cmd
from bbctrl.CommandQueue import CommandQueue
ctrl.state.add_listener(self._update)
- self.reset(False)
- self._report_time()
+ try:
+ self.reset(False)
+ self._report_time()
+ except Exception as e:
+ self.log.exception()
def is_busy(self): return self.is_running() or self.cmdq.is_active()
state = self.ctrl.state
config = self.ctrl.config
is_pwm = config.get('tool-type') == 'PWM Spindle'
+ deviation = config.get('max-deviation')
cfg = {
# NOTE Must get current units not configured default units
'max-accel': state.get_axis_vector('am', 1000000),
'max-jerk': state.get_axis_vector('jm', 1000000),
'rapid-auto-off': config.get('rapid-auto-off') and is_pwm,
- 'max-blend-error': config.get('max-deviation'),
- 'max-merge-error': config.get('max-deviation'),
+ 'max-blend-error': deviation,
+ 'max-merge-error': deviation,
+ 'max-arc-error': deviation / 10,
'junction-accel': config.get('junction-accel'),
}
def __encode(self, block):
type, id = block['type'], block['id']
+ if type == 'start': return # ignore
+
if type != 'set': self.log.info('Cmd:' + log_json(block))
if type == 'line':
def reset(self, stop = True):
if stop: self.ctrl.mach.stop()
- self.planner = gplan.Planner()
+ self.planner = camotics.Planner()
self.planner.set_resolver(self._get_var_cb)
# TODO logger is global and will not work correctly in demo mode
self.planner.set_logger(self._log_cb, 1, 'LinePlanner:3')
import bbctrl.v4l2 as v4l2
import bbctrl.Log as log
import bbctrl.ObjGraph as ObjGraph
+import bbctrl.camotics as camotics
ctrl = None
import gzip
import struct
import math
-import camotics.gplan as gplan # pylint: disable=no-name-in-module,import-error
+import bbctrl.camotics as camotics # pylint: disable=no-name-in-module,import-error
reLogLine = re.compile(
self.lines = sum(1 for line in open(path, 'rb'))
- self.planner = gplan.Planner()
+ self.planner = camotics.Planner()
self.planner.set_resolver(self.get_var_cb)
self.planner.set_logger(self._log_cb, 1, 'LinePlanner:3')
self.planner.load(self.path, config)
"default": "lo-hi",
"code": "dom",
"pin": 16
- },
- "rapid-auto-off": {
- "help": "Turn tool off during rapid moves. Useful for LASERs.",
- "type": "bool",
- "default": false
- },
- "dynamic-power": {
- "help":
- "Adjust tool power based on velocity and feed rate. Useful for LASERs.",
- "type": "bool",
- "default": false,
- "code": "dp"
}
},
"max": 320000,
"default": 1000,
"code": "sf"
+ },
+ "rapid-auto-off": {
+ "help": "Turn tool off during rapid moves. Useful for LASERs.",
+ "type": "bool",
+ "default": false
+ },
+ "dynamic-power": {
+ "help":
+ "Adjust tool power based on velocity and feed rate. Useful for LASERs.",
+ "type": "bool",
+ "default": false,
+ "code": "dp"
}
},