From 0baaf398297e98ca2f964ceaabffe705727c68b6 Mon Sep 17 00:00:00 2001
From: Anders Wallin <anders.e.e.wallin@gmail.com>
Date: Thu, 6 Dec 2012 21:15:19 +0200
Subject: [PATCH] organize hal-compontents into subsections

---
 docs/src/hal/components.txt |  278 ++++++++++++++++++++++++-------------------
 1 file changed, 158 insertions(+), 120 deletions(-)

diff --git a/docs/src/hal/components.txt b/docs/src/hal/components.txt
index 2bddc21..f53c0e4 100644
--- a/docs/src/hal/components.txt
+++ b/docs/src/hal/components.txt
@@ -45,122 +45,98 @@ get additional information in a terminal window.
 If the component requires a floating point thread that is usually the slower
 servo-thread.
 
-[horizontal]
-abs:: [[sub:abs]](((abs)))Compute the absolute value and sign of the input signal.
+=== Core LinuxCNC components[[sec:Realtime-Components-core]] ===
 
-and2:: (((and2)))Two-input AND gate. For out to be true both inputs must be true.
+[horizontal]
 
-at_pid:: (((at_pid)))Proportional/integral/derivative controller with auto tuning.
+motion:: (((motion)))Accepts NML motion commands, interacts with HAL in realtime.
 
 axis:: (((axis)))Accepts NML motion commands, interacts with HAL in realtime.
 
-biquad:: (((biquad)))Biquad IIR filter
-
-bldc_hall3:: (((bldc_hall3)))3-wire Bipolar trapezoidal commutation BLDC motor driver using Hall sensors.
-
-blend:: (((blend)))Perform linear interpolation between two values.
-
-charge_pump:: (((charge_pump)))Creates a square-wave for the 'charge pump' input of some controller boards.
-The 'Charge Pump' should be added to the base thread function. When enabled the output is on for one period and off for one period. To calculate the frequency of the output 1/(period time in seconds x 2) = hz. For example if you have a base period of 100,000ns that is 0.0001 seconds and the formula would be 1/(0.0001 x 2) = 5,000 hz or 5 Khz.
-
-clarke2:: (((clarke2)))Two input version of Clarke transform.
-
-clarke3:: (((clarke3)))Clarke (3 phase to cartesian) transform.
+classicladder:: (((classicladder)))Realtime software PLC based on ladder logic. See Classic Ladder manual for more information.
 
-clarkeinv:: (((clarkeinv)))Inverse Clarke transform.
+gladevcp:: (((gladevcp)))Displays Virtual Control Panels built with GTK/Glade.
 
-classicladder:: (((classicladder)))Realtime software PLC based on ladder logic. See Classic Ladder manual for more information.
+threads:: (((threads)))Creates hard realtime HAL threads.
 
-comp:: (((comp)))Two input comparator with hysteresis.
+=== Logic and bitwise components[[sec:Realtime-Components-logic]] ===
 
-constant:: (((constant)))Use a parameter to set the value of a pin.
+[horizontal]
 
-conv_bit_s32:: (((conv_bit_s32)))Convert a value from bit to s32.
+and2:: (((and2)))Two-input AND gate. For out to be true both inputs must be true.
 
-conv_bit_u32:: (((conv_bit_u32)))Convert a value from bit to u32.
+not:: (((not)))Inverter.
 
-conv_float_s32:: (((conv_float_s32)))Convert a value from float to s32.
+or2:: (((or2)))Two-input OR gate.
 
-conv_float_u32:: (((conv_float_u32)))Convert a value from float to u32.
+xor2:: (((xor2)))Two-input XOR (exclusive OR) gate.
 
-conv_s32_bit:: (((conv_s32_bit)))Convert a value from s32 to bit.
+debounce:: (((debounce)))Filter noisy digital inputs, for more information see <<sec:Debounce>>.
 
-conv_s32_float:: (((conv_s32_float)))Convert a value from s32 to float.
+edge:: (((edge)))Edge detector.
 
-conv_s32_u32:: (((conv_s32_u32)))Convert a value from s32 to u32.
+flipflop:: (((flipflop)))D type flip-flop.
 
-conv_u32_bit:: (((conv_u32_bit)))Convert a value from u32 to bit.
+oneshot:: (((oneshot)))One-shot pulse generator.
 
-conv_u32_float:: (((conv_u32_float)))Convert a value from u32 to float.
+logic:: (((logic)))Experimental general logic function component.
 
-conv_u32_s32:: (((conv_u32_s32)))Convert a value from u32 to s32.
+lut5:: (((lut5)))Arbitrary 5-input logic function based on a look-up table.
 
-counter:: (((counter)))Counts input pulses (deprecated).
-Use the 'encoder' component See <<sec:Encoder>>. 
+match8:: (((match8)))8-bit binary match detector.
 
-ddt:: (((ddt)))Compute the derivative of the input function.
+select8:: (((select8)))8-bit binary match detector.
 
-deadzone:: (((deadzone)))Return the center if within the threshold.
+=== Arithmetic and float-components[[sec:Realtime-Components-float]] ===
 
-debounce:: (((debounce)))Filter noisy digital inputs, for more information see <<sec:Debounce>>.
+[horizontal]
 
-edge:: (((edge)))Edge detector.
+abs:: [[sub:abs]](((abs)))Compute the absolute value and sign of the input signal.
 
-encoder:: (((encoder)))Software counting of quadrature encoder signals, for more information
-see <<sec:Encoder>>.
+blend:: (((blend)))Perform linear interpolation between two values.
 
-encoder_ratio:: (((encoder_ratio)))An electronic gear to synchronize two axes.
+comp:: (((comp)))Two input comparator with hysteresis.
 
-estop_latch:: (((estop_latch)))ESTOP latch.
+constant:: (((constant)))Use a parameter to set the value of a pin.
 
-feedcomp:: (((feedcomp)))Multiply the input by the ratio of current velocity to the feed rate.
+sum2:: (((sum2)))Sum of two inputs (each with a gain) and an offset.
 
-flipflop:: (((flipflop)))D type flip-flop.
+counter:: (((counter)))Counts input pulses (deprecated).
+Use the 'encoder' component See <<sec:Encoder>>. 
 
-freqgen:: (((freqgen)))Software step pulse generation.
+updown:: (((updown)))Counts up or down, with optional limits and wraparound behavior.
 
-gantrykins:: (((gantrykins)))A kinematics module that maps one axis to multiple joints.
+ddt:: (((ddt)))Compute the derivative of the input function.
 
-gearchange:: (((gearchange)))Select from one of two speed ranges.
+deadzone:: (((deadzone)))Return the center if within the threshold.
 
-genhexkins:: (((genhexkins)))Gives six degrees of freedom in position and orientation (XYZABC).
-The location of the motors is defined at compile time.
+hypot:: (((hypot)))Three-input hypotenuse (Euclidean distance) calculator.
 
-genserkins:: (((genserkins)))Kinematics that can model a general serial-link manipulator with up to
-6 angular joints.
+mult2:: (((mult2)))Product of two inputs.
 
-gladevcp:: (((gladevcp)))Displays Virtual Control Panels built with GTK/Glade.
+mux16:: (((mux16)))Select from one of sixteen input values.
 
-hm2_7i43:: (((hm2_7i43)))HAL driver for the Mesa Electronics 7i43 EPP Anything IO board with
-HostMot2.
+mux2:: (((mux2)))Select from one of two input values.
 
-hm2_pci:: (((hm2_pci)))HAL driver for the Mesa Electronics 5i20, 5i22, 5i23, 4i65, and 4i68
-Anything I/O boards, with HostMot2 firmware.
+mux4:: (((mux4)))Select from one of four input values.
 
-hostmot2:: (((hostmot2)))HAL driver for the Mesa Electronics HostMot2 firmware.
+mux8:: (((mux8)))Select from one of eight input values.
 
-hypot:: (((hypot)))Three-input hypotenuse (Euclidean distance) calculator.
+near:: (((near)))Determine whether two values are roughly equal.
 
-ilowpass:: [[ilowpass]] (((ilowpass)))While it may find other applications,
-this component was written to create smoother motion while jogging with an MPG.
-+
-In a machine with high acceleration, a short jog can behave almost like a step
-function. By putting the ilowpass component between the MPG encoder counts
-output and the axis jog-counts input, this can be smoothed.
-+
-Choose scale conservatively so that during a single session there will never
-be more than about 2e9/scale pulses seen on the MPG. Choose gain according
-to the smoothing level desired. Divide the axis.N.jog-scale values by scale.
+offset:: (((offset)))Adds an offset to an input, and subtracts it from the feedback value.
 
 integ:: (((integ)))Integrator.
 
 invert:: (((invert)))Compute the inverse of the input signal.
 
-joyhandle:: (((joyhandle)))Sets nonlinear joypad movements, deadbands and scales.
+wcomp:: (((wcomp)))Window comparator.
 
-kins:: (((kins)))kinematics definitions for LinuxCNC.
+weighted_sum:: (((weighted_sum)))Convert a group of bits to an integer.
 
-knob2float:: (((knob2float)))Convert counts (probably from an encoder) to a float value.
+biquad:: (((biquad)))Biquad IIR filter
+
+lowpass:: (((lowpass)))Low-pass filter
 
 limit1:: (((limit1)))Limit the output signal to fall between min and max. footnote:[When the input
 is a position, this means that the 'position' is limited.]
@@ -175,49 +151,47 @@ Limit its second derivative to less than MaxA per second squared. footnote:[When
 the input is a position, this means that the 'position', 'velocity', and
 'acceleration' are limited.]
 
-logic:: (((logic)))Experimental general logic function component.
+maj3:: (((maj3)))Compute the majority of 3 inputs.
 
-lowpass:: (((lowpass)))Low-pass filter
+scale:: (((scale)))Applies a scale and offset to its input.
 
-lut5:: (((lut5)))Arbitrary 5-input logic function based on a look-up table.
+=== Type conversion[[sec:Realtime-Components-typeconvert]] ===
 
-maj3:: (((maj3)))Compute the majority of 3 inputs.
+[horizontal]
 
-match8:: (((match8)))8-bit binary match detector.
+conv_bit_s32:: (((conv_bit_s32)))Convert a value from bit to s32.
 
-maxkins:: (((maxkins)))Kinematics for a tabletop 5 axis mill named 'max' with tilting head (B axis) and
-horizontal rotary mounted to the table (C axis).
-Provides UVW motion in the rotated coordinate system.
-The source file, maxkins.c, may be a useful starting point for other 5-axis systems.
+conv_bit_u32:: (((conv_bit_u32)))Convert a value from bit to u32.
 
-mesa_7i65:: (((7i65)))Support for the Mesa 7i65 eight-axis servo card.
+conv_float_s32:: (((conv_float_s32)))Convert a value from float to s32.
 
-minmax:: (((minmax)))Track the minimum and maximum values of the input to the outputs.
+conv_float_u32:: (((conv_float_u32)))Convert a value from float to u32.
 
-motion:: (((motion)))Accepts NML motion commands, interacts with HAL in realtime.
+conv_s32_bit:: (((conv_s32_bit)))Convert a value from s32 to bit.
 
-mult2:: (((mult2)))Product of two inputs.
+conv_s32_float:: (((conv_s32_float)))Convert a value from s32 to float.
 
-mux16:: (((mux16)))Select from one of sixteen input values.
+conv_s32_u32:: (((conv_s32_u32)))Convert a value from s32 to u32.
 
-mux2:: (((mux2)))Select from one of two input values.
+conv_u32_bit:: (((conv_u32_bit)))Convert a value from u32 to bit.
 
-mux4:: (((mux4)))Select from one of four input values.
+conv_u32_float:: (((conv_u32_float)))Convert a value from u32 to float.
 
-mux8:: (((mux8)))Select from one of eight input values.
+conv_u32_s32:: (((conv_u32_s32)))Convert a value from u32 to s32.
 
-near:: (((near)))Determine whether two values are roughly equal.
+=== Hardware drivers[[sec:Realtime-Components-hwdrivers]] ===
 
-not:: (((not)))Inverter.
+[horizontal]
 
-offset:: (((offset)))Adds an offset to an input, and subtracts it from the feedback value.
+hm2_7i43:: (((hm2_7i43)))HAL driver for the Mesa Electronics 7i43 EPP Anything IO board with
+HostMot2.
 
-oneshot:: (((oneshot)))One-shot pulse generator.
+hm2_pci:: (((hm2_pci)))HAL driver for the Mesa Electronics 5i20, 5i22, 5i23, 4i65, and 4i68
+Anything I/O boards, with HostMot2 firmware.
 
-or2:: (((or2)))Two-input OR gate.
+hostmot2:: (((hostmot2)))HAL driver for the Mesa Electronics HostMot2 firmware.
 
-pid:: (((pid)))Proportional/integral/derivative controller, for more information
-see <<sec:PID>>.
+mesa_7i65:: (((7i65)))Support for the Mesa 7i65 eight-axis servo card.
 
 pluto_servo:: (((pluto_servo)))Hardware driver and firmware for the Pluto-P parallel-port FPGA, for
 use with servos.
@@ -225,23 +199,107 @@ use with servos.
 pluto_step:: (((pluto_step)))Hardware driver and firmware for the Pluto-P parallel-port FPGA, for
 use with steppers.
 
+thc:: (((torch height control)))Torch Height Control using a Mesa THC card.
+
+serport:: (((serport)))Hardware driver for the digital I/O bits of the 8250 and 16550 serial port.
+
+=== Kinematics[[sec:Realtime-Components-kins]] ===
+
+[horizontal]
+
+kins:: (((kins)))kinematics definitions for LinuxCNC.
+
+gantrykins:: (((gantrykins)))A kinematics module that maps one axis to multiple joints.
+
+genhexkins:: (((genhexkins)))Gives six degrees of freedom in position and orientation (XYZABC).
+The location of the motors is defined at compile time.
+
+genserkins:: (((genserkins)))Kinematics that can model a general serial-link manipulator with up to
+6 angular joints.
+
+maxkins:: (((maxkins)))Kinematics for a tabletop 5 axis mill named 'max' with tilting head (B axis) and
+horizontal rotary mounted to the table (C axis).
+Provides UVW motion in the rotated coordinate system.
+The source file, maxkins.c, may be a useful starting point for other 5-axis systems.
+
+tripodkins:: (((tripodkins)))The joints represent the distance of the controlled point from three
+predefined locations (the motors), giving three degrees of freedom in
+position (XYZ).
+
+trivkins:: (((trivkins)))There is a 1:1 correspondence between joints and axes. Most standard
+milling machines and lathes use the trivial kinematics module.
+
 pumakins:: (((pumakins)))Kinematics for PUMA-style robots.
 
+rotatekins:: (((rotatekins)))The X and Y axes are rotated 45 degrees compared to the joints 0 and 1.
+
+scarakins:: (((scarakins)))Kinematics for SCARA-type robots.
+
+=== Motor control[[sec:Realtime-Components-motor]] ===
+
+[horizontal]
+
+at_pid:: (((at_pid)))Proportional/integral/derivative controller with auto tuning.
+
+pid:: (((pid)))Proportional/integral/derivative controller, for more information
+see <<sec:PID>>.
+
 pwmgen:: (((pwmgen)))Software PWM/PDM generation, for more information see  <<sec:PWMgen>>.
 
-rotatekins:: (((rotatekins)))The X and Y axes are rotated 45 degrees compared to the joints 0 and 1.
+encoder:: (((encoder)))Software counting of quadrature encoder signals, for more information
+see <<sec:Encoder>>.
 
-sample_hold:: (((sample_hold)))Sample and Hold.
+stepgen:: (((stepgen)))Software step pulse generation, for more information see <<sec:Stepgen>>.
 
-sampler:: (((sampler)))Sample data from HAL in real time.
+freqgen:: (((freqgen)))Software step pulse generation.
 
-scale:: (((scale)))Applies a scale and offset to its input.
+=== BLDC and 3-phase motor control[[sec:Realtime-Components-bldc]] ===
 
-scarakins:: (((scarakins)))Kinematics for SCARA-type robots.
+[horizontal]
 
-select8:: (((select8)))8-bit binary match detector.
+bldc_hall3:: (((bldc_hall3)))3-wire Bipolar trapezoidal commutation BLDC motor driver using Hall sensors.
 
-serport:: (((serport)))Hardware driver for the digital I/O bits of the 8250 and 16550 serial port.
+clarke2:: (((clarke2)))Two input version of Clarke transform.
+
+clarke3:: (((clarke3)))Clarke (3 phase to cartesian) transform.
+
+clarkeinv:: (((clarkeinv)))Inverse Clarke transform.
+
+=== Other[[sec:Realtime-Components-other]] ===
+
+[horizontal]
+
+charge_pump:: (((charge_pump)))Creates a square-wave for the 'charge pump' input of some controller boards.
+The 'Charge Pump' should be added to the base thread function. When enabled the output is on for one period and off for one period. To calculate the frequency of the output 1/(period time in seconds x 2) = hz. For example if you have a base period of 100,000ns that is 0.0001 seconds and the formula would be 1/(0.0001 x 2) = 5,000 hz or 5 Khz.
+
+encoder_ratio:: (((encoder_ratio)))An electronic gear to synchronize two axes.
+
+estop_latch:: (((estop_latch)))ESTOP latch.
+
+feedcomp:: (((feedcomp)))Multiply the input by the ratio of current velocity to the feed rate.
+
+gearchange:: (((gearchange)))Select from one of two speed ranges.
+
+ilowpass:: [[ilowpass]] (((ilowpass)))While it may find other applications,
+this component was written to create smoother motion while jogging with an MPG.
++
+In a machine with high acceleration, a short jog can behave almost like a step
+function. By putting the ilowpass component between the MPG encoder counts
+output and the axis jog-counts input, this can be smoothed.
++
+Choose scale conservatively so that during a single session there will never
+be more than about 2e9/scale pulses seen on the MPG. Choose gain according
+to the smoothing level desired. Divide the axis.N.jog-scale values by scale.
+
+joyhandle:: (((joyhandle)))Sets nonlinear joypad movements, deadbands and scales.
+
+knob2float:: (((knob2float)))Convert counts (probably from an encoder) to a float value.
+
+minmax:: (((minmax)))Track the minimum and maximum values of the input to the outputs.
+
+sample_hold:: (((sample_hold)))Sample and Hold.
+
+sampler:: (((sampler)))Sample data from HAL in real time.
 
 siggen:: (((siggen)))Signal generator, for more information see <<sec:Siggen>>.
 
@@ -249,20 +307,12 @@ sim_encoder:: (((sim_encoder)))Simulated quadrature encoder, for more informatio
 
 sphereprobe:: (((sphereprobe)))Probe a pretend hemisphere.
 
-stepgen:: (((stepgen)))Software step pulse generation, for more information see <<sec:Stepgen>>.
-
 steptest:: (((steptest)))Used by Stepconf to allow testing of acceleration and velocity values for an axis.
 
 streamer:: (((streamer)))Stream file data into HAL in real time.
 
-sum2:: (((sum2)))Sum of two inputs (each with a gain) and an offset.
-
 supply:: (((supply)))Set output pins with values from parameters (deprecated).
 
-thc:: (((torch height control)))Torch Height Control using a Mesa THC card.
-
-threads:: (((threads)))Creates hard realtime HAL threads.
-
 threadtest:: (((threadtest)))Component for testing thread behavior.
 
 time:: (((time)))Accumulated run-time timer counts HH:MM:SS of 'active' input.
@@ -275,28 +325,16 @@ toggle2nist:: (((toggle2nist)))Toggle button to nist logic.
 
 toggle:: (((toggle)))Push-on, push-off from momentary pushbuttons.
 
-tripodkins:: (((tripodkins)))The joints represent the distance of the controlled point from three
-predefined locations (the motors), giving three degrees of freedom in
-position (XYZ).
-
 tristate_bit:: (((tristate_bit)))Place a signal on an I/O pin only when enabled, similar to a tristate
 buffer in electronics.
 
 tristate_float:: (((tristate_float)))Place a signal on an I/O pin only when enabled, similar to a tristate
 buffer in electronics.
 
-trivkins:: (((trivkins)))There is a 1:1 correspondence between joints and axes. Most standard
-milling machines and lathes use the trivial kinematics module.
 
-updown:: (((updown)))Counts up or down, with optional limits and wraparound behavior.
 
 watchdog:: (((watchdog)))Monitor one to thirty-two inputs for a 'heartbeat'.
 
-wcomp:: (((wcomp)))Window comparator.
-
-weighted_sum:: (((weighted_sum)))Convert a group of bits to an integer.
-
-xor2:: (((xor2)))Two-input XOR (exclusive OR) gate.
 
 == HAL API calls
 ....
-- 
1.7.10.4

