Skip to content

Commit 9ca2b5c

Browse files
committed
Started cleaning up latency-test.adoc, removing redundancies in pncconf.adoc and stepconf.adoc
1 parent 705e046 commit 9ca2b5c

File tree

5 files changed

+51
-100
lines changed

5 files changed

+51
-100
lines changed

docs/src/config/pncconf.adoc

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -51,41 +51,26 @@ You can also launch it from the main menu by using the Configuration Selector 'L
5151
image::images/pncconf-basic.png["PnCconf Basic machine information"]
5252

5353
Machine Basics::
54-
If you use a name with spaces PnCconf will replace the spaces with underscore
55-
(as a loose rule Linux doesn't like spaces in names)
56-
Pick an axis configuration - this selects what type of machine you are building and what axes are available.
57-
The Machine units selector allows data entry of metric or imperial units in the following pages.
54+
If you use a name with spaces PnCconf will replace the spaces with underscores
55+
(as a loose rule Linux doesn't like spaces in names).
56+
Picking an axis configuration selects what type of machine you are building and what axes are available.
57+
The "Machine units" selector allows data entry of metric or imperial units in later steps in the configuration process.
5858

5959
TIP: Defaults are not converted when using metric so make sure they are sane values!
6060

6161
Computer Response Time::
6262

6363
The servo period sets the heart beat of the system.
64-
Latency refers to the amount of time the computer can be longer then that period.
65-
Just like a railroad, LinuxCNC requires everything on a very tight and consistent time line or bad things happen.
66-
LinuxCNC requires and uses a 'real time' operating system, which just means it has a low latency ( lateness ) response time
67-
when LinuxCNC requires its calculations and when doing LinuxCNCs calculations it cannot be interrupted by lower priority requests (such as user input to screen buttons or drawing etc).
68-
69-
Testing the latency is very important and a key thing to check early.
70-
Luckily by using the Mesa card to do the work that requires the fastest response time (encoder counting and PWM generation) we can endure a lot more latency then if we used the parallel port for these things.
71-
The standard test in LinuxCNC is checking the BASE period latency (even though we are not using a base period).
72-
If you press the 'test base period jitter' button, this launches the latency test window ( you can also load this directly from the applications/cnc panel ).
73-
The test mentions to run it for a few minutes but the longer the better.
74-
Consider 15 minutes a bare minimum and overnight even better.
75-
At this time use the computer to load things, use the net, use USB etc we want to know the worst case latency and to find out if any particular activity hurts our latency.
76-
We need to look at base period jitter.
77-
Anything under 20000 is excellent - you could even do fast software stepping with the machine 20000 - 50000 is still good for software stepping and fine for us.
78-
50000 - 100000 is really not that great but could still be used with hardware cards doing the fast response stuff.
79-
So anything under 100000 is usable to us.
80-
If the latency is disappointing or you get a bad hiccup periodically you may still be able to improve it.
81-
82-
TIP: There is a user compiled list of equipment and the latency obtained on the LinuxCNC wiki: https://wiki.linuxcnc.org/cgi-bin/wiki.pl?Latency-Test
83-
Please consider adding your info to the list.
84-
Also on that page are links to info about fixing some latency problems.
64+
Latency refers to the amount of time the computer can be longer than that period.
65+
Just like a railroad, LinuxCNC requires everything on a very tight and consistent timeline or bad things happen.
66+
LinuxCNC requires and uses a 'real-time' operating system, which just means it has a low-latency (lateness) response time.
67+
When LinuxCNC requires and is performing calculations, it cannot be interrupted by lower priority requests (such as user input to screen buttons or drawing etc).
68+
69+
Testing the latency is crucial and a key thing to check before proceeding further. Please follow the directions on the <<sub:install:sec:latency-test,Latency Test>> page before proceeding further.
8570

8671
Now we are happy with the latency and must pick a servo period.
8772
In most cases a servo period of 1000000 ns is fine (that gives a 1 kHz servo calculation rate - 1000 calculations a second).
88-
If you are building a closed loop servo system that controls torque (current) rather then velocity (voltage) a faster rate would be better - something like 200000 (5 kHz calculation rate).
73+
If you are building a closed loop servo system that controls torque (current) rather than velocity (voltage) a faster rate would be better - something like 200000 (5 kHz calculation rate).
8974
The problem with lowering the servo rate is that it leaves less time available for the computer to do other things besides LinuxCNC's calculations.
9075
Typically the display (GUI) becomes less responsive.
9176
You must decide on a balance. Keep in mind that if you tune your closed loop servo system then change the servo period you probably will need to tune them again.

docs/src/config/stepconf.adoc

Lines changed: 6 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -98,63 +98,21 @@ The LinuxCNC Configuration Selector has configs for Sherline already configured.
9898
Enter the result of the Latency Test here.
9999
To run a latency test press the 'Test Base Period Jitter' button. See the
100100
<<sec:latency-test,Latency Test>> section for more details.
101+
102+
.Latency Test
103+
image::images/latency-test_en.png["Latency Test",align="center"]
104+
101105
* 'Max Step Rate' -(((Max Step Rate)))
102106
StepConf automatically calculates the Max Step Rate based
103107
on the driver characteristics entered and the latency test result.
104108
* 'Min Base Period' - (((Min Base Period)))
105109
StepConf automatically determines the Min Base Period
106110
based on the driver characteristics entered and latency test result.
107111

108-
[[sub:latency-test]]
109-
== Latency Test(((Latency Test)))
110-
111-
While the test is running, you should 'abuse' the computer. Move
112-
windows around on the screen. Surf the web. Copy some large files
113-
around on the disk. Play some music. Run an OpenGL program such as
114-
glxgears. The idea is to put the PC through its paces while the latency
115-
test checks to see what the worst case numbers are. Run the test at least a few
116-
minutes. The longer you run the test the
117-
better it will be at catching events that might occur at less frequent
118-
intervals. This is a test for your computer only, so no hardware needs
119-
to be connected to run the test.
120-
121-
[WARNING]
122-
Do not attempt run LinuxCNC while the latency test is running.
123-
124-
.Latency Test
125-
image::images/latency-test_en.png["Latency Test",align="center"]
126-
127-
Latency is how long it takes the PC to stop what it is doing and
128-
respond to an external request. In our case, the request is the
129-
periodic 'heartbeat' that serves as a timing reference for the step
130-
pulses. The lower the latency, the faster you can run the heartbeat,
131-
and the faster and smoother the step pulses will be.
132-
133-
Latency is far more important than CPU speed. The CPU isn't the only
134-
factor in determining latency. Motherboards, video cards, USB ports,
135-
SMI issues, and a number of other things can hurt the latency.
136-
137-
.Troubleshooting SMI Issues (LinuxCNC.org Wiki)
138-
************************************************************
139-
Fixing Realtime problems caused by SMI on Ubuntu
140-
141-
https://wiki.linuxcnc.org/cgi-bin/wiki.pl?FixingSMIIssues
142-
************************************************************
143112

144-
The important numbers are the 'max jitter'. In the example above 9075
113+
The important number from the result of the Latency Test is the 'max jitter'. In the example above, 9075
145114
nanoseconds (ns), or 9.075 microseconds (µs), is the highest jitter.
146-
Record this number, and enter it in the Base Period Maximum Jitter box.
147-
148-
If your Max Jitter number is less than about 15-20 µs
149-
(15000-20000 ns), the computer should give very nice results
150-
with software stepping. If the max latency is more like 30-50 µs,
151-
you can still get good results, but your maximum step
152-
rate might be a little disappointing, especially if you use
153-
microstepping or have very fine pitch leadscrews. If the numbers are
154-
100 µs or more (100,000 ns), then the PC is not a good
155-
candidate for software stepping. Numbers over 1 millisecond (1,000,000 ns)
156-
mean the PC is not a good candidate for LinuxCNC, regardless of
157-
whether you use software stepping or not.
115+
Enter the max jitter it in the Base Period Maximum Jitter box.
158116

159117
== Parallel Port Setup
160118

docs/src/getting-started/system-requirements.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ the software before committing to a permanent installation on a computer.
1313
Keep in mind that the Latency Test numbers are more important than the
1414
processor speed for software step generation. More information on the
1515
Latency Test is <<sec:latency-test,here>>.
16-
In addition LinuxCNC needs to be run on an operating system that uses a
16+
In addition, LinuxCNC needs to be run on an operating system that uses a
1717
specially modified kernel,
1818
see <<sec:kernel_and_version_requirements,Kernel and Version Requirements>>.
1919

docs/src/install/latency-test.adoc

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ Motherboards, video cards, USB ports, and a number of other things can hurt the
2323
The best way to find out what you are dealing with is to run the latency test.
2424

2525
Generating step pulses in software has one very big advantage - it's free.
26-
Just about every PC has a parallel port that is
26+
Just about every PC that has a parallel port is
2727
capable of outputting step pulses that are generated by the software.
28+
2829
However, software step pulses also have some disadvantages:
2930

3031
- limited maximum step rate
@@ -45,7 +46,13 @@ Do not run LinuxCNC or StepConf while the latency test is running.
4546
[[sec:latency-test]]
4647
=== Latency Test(((Latency Test)))
4748

48-
To run the test, open a terminal window
49+
The latency test can be run a few different ways.
50+
51+
If you are using PnCconf to configure your machine, you can launch the Latency Test by clicking the "Test Base Period Jitter button' during the 2nd step of the process.
52+
53+
If you are using StepConf to configure your machine, you can launch the Latency Test by clicking the "Test Base Period Jitter button' during the 2nd step of the process.
54+
55+
If you want to run the test from the command line, open a terminal window
4956
(in Ubuntu, from Applications → Accessories → Terminal)
5057
and run the following command:
5158

@@ -91,26 +98,27 @@ You should run the test for at least several minutes; sometimes
9198
the worst case latency doesn't happen very often, or only happens
9299
when you do some particular action. For instance, one Intel
93100
motherboard worked pretty well most of the time, but every 64
94-
seconds it had a very bad 300 µs latency. Fortunately that was
95-
fixable, see https://wiki.linuxcnc.org/cgi-bin/wiki.pl?FixingSMIIssues .
96-
97-
So, what do the results mean? If your Max Jitter number is less
98-
than about 15-20 microseconds (15000-20000 nanoseconds), the
99-
computer should give very nice results with software stepping.
100-
If the max latency is more like 30-50 microseconds, you can still
101-
get good results, but your maximum step rate might be a little
102-
disappointing, especially if you use microstepping or have very
103-
fine pitch leadscrews. If the numbers are 100 µs or more,
104-
i.e. >= 100,000 nanoseconds (ns), then the PC is not a good candidate for software
105-
stepping. Numbers over 1 millisecond (1,000,000 ns) mean
106-
the PC is not a good candidate for LinuxCNC, regardless of whether you
107-
use software stepping or not.
101+
seconds it had a very bad 300 µs latency. Fortunately that was fixable, see <<_latency_tuning>>.
102+
103+
So, what do the results mean?
104+
105+
If your Max Jitter number is less
106+
than about 20,000 nanoseconds, the
107+
computer should give very nice results with software stepping or a dedicated hardware card such as a Mesa 'Anything I/O' card.
108+
109+
If the Max Jitter number is between 20,000 and 50,000 nanoseconds, you can still
110+
get good results with software stepping, but your maximum step rate might be a little
111+
disappointing, especially if you use microstepping or have very fine pitch leadscrews. You can, however, achieve excellent results using a hardware card.
112+
113+
If the Max Jitter number is between 50,000 and 500,000 nanoseconds, you cannot use software stepping. You can, however, achieve acceptable results using a hardware card.
114+
115+
If the Max Jitter number is above 500,000 nanoseconds, you cannot use software stepping or a hardware card with LinuxCNC and achieve acceptable results.
108116

109117
[NOTE]
110118
If you get high numbers, there may be ways to improve them.
111-
Another PC had very bad latency (several milliseconds) when
119+
Another PC had very bad latency (several million nanoseconds) when
112120
using the onboard video. But a $5 used video card solved the problem.
113-
LinuxCNC does not require bleeding edge hardware.
121+
LinuxCNC does not require bleeding-edge hardware.
114122

115123
For more information on stepper tuning see the
116124
<<cha:stepper-tuning,Stepper Tuning>> Chapter.
@@ -173,7 +181,7 @@ Options:
173181
When determining the latency, LinuxCNC and HAL should not be running, stop with `halrun -U`.
174182
Large number of bins and/or small binsizes will slow updates.
175183
For single thread, specify `--nobase` (and options for servo thread).
176-
Measured latencies outside of the +/- bin range are reported with special end bars.
184+
Measured latencies outside the +/- bin range are reported with special end bars.
177185
Use `--show` to show count for the off-chart [pos|neg] bin.
178186

179187
.`latency-histogram` Window

docs/src/remap/remap.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ and moreover brings its own set of support issues.
3333
While it is conceivable that certain patches might make their way into the main LinuxCNC distribution,
3434
the result of this approach is a hodge-podge of special-case solutions.
3535

36-
A good example for this deficiency is tool change support in LinuxCNC:
37-
While random tool changers are well supported, it is next to impossible to reasonably define a configuration for a manual-tool change machine
36+
A good example for this deficiency is tool change support in LinuxCNC.
37+
While random tool changers are supported well, it is next to impossible to reasonably define a configuration for a manual-tool change machine
3838
with, for example, an automatic tool length offset switch being visited after a tool change, and offsets set accordingly.
3939
Also, while a patch for a very specific rack tool changer exists, it has not found its way back into the main code base.
4040

41-
However, many of these things may be fixed by using an O-word procedure instead of a built in code -
42-
whenever the - insufficient - built in code is to be executed, call the O-word procedure instead.
43-
While possible, it is cumbersome - it requires source-editing of NGC programs,
44-
replacing all calls to the deficient code by a an O-word procedure call.
41+
However, many of these things may be fixed by using an O-word procedure instead of built-in code.
42+
Whenever the insufficient built-in code is to be executed, call the O-word procedure instead.
43+
While possible, this approach is cumbersome - it requires source-editing of NGC programs,
44+
replacing all calls to the deficient code by an O-word procedure call.
4545

4646
In its simplest form, a remapped code isn't much more than a spontaneous call to an O-word procedure.
4747
This happens behind the scenes - the procedure is visible at the configuration level, but not at the NGC program level.

0 commit comments

Comments
 (0)