dodalem probe basic
This commit is contained in:
39
configs/probe_basic/hallib/sim_spindle_encoder.hal
Normal file
39
configs/probe_basic/hallib/sim_spindle_encoder.hal
Normal file
@@ -0,0 +1,39 @@
|
||||
# simulated spindle encoder (for spindle-synced moves)
|
||||
loadrt sim_spindle names=sim_spindle
|
||||
setp sim_spindle.scale 0.01666667
|
||||
|
||||
loadrt limit2 names=limit_speed
|
||||
loadrt lowpass names=spindle_mass
|
||||
loadrt near names=near_speed
|
||||
|
||||
# this limit doesnt make any sense to me:
|
||||
setp limit_speed.maxv 5000.0 # rpm/second
|
||||
|
||||
# encoder reset control
|
||||
# hook up motion controller's sync output
|
||||
net spindle-index-enable spindle.0.index-enable <=> sim_spindle.index-enable
|
||||
|
||||
# report our revolution count to the motion controller
|
||||
net spindle-pos sim_spindle.position-fb => spindle.0.revs
|
||||
|
||||
# simulate spindle mass
|
||||
setp spindle_mass.gain .07
|
||||
|
||||
# spindle speed control
|
||||
net spindle-speed-cmd spindle.0.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 spindle.0.speed-in near_speed.in2
|
||||
|
||||
# at-speed detection
|
||||
setp near_speed.scale 1.1
|
||||
setp near_speed.difference 10
|
||||
|
||||
net spindle-speed-cmd => near_speed.in1
|
||||
net spindle-at-speed near_speed.out spindle.0.at-speed
|
||||
|
||||
addf limit_speed servo-thread
|
||||
addf spindle_mass servo-thread
|
||||
addf near_speed servo-thread
|
||||
addf sim_spindle servo-thread
|
||||
Reference in New Issue
Block a user