Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for issues 68, 164, 167, 546, and 550 #581

Open
wants to merge 131 commits into
base: 2.7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
89d05c4
tp: Improve position-mode spindle sync performance with new error cal…
robEllenberg Sep 3, 2016
300045b
tp: new formula for spindle position tracking
robEllenberg Sep 4, 2016
e76bb40
sim: Add a simple component for quantizing a signal (useful for simul…
robEllenberg Sep 11, 2016
a95fee6
sim: First cut of spindle encoder simulation with quantized output
robEllenberg Sep 11, 2016
fb6b108
canon: Add a missing forward declaration
robEllenberg Sep 25, 2016
ddd71e4
canon: Minor whitespace cleanup
robEllenberg Sep 25, 2016
050adc6
canon: Replace unit conversion macro with a function
robEllenberg Sep 25, 2016
150751e
canon: Enable smarter blending in spindle-synchronized motion.
robEllenberg Sep 25, 2016
132d8cc
tp: disallow blending when entering position-synch mode
robEllenberg Jul 9, 2016
09c5949
tp: Limit max feed scale in position-sync blends.
robEllenberg Sep 27, 2016
68b5e73
canon: Automatically limit spindle speed in spindle-sync motion.
robEllenberg Sep 29, 2016
6082892
tp: Fix debug level for some debug print statements
robEllenberg Nov 26, 2016
f714b3d
tp: Re-order checks for parabolic blends
robEllenberg Nov 26, 2016
a10bd0b
tp: Add debug information for spindle sync
robEllenberg Nov 27, 2016
3bcda2a
sim: Improve simulation of inertia in spindle sim
robEllenberg Nov 27, 2016
8c4c0a0
tp: Use motion's spindle-speed-in input for spindle velocity
robEllenberg Nov 26, 2016
ae402de
motion: Add spindle velocity estimator
robEllenberg Dec 10, 2016
873aac4
motion: Refactor spindle status for clarity and organization.
robEllenberg Dec 10, 2016
f8af6dc
tp: Remove discontinuous spindle positions in rigid tapping internals.
robEllenberg Dec 10, 2016
5390ee4
tp: Fix spindle position tracking to work with motion's new spindle d…
robEllenberg Dec 11, 2016
c4dfe6f
canon: actually return angular feed rate when asked
robEllenberg Dec 15, 2016
aa53d9f
test: Test case for steady state error
robEllenberg Dec 11, 2016
7b78fbc
test: Match sam's lathe config settings (axis vel / acc).
robEllenberg Jan 23, 2017
a7e35f5
Re-arrange a calculation to remove a division
robEllenberg Dec 11, 2016
39f7434
motion: Add a HAL pin to motion to let users control how aggressive p…
robEllenberg Dec 11, 2016
4864c45
sim: model velocity quantization in encoder near 360RPM
robEllenberg Dec 11, 2016
f7a654c
tp: Allow switching between position-sync algorithms based on a HAL pin.
robEllenberg Dec 11, 2016
dbc4be1
canon: Simplify spindle speed limits for synced motion
robEllenberg Jan 27, 2017
6ef4c5e
canon: don't restore spindle speed after limiting it for spindle-sync…
robEllenberg Jan 27, 2017
2446097
Added tracking error pin to motion HAL for spindle sync testing
robEllenberg Feb 5, 2017
47c60c6
Make sim spindle more sluggish to make direction reversal behavior ea…
robEllenberg Nov 6, 2017
c260e2f
Fix motion's position tracking error output pin.
robEllenberg Nov 6, 2017
a319ff9
Fix sign reversal in spindle displacement calculation causing hard-st…
robEllenberg Nov 6, 2017
4caa8ee
Add debug scripts to extract spindle data from a tp log file
robEllenberg Nov 6, 2017
f229073
Fix false position tracking error at spindle reversal (needed to rese…
robEllenberg Nov 6, 2017
c6caad2
Increase halscope's shared ram size to collect more samples
robEllenberg Nov 6, 2017
a86485c
Add some missing notes
robEllenberg Nov 7, 2017
43a7e6d
Add max spindle speed check to rigid tapping and factor out some comm…
robEllenberg Nov 8, 2017
52204ad
Fix spindle reversal calculations to avoid jitter and accelerations s…
robEllenberg Nov 8, 2017
3df7165
Add some extraction scripts for TP test logs
robEllenberg Nov 9, 2017
6af640e
Before run, warn if spindle-synched move violates axis limits
zultron Jan 27, 2017
b0e51c6
During G96, plan blends for largest possible spindle speed
robEllenberg Nov 26, 2017
5cd9fd8
Add spindle-specific fields to emcmotCommand rather than reusing othe…
robEllenberg Nov 27, 2017
632639d
Only limit spindle speed during position sync, not velocity sync
robEllenberg Nov 26, 2017
d804e70
Fix linking issue with signum function
robEllenberg Oct 24, 2018
59f8b5b
test: Introduce some optimized configs for manual sim tests.
robEllenberg Jan 28, 2019
4fd8948
test: Add test cases for issue 546 and issue 550
robEllenberg Jan 5, 2019
cdaa086
tp: Add some comments to clarify obscure variable names
robEllenberg Jan 5, 2019
3379d3b
tp: When forcing a pair of motion segments to be tangent, store the "…
robEllenberg Jan 5, 2019
250739c
tp: Fix acceleration violation due to corner case in initialization o…
robEllenberg Jan 5, 2019
b22325f
tp: Fix handling of approximate tangents and required de-rating of ma…
robEllenberg Jan 5, 2019
c99719e
tp: Set flags on next segment when setting terminal condition.
robEllenberg Jan 10, 2019
1dd276c
tp: Refactor tangential vs overall maximum acceleration lookup
robEllenberg Jan 8, 2019
e40858a
Fix some compiler warnings
robEllenberg Jan 10, 2019
87b05bc
tp: Refactor circle maximum velocity / acceleration ratio calculation
robEllenberg Jan 10, 2019
1076ca1
tp: Factor out calculation for peak velocity over a distance.
robEllenberg Jan 11, 2019
e94a7cc
tp: Compute effective radius of helix too.
robEllenberg Jan 12, 2019
ba833b1
tp: Refactor and simplify parallel / anti-parallel checks
robEllenberg Jan 11, 2019
fc11338
unit_test: Add "greatest" unit test framework (C, header-only macro-b…
robEllenberg Jan 11, 2019
8f4109d
blendmath: implement unit tests for new parallel / anti-parallel chec…
robEllenberg Jan 11, 2019
f65a6a9
tp: Move a pmCartesian function into blendmath for use outside of tp.c
robEllenberg Jan 11, 2019
9314f46
tp: Reimplement sharp corner detection using new anti-parallel detection
robEllenberg Jan 11, 2019
0bb8dd4
tp: Simplify kink acceleration calculation to handle negative velocities
robEllenberg Jan 23, 2019
e69556d
Apply minimum displacement checks consistently between canon and TP.
robEllenberg Jan 25, 2019
58dbece
tp: Overhaul debug output with JSON5-formatted log statements.
robEllenberg Jan 25, 2019
e6369f9
tests: Add a stripped down test case for split-cycle debugging
robEllenberg Feb 1, 2019
3991730
tp: Refactor tpCheckEndCondition to isolate computation from TP globa…
robEllenberg Feb 1, 2019
0dffa56
tp: Move split cycle function to blendmath file and simplify logic
robEllenberg Feb 1, 2019
ce83fb6
Handle pure-angular moves consistently between canon and TP
robEllenberg Feb 1, 2019
5662ea9
tp: Simplify logic in split-cycle update
robEllenberg Feb 1, 2019
ed89b6d
tp: Simplify debug output and present more useful info
robEllenberg Feb 1, 2019
5796a12
tp: Factor out accel scale calculation
robEllenberg Feb 6, 2019
960b5d7
tp: Extend JSON5 debug output to include some spindle-sync information
robEllenberg Feb 6, 2019
b05d666
tp: Fix effective radius curvature formula.
robEllenberg Feb 5, 2019
21def12
canon: Fix a mistaken unit conversion of normal axis unit vector in c…
robEllenberg Feb 5, 2019
f0e1598
tp: Use already-calculated max normal acceleration from canon for opt…
robEllenberg Feb 5, 2019
fb96f53
tp: convert more debug outputs to JSON5 format
robEllenberg Feb 6, 2019
7c84c0b
tp: don't try to compute blend velocity for segments that don't parab…
robEllenberg Feb 6, 2019
25ea5d9
tests: Add XYZ velocity plot to log parser
robEllenberg Feb 5, 2019
075d757
test: Add some TP test cases for optimal circle velocity / acceleration
robEllenberg Feb 5, 2019
3f81bc2
tests: Add an ignore file for generated files from TP debugging
robEllenberg Feb 5, 2019
67508fe
test: clean up old octave scripts and fix up broken / missing functio…
robEllenberg Feb 5, 2019
91de43e
motion: Catch and propagate failures to set TP position / velocity in…
robEllenberg Feb 5, 2019
bdeae75
tp: Add position mismatch check when starting a motion segment
robEllenberg Feb 5, 2019
0b65e70
tp: Convert debug output for spiral arc length fit to JSON5
robEllenberg Feb 6, 2019
2b16c20
test: Provide common setup subroutines and clean up old TP test programs
robEllenberg Feb 6, 2019
75029f0
tp: Clean up some more warnings
robEllenberg Feb 7, 2019
a13f89a
Extend blendmath unit tests to include test cases for end condition c…
robEllenberg Feb 7, 2019
bb05bb1
Add an inline wrapper function to extract max accel from emcmotDebug
robEllenberg Feb 7, 2019
84234e4
tp: migrate more debug output to use new JSON5 printing
robEllenberg Feb 7, 2019
03a2129
Add default conditions to a TP test case
robEllenberg Feb 7, 2019
59edeb7
tp: add some skeletal unit tests for joint_utils and spherical_arc
robEllenberg Feb 7, 2019
3e19ce0
tp: add a test for the ray intersection check
robEllenberg Feb 8, 2019
d2bf890
tp: Clean up some pedantic warnings about default cases
robEllenberg Feb 8, 2019
7954719
tp: Factor out code handling spindle-sync into a separate function
robEllenberg Feb 8, 2019
249016b
greatest: Tweak the console output to be more gcc-like
robEllenberg Feb 18, 2019
2d0555e
posemath: Overhaul and extend unit tests
robEllenberg Feb 8, 2019
acfdc67
canon: Fix a pedantic unused variable warning
robEllenberg Feb 14, 2019
26e00c1
posemath: Remove extraneous semicolons from definitions in posemath
robEllenberg Feb 19, 2019
8eecb7f
tp: Pedantic rename of a function to match its result
robEllenberg Feb 19, 2019
42183fd
tp: Remove an unnecessary special case in tangent angle check
robEllenberg Feb 19, 2019
259aa40
tp: Add more unit tests for blendmath
robEllenberg Feb 19, 2019
833bdc9
unit_test: Document setup for unit test build in README
robEllenberg Feb 19, 2019
089dee6
Make greatest float printing more precise to help troubleshoot numeri…
robEllenberg Feb 20, 2019
8e1ac6b
tp: make TP axis limit error checks more robust
robEllenberg Mar 1, 2019
f976b2f
tp: remove some obsolete debug output (to be replaced with unit testing)
robEllenberg Mar 1, 2019
78e2c0c
tp: refactor TP functional tests to run headless
robEllenberg Mar 1, 2019
bc7d510
tp: Control new consistency checks with INI file settings to avoid co…
robEllenberg Feb 28, 2019
ce4f630
test: Functional tests for TP from NGC snippets known to reproduce pa…
robEllenberg Mar 1, 2019
e82b64c
test: remove an unused config file from previous versions of test con…
robEllenberg Mar 1, 2019
c8b7a68
unit_test: add some new cases for end condition check
robEllenberg Mar 1, 2019
f8bb8b1
tp: hide some pedantic debug output that screws with unit tests
robEllenberg Mar 5, 2019
a88fd7b
unit_test: add an assert macro to compare PmCartesians
robEllenberg Mar 5, 2019
563fef4
tp: add more test cases for PmCircles with helix / spiral components
robEllenberg Mar 5, 2019
d41eb13
unit_test: convert more PmCartesian asserts to use macro rather than …
robEllenberg Mar 5, 2019
053beeb
posemath: Fix pointer type mismatches in posemath error messages
robEllenberg Mar 5, 2019
742cc2a
motion: Convert #defines to enums
robEllenberg Mar 5, 2019
4bcd4d7
Fix some formatting mismatches between other branches for easier merg…
robEllenberg May 1, 2019
de22494
Restore a debug message in case of future issues with zero-length moves
robEllenberg May 1, 2019
ea2be46
unit_test: convert more asserts to produce GCC-style output
robEllenberg Mar 12, 2019
5a815e0
unit_test: Hide pedantic debug ouput by default in unit tests
robEllenberg Mar 12, 2019
a77ea52
Merge branch 'bugfixes-546-550-167-68-164-2.7' into 2.7
robEllenberg May 1, 2019
b515f12
tp: fix missing symbol
robEllenberg May 1, 2019
24e6a35
Fix runtests for TP consistency checks
robEllenberg May 1, 2019
dd22d36
canon: fix feed rate problem in arc corner case
zultron Apr 18, 2018
0d08b10
Fix formatting inconsistencies in canon
robEllenberg May 1, 2019
fa8c17d
canon: fix a merge / rebase error that dropped a variable rename in a…
robEllenberg May 1, 2019
347a6b5
Fixup 80c92580: update motion-logger/basic test
zultron Apr 18, 2018
7f1fa9f
Fix an illegal declaration in C89
robEllenberg May 3, 2019
a0e15b6
Another C99 issue to satisfy travis (can we move to C99 already?)
robEllenberg May 3, 2019
032b9cb
Merge branch '2.7' into rellenberg/bugfixes-546-550-167-68-164-for-2.7
andypugh Dec 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -40,3 +40,8 @@ oprofile*
position.txt
*.9
*.glade.h

*.glade.h
# expanded INI files
*.ini.expanded
build
11 changes: 11 additions & 0 deletions README
Expand Up @@ -46,3 +46,14 @@ to run the software go back to the top level directory, and issue:

. scripts/rip-environment
linuxcnc


Unit Tests
---------

Building unit tests requires Meson (see https://mesonbuild.com/Getting-meson.html for details).

To build and run the unit tests (from the repositor root directory):

meson build && cd build
ninja test
3 changes: 0 additions & 3 deletions lib/hallib/core_sim9.hal
Expand Up @@ -6,9 +6,6 @@ loadrt trivkins
# motion controller, get name and thread periods from ini file
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
# load 6 differentiators (for velocity and accel signals
loadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv
# load additional blocks
loadrt hypot names=vel_xy,vel_xyz

# add motion controller functions to servo thread
addf motion-command-handler servo-thread
Expand Down
29 changes: 22 additions & 7 deletions lib/hallib/sim_spindle_encoder.hal
Expand Up @@ -5,26 +5,39 @@ setp sim_spindle.scale 0.01666667
loadrt limit2 names=limit_speed
loadrt lowpass names=spindle_mass
loadrt near names=near_speed
loadrt quant names=sim_spindle_encoder,spindle_vel_est

# this limit doesnt make any sense to me:
# Bound spindle acceleration to something reasonable
setp limit_speed.maxv 5000.0 # rpm/second

# encoder reset control
# hook up motion controller's sync output
net spindle-index-enable motion.spindle-index-enable <=> sim_spindle.index-enable

# Set resolution of spindle encoder in counts / revolution (Note: this value is 4 * LPR or PPR)
setp sim_spindle_encoder.resolution 64.0

# Simulated spindle encoder
net spindle-pos-raw sim_spindle.position-fb => sim_spindle_encoder.in

# report our revolution count to the motion controller
net spindle-pos sim_spindle.position-fb => motion.spindle-revs
net spindle-pos sim_spindle_encoder.out => motion.spindle-revs

# simulate spindle mass
setp spindle_mass.gain .07
setp spindle_mass.gain .005

# spindle speed control
# Limit spindle speed by our maximum value
net spindle-speed-cmd motion.spindle-speed-out => limit_speed.in
net spindle-speed-limited limit_speed.out => sim_spindle.velocity-cmd spindle_mass.in

# for spindle velocity estimate
net spindle-rpm-filtered spindle_mass.out motion.spindle-speed-in near_speed.in2
# Simulate spindle mass with a low-pass filter on the velocity command
net spindle-speed-limited limit_speed.out => spindle_mass.in

# Feed the simulated spindle speed into the sim spindle to generate a position signal
net spindle-rpm-filtered spindle_mass.out => sim_spindle.velocity-cmd near_speed.in2 spindle_vel_est.in

# Approximate velocity quantization assuming 360 RPM, 30kHz base thread, 100 PPR encoder
setp spindle_vel_est.resolution 8.0
net spindle-rpm-est spindle_vel_est.out => motion.spindle-speed-in

# at-speed detection
setp near_speed.scale 1.1
Expand All @@ -37,3 +50,5 @@ addf limit_speed servo-thread
addf spindle_mass servo-thread
addf near_speed servo-thread
addf sim_spindle servo-thread
addf sim_spindle_encoder servo-thread
addf spindle_vel_est servo-thread
40 changes: 40 additions & 0 deletions lib/python/rs274/glcanon.py
Expand Up @@ -49,6 +49,8 @@ def __init__(self, colors, geometry, is_foam=0):
self.arcfeed = []; self.arcfeed_append = self.arcfeed.append
# dwell list - [line number, color, pos x, pos y, pos z, plane]
self.dwells = []; self.dwells_append = self.dwells.append
# spindle-synched feed list - (line number, (position deltas), S, fpr)
self.feed_synched = []
self.choice = None
self.feedrate = 1
self.lo = (0,) * 9
Expand Down Expand Up @@ -162,6 +164,32 @@ def calc_extents(self):
self.min_extents_notool[0], self.min_extents_notool[1], min_z
self.max_extents_notool = \
self.max_extents_notool[0], self.max_extents_notool[1], max_z
def calc_velocity(self, delta, axis_max_vel):
"""Using techniques from getStraightVelocity() in emccanon.cc, given 9
axis deltas and velocity limits, calculate max velocity of a
straight move; deltas should be absolute; invalid axes should be 0
"""
# Clean up tiny values
delta = tuple([(0.0 if i<1e-7 else i) for i in delta])
# Fastest time of coordinated move is the maximum time of any
# one axis to perform move at axis max velocity
tmax = max([(i[0]/i[1] if i[1] else 0.0)
for i in zip(delta, axis_max_vel)])
# Total distance is the hypotenuse of a set of three axes;
# which set depends on the type of move
if sum(delta[0:3]) > 0:
# Linear XYZ with or without ABC or UVW
dtot = math.sqrt(sum(i*i for i in delta[0:3]))
elif sum(delta[6:9]) > 0:
# Linear UVW without XYZ and with or without ABC
dtot = math.sqrt(sum(i*i for i in delta[6:9]))
else:
# Angular-only
dtot = math.sqrt(sum(i*i for i in delta[3:6]))
# Max velocity = total distance / fastest time
max_vel = dtot/tmax
return max_vel

def tool_offset(self, xo, yo, zo, ao, bo, co, uo, vo, wo):
self.first_move = True
x, y, z, a, b, c, u, v, w = self.lo
Expand Down Expand Up @@ -230,6 +258,18 @@ def straight_feed(self, x,y,z, a,b,c, u, v, w):
self.lo = l
straight_probe = straight_feed

def straight_feed_synched(self, lineno, x,y,z, a,b,c, u,v,w, s, fpr):
"""For spindle-synched straight feeds, also collect data needed to
check if the commanded spindle rate and feed per revolution
will violate any axis MAX_VELOCITY constraints"""
if self.suppress > 0: return
# save segment start and record straight feed segment
lo = self.lo
self.straight_feed(x,y,z, a,b,c, u, v, w)
# record axis distances, spindle speed and feed per revolution
delta = tuple([abs(i[0]-i[1]) for i in zip(lo, self.lo)])
self.feed_synched.append((lineno, delta, s, fpr))

def user_defined_function(self, i, p, q):
if self.suppress > 0: return
color = self.colors['m1xx']
Expand Down
46 changes: 35 additions & 11 deletions meson.build
Expand Up @@ -5,36 +5,60 @@ tp_src_dir = join_paths(src_root, 'emc/tp')

inc_dir = include_directories([
'unit_tests',
'unit_tests/mock',
src_root,
join_paths(src_root, 'emc/kinematics'),
tp_src_dir,
'src/libnml/posemath',
'src/emc/nml_intf',
'src/emc/motion',
'src/rtapi',
'src/hal',
])

cc = meson.get_compiler('c')
m_dep = cc.find_library('m', required : true)

add_global_arguments(['-DULAPI','-DUNIT_TEST'], language : 'c')

pm = static_library('posemath',
# Define static libraries for easier linking with unit tests

posemath_obj = static_library('posemath',
'src/libnml/posemath/_posemath.c',
include_directories : inc_dir)
include_directories : inc_dir,
dependencies : [m_dep]
)

# TODO implement subdir builds for tp, motion, etc
emcpose_obj = static_library('emcpose',
join_paths(src_root, 'emc/nml_intf/emcpose.c'),
include_directories : inc_dir
)

# KLUDGE just shove all the source files into the test build
test_blendmath=executable('test_blendmath',
['unit_tests/tp/test_blendmath.c',
utlib_tp_deps = static_library('tp_deps',
[
join_paths(tp_src_dir, 'joint_util.c'),
join_paths(tp_src_dir, 'blendmath.c'),
join_paths(tp_src_dir, 'spherical_arc.c'),
join_paths(src_root, 'emc/nml_intf/emcpose.c'),
join_paths(tp_src_dir, 'tc.c'),
],
join_paths(tp_src_dir, 'tcq.c'),
],
include_directories : inc_dir,
link_with: [emcpose_obj, posemath_obj])

tp_test_files = [
'test_blendmath',
'test_joint_util',
'test_spherical_arc',
'test_posemath'
]

foreach n : tp_test_files

test(n, executable(n,
join_paths('unit_tests/tp', n+'.c'),
dependencies : [m_dep],
include_directories : inc_dir,
link_with : pm
)
link_with : [ utlib_tp_deps]
))
endforeach

test('blendmath test',test_blendmath)
2 changes: 2 additions & 0 deletions src/Makefile
Expand Up @@ -942,6 +942,8 @@ motmod-objs += emc/tp/tcq.o
motmod-objs += emc/tp/tp.o
motmod-objs += emc/tp/spherical_arc.o
motmod-objs += emc/tp/blendmath.o
motmod-objs += emc/tp/math_util.o
motmod-objs += emc/tp/joint_util.o
motmod-objs += emc/motion/motion.o
motmod-objs += emc/motion/command.o
motmod-objs += emc/motion/control.o
Expand Down
8 changes: 8 additions & 0 deletions src/emc/ini/initraj.cc
Expand Up @@ -193,6 +193,14 @@ static int loadTraj(EmcIniFile *trajInifile)
old_inihal_data.traj_arc_blend_tangent_kink_ratio = arcBlendTangentKinkRatio;
//TODO update inihal

int extraConsistencyChecks = 0;
double maxPositionDriftError = 0.0001;

trajInifile->Find(&extraConsistencyChecks, "EXTRA_CONSISTENCY_CHECKS", "TRAJ");
trajInifile->Find(&maxPositionDriftError, "MAX_POSITION_DRIFT_ERROR", "TRAJ");

emcSetupConsistencyChecks(extraConsistencyChecks, maxPositionDriftError);

double maxFeedScale = 1.0;
trajInifile->Find(&maxFeedScale, "MAX_FEED_OVERRIDE", "DISPLAY");

Expand Down
13 changes: 10 additions & 3 deletions src/emc/motion-logger/motion-logger.c
Expand Up @@ -571,13 +571,14 @@ int main(int argc, char* argv[]) {
break;

case EMCMOT_SPINDLE_ON:
log_print("SPINDLE_ON speed=%f, css_factor=%f, xoffset=%f\n", c->vel, c->ini_maxvel, c->acc);
emcmotStatus->spindle.speed = c->vel;
log_print("SPINDLE_ON speed=%f, css_factor=%f, xoffset=%f\n",
c->spindle_speed, c->css_factor, c->css_xoffset);
emcmotStatus->spindle_cmd.velocity_rpm_out = c->spindle_speed;
break;

case EMCMOT_SPINDLE_OFF:
log_print("SPINDLE_OFF\n");
emcmotStatus->spindle.speed = 0;
emcmotStatus->spindle_cmd.velocity_rpm_out = 0;
break;

case EMCMOT_SPINDLE_INCREASE:
Expand Down Expand Up @@ -625,6 +626,12 @@ int main(int argc, char* argv[]) {
log_print("SETUP_ARC_BLENDS\n");
break;

case EMCMOT_SETUP_CONSISTENCY_CHECKS:
log_print("SETUP_CONSISTENCY_CHECKS enabled=%d, position_drift=%f\n",
c->consistencyCheckConfig.extraConsistencyChecks,
c->consistencyCheckConfig.maxPositionDriftError);
break;

default:
log_print("ERROR: unknown command %d\n", c->command);
break;
Expand Down