Skip to content

Commit 2e8f4d3

Browse files
committed
Multispindle: Further docs updates
Signed-off-by: andy pugh <andy@bodgesoc.org>
1 parent 1343487 commit 2e8f4d3

8 files changed

Lines changed: 78 additions & 45 deletions

File tree

docs/src/config/core-components.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ These pins, parameters, and functions are created by the realtime
156156
limits. The value on this pin does not reflect the feed override or
157157
any other adjustments.
158158

159-
* 'spindle.N.at-speed' -
159+
* 'spindle.0.at-speed' -
160160
(bit, in) Motion will pause until this pin is TRUE, under the
161161
following conditions: before the first feed move after each spindle
162162
start or speed change; before the start of every chain of
@@ -262,22 +262,22 @@ Conceptually the spindle is in one of the following modes:
262262
- orienation complete mode.
263263

264264
When an M19 is executed, the spindle changes to 'searching for desired
265-
orientation' , and the `spindle-orient` HAL pin is asserted. The
266-
desired target position is specified by the `spindle-orient-angle` and
267-
`spindle-orient-fwd` pins and driven by the M19 R and P parameters.
265+
orientation' , and the `spindle.N.orient` HAL pin is asserted. The
266+
desired target position is specified by the `spindle.N.orient-angle` and
267+
`spindle.N.orient-fwd` pins and driven by the M19 R and P parameters.
268268

269-
The HAL support logic is expected to react to `spindle-orient` by
269+
The HAL support logic is expected to react to `spindle.N.orient` by
270270
moving the spindle to the desired position. When this is complete, the
271271
HAL logic is expected to acknowledge this by asserting the
272-
`spindle-is-oriented` pin.
272+
`spindle.N.is-oriented` pin.
273273

274-
Motion then acknowledges this by deasserting the `spindle-orient` pin
275-
and asserts the `spindle-locked` pin to indicate 'orientation
276-
complete' mode. It also raises the `spindle-brake` pin. The spindle now
274+
Motion then acknowledges this by deasserting the `spindle.N.orient` pin
275+
and asserts the `spindle.N.locked` pin to indicate 'orientation
276+
complete' mode. It also raises the `spindle.N.brake` pin. The spindle now
277277
is in 'orientation complete' mode.
278278

279-
If, during `spindle-orient` being true, and `spindle-is-oriented` not
280-
yet asserted the `spindle-orient-fault` pin has a value other than
279+
If, during `spindle.N.orient` being true, and `spindle.N.is-oriented` not
280+
yet asserted the `spindle.N.orient-fault` pin has a value other than
281281
zero, the M19 command is aborted, a message including the fault code
282282
is displayed, and the motion queue is flushed. The spindle reverts to
283283
rotation mode.

docs/src/config/stepper.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
101101
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
102102

103103
# connect "spindle on" motion controller pin to a physical pin
104-
net spindle-on spindle.N.on => parport.0.pin-09-out
104+
net spindle-on spindle.0.on => parport.0.pin-09-out
105105

106106
###
107107
### You might use something like this to enable chopper drives when machine ON
@@ -215,8 +215,8 @@ component to create the signal:
215215
loadrt pwmgen output_type=0
216216
addf pwmgen.update servo-thread
217217
addf pwmgen.make-pulses base-thread
218-
net spindle-speed-cmd spindle.N.speed-out => pwmgen.0.value
219-
net spindle-on spindle.N.on => pwmgen.0.enable
218+
net spindle-speed-cmd spindle.0.speed-out => pwmgen.0.value
219+
net spindle-on spindle.0.on => pwmgen.0.enable
220220
net spindle-pwm pwmgen.0.pwm => parport.0.pin-09-out
221221
setp pwmgen.0.scale 1800 # Change to your spindle’s top speed in RPM
222222
----

docs/src/config/stepper_fr.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
124124
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
125125

126126
# connect "spindle on" motion controller pin to a physical pin
127-
net spindle-on spindle.N.on => parport.0.pin-09-out
127+
net spindle-on spindle.0.on => parport.0.pin-09-out
128128

129129
###
130130
### You might use something like this to enable chopper drives when machine ON
@@ -239,7 +239,7 @@ loadrt pwmgen output_type=0
239239
addf pwmgen.update servo-thread
240240
addf pwmgen.make-pulses base-thread
241241
net spindle-speed-cmd spindle.N.speed-out => pwmgen.0.value
242-
net spindle-on spindle.N.on => pwmgen.0.enable
242+
net spindle-on spindle.0.on => pwmgen.0.enable
243243
net spindle-pwm pwmgen.0.pwm => parport.0.pin-09-out
244244
setp pwmgen.0.scale 1800 # Change to your spindle’s top speed in RPM
245245
----

docs/src/drivers/vfs11.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,17 @@ POLLCYCLES=10
258258
loadusr -Wn spindle-vfd vfs11_vfd -n spindle-vfd
259259

260260
# connect the spindle direction pins to the VFD
261-
net vfs11-fwd spindle-vfd.spindle-fwd <= spindle.N.forward
262-
net vfs11-rev spindle-vfd.spindle-rev <= spindle.N.reverse
261+
net vfs11-fwd spindle-vfd.spindle-fwd <= spindle.0.forward
262+
net vfs11-rev spindle-vfd.spindle-rev <= spindle.0.reverse
263263

264264
# connect the spindle on pin to the VF-S11
265-
net vfs11-run spindle-vfd.spindle-on <= spindle.N.on
265+
net vfs11-run spindle-vfd.spindle-on <= spindle.0.on
266266

267267
# connect the VF-S11 at speed to the motion at speed
268-
net vfs11-at-speed spindle.N.at-speed <= spindle-vfd.at-speed
268+
net vfs11-at-speed spindle.0.at-speed <= spindle-vfd.at-speed
269269

270270
# connect the spindle RPM to the VF-S11
271-
net vfs11-RPM spindle-vfd.speed-command <= spindle.N.speed-out
271+
net vfs11-RPM spindle-vfd.speed-command <= spindle.0.speed-out
272272

273273
# connect the VF-S11 DC brake
274274
# since this draws power during spindle off, the dc-brake pin would
@@ -277,7 +277,7 @@ net vfs11-RPM spindle-vfd.speed-command <= spindle.N.speed-out
277277

278278
# to use the VFS11 jog mode for spindle orient
279279
# see orient.9 and motion.9
280-
net spindle-orient spindle.N.orient spindle-vfd.max-speed spindle-vfd.jog-mode
280+
net spindle-orient spindle.0.orient spindle-vfd.max-speed spindle-vfd.jog-mode
281281

282282
# take precedence over control panel
283283
setp spindle-vfd.enable 1

docs/src/examples/gs2_example_fr.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ GS2 et avoir le contrôle de celui-ci depuis l'interface utilisateur.
2323
loadusr -Wn spindle-vfd gs2_vfd -n spindle-vfd
2424

2525
# connecter la pin de direction au variateur
26-
net gs2-fwd spindle-vfd.spindle-fwd <= spindle.N.forward
26+
net gs2-fwd spindle-vfd.spindle-fwd <= spindle.0.forward
2727

2828
# connecter la pin de Marche/Arrêt au variateur
29-
net gs2-run spindle-vfd.spindle-on <= spindle.N.on
29+
net gs2-run spindle-vfd.spindle-on <= spindle.0.on
3030

3131
# connecter la pin indiquant que la consigne vitesse est atteinte
3232
net gs2-at-speed spindle.N.at-speed <= spindle-vfd.at-speed
3333

3434
# connecter la commande de vitesse au variateur
35-
net gs2-RPM spindle-vfd.speed-command <= spindle.N.speed-out
35+
net gs2-RPM spindle-vfd.speed-command <= spindle.0.speed-out
3636
----
3737

3838
Sur le variateur de fréquence lui même, il est nécessaire de fixer quelques

docs/src/examples/spindle.txt

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
[[cha:spindle-control]]
22

3+
LinuxCNC can control up to 8 spindles. The number is set in the INI file.
4+
The examples below all refer to a single-spindle config with spindle
5+
control pins with names like spindle.0...
6+
In the case of a multiple spindle machine all that changes is that
7+
additional pins exist with names such as spindle.6...
8+
39
= Spindle Control
410

511
(((0-10v Spindle Speed Example)))
@@ -24,7 +30,7 @@ card does not do scaling.
2430
loadrt scale count=1
2531
addf scale.0 servo-thread
2632
setp scale.0.gain 0.002
27-
net spindle-speed-scale spindle.N.speed-out => scale.0.in
33+
net spindle-speed-scale spindle.0.speed-out => scale.0.in
2834
net spindle-speed-DAC scale.0.out => <your DAC pin name>
2935
----
3036

@@ -39,8 +45,8 @@ use the pwmgen component to create the signal:
3945
loadrt pwmgen output_type=0
4046
addf pwmgen.update servo-thread
4147
addf pwmgen.make-pulses base-thread
42-
net spindle-speed-cmd spindle.N.speed-out => pwmgen.0.value
43-
net spindle-on spindle.N.on => pwmgen.0.enable
48+
net spindle-speed-cmd spindle.0.speed-out => pwmgen.0.value
49+
net spindle-on spindle.0.on => pwmgen.0.enable
4450
net spindle-pwm pwmgen.0.pwm => parport.0.pin-09-out
4551
# Set the spindle's top speed in RPM
4652
setp pwmgen.0.scale 1800
@@ -56,7 +62,7 @@ nist-lathe sample configuration to use a scale component.
5662
== Spindle Enable
5763

5864
If you need a spindle enable signal,
59-
link your output pin to spindle.N.on.
65+
link your output pin to spindle.0.on.
6066
To link these pins to a parallel port pin put something like
6167
the following in your .hal file, making sure you pick the
6268
pin that is connected to your control device.
@@ -79,8 +85,8 @@ following in your .hal file making sure you pick the pin that is
7985
connected to your control device.
8086

8187
----
82-
net spindle-fwd spindle.N.forward => parport.0.pin-16-out
83-
net spindle-rev spindle.N.reverse => parport.0.pin-17-out
88+
net spindle-fwd spindle.0.forward => parport.0.pin-16-out
89+
net spindle-rev spindle.0.reverse => parport.0.pin-17-out
8490
----
8591

8692
(((Spindle Soft Start Example)))
@@ -96,7 +102,7 @@ second part is to let LinuxCNC know when the spindle is at speed so motion
96102
can begin.
97103

98104
In the 0-10 volt example the line
99-
'net spindle-speed-scale spindle.N.speed-out => scale.0.in'
105+
'net spindle-speed-scale spindle.0.speed-out => scale.0.in'
100106
is changed as shown in the following example:
101107

102108
.Intro to HAL components limit2 and near:
@@ -130,7 +136,7 @@ addf spindle-at-speed servo-thread
130136
setp spindle-ramp.maxv 60
131137

132138
# hijack the spindle speed out and send it to spindle ramp in
133-
net spindle-cmd <= spindle.N.speed-out => spindle-ramp.in
139+
net spindle-cmd <= spindle.0.speed-out => spindle-ramp.in
134140

135141
# the output of spindle ramp is sent to the scale in
136142
net spindle-ramped <= spindle-ramp.out => scale.0.in
@@ -142,9 +148,9 @@ net spindle-ramped <= spindle-ramp.out => scale.0.in
142148
net spindle-cmd => spindle-at-speed.in1
143149
net spindle-ramped => spindle-at-speed.in2
144150

145-
# the output from spindle-at-speed is sent to spindle.N.at-speed
151+
# the output from spindle-at-speed is sent to spindle.0.at-speed
146152
# and when this is true motion will start
147-
net spindle-ready <= spindle-at-speed.out => spindle.N.at-speed
153+
net spindle-ready <= spindle-at-speed.out => spindle.0.at-speed
148154
----
149155

150156
== Spindle Feedback
@@ -154,9 +160,14 @@ net spindle-ready <= spindle-at-speed.out => spindle.N.at-speed
154160
=== Spindle Synchronized Motion
155161

156162
Spindle feedback is needed by LinuxCNC to perform any spindle coordinated
157-
motions like threading and constant surface speed. The StepConf Wizard
158-
can perform the connections for you if you select Encoder Phase A and
159-
Encoder Index as inputs.
163+
motions like threading and constant surface speed.
164+
LinuxCNC can perform synchronised motion and CSS with any of up to 8
165+
spindles. Which spindles are used is controlled from G-code. CSS is
166+
possible with several spindles simultaneously.
167+
168+
The StepConf Wizard can perform the connections for a single-spindle
169+
configuration for you if you select Encoder Phase A and Encoder Index as
170+
inputs.
160171

161172
Hardware assumptions:
162173

@@ -189,8 +200,8 @@ setp encoder.3.position-scale 100
189200
setp encoder.3.counter-mode true
190201

191202
# connect the HAL encoder outputs to LinuxCNC.
192-
net spindle-position encoder.3.position => spindle.N.revs
193-
net spindle-velocity encoder.3.velocity => spindle.N.speed-in
203+
net spindle-position encoder.3.position => spindle.0.revs
204+
net spindle-velocity encoder.3.velocity => spindle.0.speed-in
194205
net spindle-index-enable encoder.3.index-enable <=> spindle.N.index-enable
195206

196207
# connect the HAL encoder inputs to the real encoder.
@@ -204,11 +215,11 @@ net spindle-index encoder.3.phase-Z <= parport.0.pin-11-in
204215
=== Spindle At Speed
205216

206217
To enable LinuxCNC to wait for the spindle to be at speed before executing
207-
a series of moves you need to set spindle.N.at-speed to true when
218+
a series of moves. You need to set spindle.N.at-speed to true when
208219
the spindle is at the commanded speed. To do this you need spindle
209220
feedback from an encoder. Since the feedback and the commanded speed
210-
are not usually 'exactly' the same you need to use the 'near'
211-
component to say that the two numbers are close enough.
221+
are not usually 'exactly' the same you should to use the 'near'
222+
component to determine that the two numbers are close enough.
212223

213224
The connections needed are from the spindle
214225
velocity command signal to near.n.in1 and from the spindle velocity
@@ -235,7 +246,7 @@ net spindle-cmd => near.0.in1
235246
net spindle-velocity => near.0.in2
236247

237248
# connect the output to the spindle-at-speed input
238-
net spindle-at-speed spindle.N.at-speed <= near.0.out
249+
net spindle-at-speed spindle.0.at-speed <= near.0.out
239250

240251
# set the spindle speed inputs to agree if within 1%
241252
setp near.0.scale 1.01

docs/src/gcode/machining-center.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ to Y, and C rotates around a line parallel to Z.
5151
A CNC machine typically has a spindle which holds one cutting tool,
5252
probe, or the material in the case of a lathe. The spindle may or may
5353
not be controlled by the CNC software.
54+
LinuxCNC offers suport for up to 8 spindles, which can be individually
55+
controlled and can run simultaneously at different speeds and in different
56+
directions.
5457

5558
=== Coolant (((coolant)))
5659

docs/src/getting-started/updating-linuxcnc.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,25 @@ configurations include:
215215
The following subsections and the section for 'Hal Changes' list items that
216216
may require additional user edits to ini or hal files.
217217

218+
=== Multiple Spindle Support
219+
220+
LinuxCNC now supports up to 8 spindles (and can be recompiled for more)
221+
Existing G-code will run without modification and most configurations
222+
will default to single spindles. To add spindles both the "num_spindles"
223+
modparam to the motion module in the HAL file and the [TRAJ]SPINDLES
224+
entry in the INI file should be changed/added to choose the required
225+
number. These /must/ match.
226+
The spindle control pin names have been changed to make spindles look
227+
more like axes and joints. motion.spindle-speed-out is now spindle.0.speed-out
228+
for example. The automatic update script will take care of these changes.
229+
To control extra spindles the G and M-codes which control spindle speed
230+
now accept an additional "$" argument, for example M3 $2 to start the
231+
third spindle. "$" was chosen to avoid clashes with any existing code
232+
letters. It should be possible to create custom G-codes to match any
233+
other multi-spindle controller.
234+
See the G-code and M-code manuals for code changes, and man motion for
235+
the HAL pin changes.
236+
218237
=== TRAJ velocities, accelerations names
219238

220239
With incorporation of joints_axes functionality, some names were
@@ -932,7 +951,7 @@ purpose.
932951

933952
=== Post-joints_axes
934953

935-
With the incorporation of joints_axes functionality, may sims provided
954+
With the incorporation of joints_axes functionality, many sims provided
936955
in the distribution now take advantage of a general purpose halfile that
937956
supports numerous configurations automatically. A typical sim config
938957
HALFILE specification is:

0 commit comments

Comments
 (0)