Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions docs/src/man/man9/classicladder.9.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,35 @@ the outputs.

== PINS

**classicladder.0.in-**_NN_ IN bit::
These bit signal pins map to **%I**_NN_ variables in ClassicLadder.
**classicladder.0.out-**_NN_ OUT bit::
These bit signal pins map to **%Q**_NN_ variables in ClassicLadder.
**classicladder.0.in-**_NN_ IN bool::
These bool signal pins map to **%I**_NN_ variables in ClassicLadder.
**classicladder.0.out-**_NN_ OUT bool::
These bool signal pins map to **%Q**_NN_ variables in ClassicLadder.
Output from ClassicLadder.
**classicladder.0.s32in-**_NN_ IN s32::
**classicladder.0.s32in-**_NN_ IN sint::
Integer input from ClassicLadder.
These s32 signal pins map to **%IW**_NN_ variables in ClassicLadder.
**classicladder.0.s32out-**_NN_ OUT s32::
These sint signal pins map to **%IW**_NN_ variables in ClassicLadder.
**classicladder.0.s32out-**_NN_ OUT sint::
Integer output from ClassicLadder.
These s32 signal pins map to **%QW**_NN_ variables in ClassicLadder.
**classicladder.0.floatin-**_NN_ IN float::
These sint signal pins map to **%QW**_NN_ variables in ClassicLadder.
**classicladder.0.floatin-**_NN_ IN real::
Integer input from ClassicLadder.
These float signal pins map to **%IF**_NN_ variables in ClassicLadder.
These real signal pins map to **%IF**_NN_ variables in ClassicLadder.
These are truncated to S32 values internally, e.g. 7.5 will be 7.
**classicladder.0.floatout-**_NN_ OUT float::
Float output from ClassicLadder.
These float signal pins map to **%QF**_NN_ variables in ClassicLadder.
**classicladder.0.hide_gui** IN bit::
This bit pin hides the ClassicLadder window, while still having the non-realtime code run.
**classicladder.0.floatout-**_NN_ OUT real::
Real output from ClassicLadder.
These real signal pins map to **%QF**_NN_ variables in ClassicLadder.
**classicladder.0.hide_gui** IN bool::
This bool pin hides the ClassicLadder window, while still having the non-realtime code run.
This is usually desirable when modbus is used, as modbus requires the non-realtime code to run.

== PARAMETERS

*classicladder.0.refresh.time* RO s32::
*classicladder.0.refresh.time* RO sint::
Tells you how long the last refresh took.
*classicladder.0.refresh.tmax* RW s32::
*classicladder.0.refresh.tmax* RW sint::
Tells you how long the longest refresh took.
*classicladder.0.ladder-state* RO s32::
*classicladder.0.ladder-state* RO sint::
Tells you if the program is running or not

== FUNCTIONS
Expand Down
18 changes: 9 additions & 9 deletions docs/src/man/man9/counter.9.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,29 @@ HAL manual.

== PINS

**counter.**_N_**.phase-A** bit in::
**counter.**_N_**.phase-A** bool in::
The primary input signal. The internal counter is incremented on each rising edge.
**counter.**_N_**.phase-Z** bit in::
**counter.**_N_**.phase-Z** bool in::
The index input signal. When the *index-enable* pin is TRUE and a
rising edge on *phase-Z* is seen, *index-enable* is set to FALSE and
the internal counter is reset to zero.
**counter.**_N_**.index-enable** bit io::
**counter.**_N_**.index-enable** bool io::
+

**counter.**_N_**.reset** bit io::
**counter.**_N_**.reset** bool in::
+

**counter.**_N_**.counts** signed out::
**counter.**_N_**.counts** sint out::
+

**counter.**_N_**.position** float out::
**counter.**_N_**.position** real out::
+

**counter.**_N_**.velocity** float out::
**counter.**_N_**.velocity** real out::
These pins function according to the canonical digital encoder interface.
**counter.**_N_**.position-scale** float rw::
**counter.**_N_**.position-scale** real io::
This parameter functions according to the canonical digital encoder interface.
**counter.**_N_**.rawcounts** signed ro::
**counter.**_N_**.rawcounts** sint out::
The internal counts value, updated from *update-counters* and
reflected in the output pins at the next call to *capture-position*.

Expand Down
6 changes: 3 additions & 3 deletions docs/src/man/man9/debounce.9.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ signal to be present for _N_ samples before the output changes state.

== PINS

**debounce.**_G_**.**_F_**.in** bit in::
**debounce.**_G_**.**_F_**.in** bool in::
The F'th input pin in group G.
**debounce.**_G_**.**_F_**.out** bit out::
**debounce.**_G_**.**_F_**.out** bool out::
The F'th output pin in group _G_.
Reflects the last "stable" input seen on the corresponding input pin.
**debounce.**_G_**.delay** signed rw::
**debounce.**_G_**.delay** sint rw::
Sets the amount of filtering for all pins in group _G_.
51 changes: 23 additions & 28 deletions docs/src/man/man9/demux_generic.9.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ demux_generic - routes a single input signal to one of multiple outputs

**loadrt demux_generic config="**__<input_type><output_type><size>__[,__<input_type><output_type><size>__],...**"**

Types: **b** = bit, **f** = float, **s** = signed integer, **u** = unsigned integer
Types: **b** = bool, **f** = real, **s** = sint, **u** = uint

Example:
**loadrt demux_generic config="**bb8,fu12**"**


== FUNCTIONS

**demux-gen.**_NN_ Depending on the data types can run in either a floating point or non-floating point thread.
**demux-gen.**_NN_ Demultiplexer function.

== PINS

Expand All @@ -25,44 +25,43 @@ Example:
demux-gen.NN.sel-bit-BB ───────────────┐ │ │
demux-gen.NN.sel-int ─────────────┐ │ │ │
┌───────┴─┴─┴─┴───────┐
│ / o───── ├───── demux-gen.NN.out-[bit/float/s32/u32]-00
demux-gen.NN.in-[bit/float/s32/u32] ─────┤ ─────o o───── ├───── ...
│ o───── ├───── demux-gen.NN.out-[bit/float/s32/u32]-MM
│ / o───── ├───── demux-gen.NN.out-[bool/real/sint/uint]-00
demux-gen.NN.in-[bool/real/sint/uint] ───┤ ─────o o───── ├───── ...
│ o───── ├───── demux-gen.NN.out-[bool/real/sint/uint]-MM
demux-gen.NN.suppress-no-input ─────┤ │
demux-gen.NN.debounce-us ─────┤ │
└─────────────────────┘

**demux-gen**.__N__.**suppress-no-input** bit in::
**demux-gen**.__N__.**suppress-no-input** bool in::
This suppresses changing the output if all select lines are false.
This stops unwanted jumps in output between transitions of input but makes in00 unavailable.
**demux-gen**.__N__.**debounce-us** unsigned in::
**demux-gen**.__N__.**debounce-us** uint in::
sets debounce time in microseconds, e.g. 100000 = a tenth of a second.
The selection inputs must be stable this long before the output
changes. This helps to ignore 'noisy' switches.
**demux-gen**.__N__.**sel-bit-**__BB__ bit in (BB=0..bit width of _size_)::
**demux-gen**.__N__.**sel-int** unsigned in::
**demux-gen**.__N__.**sel-bit-**__BB__ bool in (BB=0..bit width of _size_)::
**demux-gen**.__N__.**sel-int** uint in::
The sel-bit pins are only created when the size of the demux_gen
component is an integer power of two.
Together, these determine to which **out**-__MM__ the **in** value is forwarded.
The bit pins are interpreted as binary bits, and the result is simply
added on to the integer pin input. It is expected that either one or
the other would normally be used. However, the possibility exists to
use a higher-order bit to "shift" the values set by the integer pin.
**demux-gen**.__N__.**in-**[**bit**/**float**/**s32**/**u32**] variable-type in::
**demux-gen**.__N__.**in-**[**bool**/**real**/**sint**/**uint**] variable-type in::
The input value which is routed to an output depending on the selection pins.
**demux-gen**.__N__.**out-**[**bit**/**float**/**s32**/**u32**]**-**__MM__ variable-type out (M=0..size-1)::
**demux-gen**.__N__.**out-**[**bool**/**real**/**sint**/**uint**]**-**__MM__ variable-type out (M=0..size-1)::
According to the selection bits and/or the selection number, the selected output
follows the **in** value. The other outputs retain the values they had before
resp. zero if they have not been selected yet. Values will be
converted/truncated according to standard C rules. This means, for
example that a float input greater than 2147483647 will give an S32
output of -2147483648.
converted and clamped. This means, for example that a REAL input greater
than (approx.) 2^63^-1 will give a SINT output of 2^63^-1.

== PARAMETERS

**demux-gen**.__N__.**elapsed** float r::
**demux-gen**.__N__.**elapsed** real r::
Current value of the internal debounce timer for debugging.
**demux-gen**.__N__.**selected** s32 r::
**demux-gen**.__N__.**selected** sint r::
Current value of the internal selection variable after conversion for debugging.
Possibly useful for setting up gray-code switches.

Expand All @@ -73,26 +72,22 @@ It allows the creation of arbitrary-size demultiplexers (up to
1024 entries) and also supports differing data types on the input and
output pins. The configuration string is a comma-separated list of
code-letters and numbers, such as "bb4,fu12". This would create a
4-element bit-to-bit demux and a 12-element float-to-unsigned demux.
4-element bit-to-bit demux and a 12-element real-to-uint demux.
The code letters are:

**b** = bit,
**f** = float,
**s** = signed integer and
**u** = unsigned integer.
**b** = bool (boolean),
**f** = real (floating point),
**s** = sint (signed integer) and
**u** = uint (unsigned integer).

The first letter code is the input type, the second is the
output type. The codes are not case-sensitive. The order of the letters
is significant but the position in the string is not. Do not insert any
spaces in the config string. Any non-zero float value will be converted
to a "true" output in bit form. Be wary that float datatypes can be
very, very, close to zero and not actually be equal to zero.
spaces in the config string. Any non-zero real value will be converted
to a "true" output in bool form when it is more than ±2e-7 from zero.

Each demux has its own HAL function and must be added to a thread
separately. If neither input nor output is of type float then the
function is base-thread (non floating-point) safe. Any demux_generic with
a floating point input or output can only be added to a floating-point
thread.
separately.

== SEE ALSO

Expand Down
48 changes: 24 additions & 24 deletions docs/src/man/man9/encoder.9.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,85 +60,85 @@ The *encoder*.__N__. format is shown in the following descriptions.

== PINS

**encoder**.__N__.**counter-mode** bit i/o::
**encoder**.__N__.**counter-mode** bool i/o::
Enables counter mode. When true, the counter counts each rising edge
of the phase-A input, ignoring the value on phase-B. This is useful
for counting the output of a single channel (non-quadrature) sensor.
When false (the default), it counts in quadrature mode.
**encoder**.__N__.**counts** s32 out::
**encoder**.__N__.**counts** sint out::
Position in encoder counts.
**encoder**.__N__.**index-enable** bit i/o::
**encoder**.__N__.**index-enable** bool i/o::
When true, *counts* and *position* are reset to zero on the next
rising edge of *Phase-Z*. At the same time, *index-enable* is reset to
zero to indicate that the rising edge has occurred.
**encoder**.__N__.**min-speed-estimate** float in (default: 1.0)::
**encoder**.__N__.**min-speed-estimate** real in (default: 1.0)::
Determine the minimum speed at which *velocity* will be estimated as
nonzero and *postition-interpolated* will be interpolated. The units
of *min-speed-estimate* are the same as the units of *velocity*.
Setting this parameter too low will cause it to take a long time for
*velocity* to go to 0 after encoder pulses have stopped arriving.
**encoder**.__N__.**phase-A** bit in::
**encoder**.__N__.**phase-A** bool in::
Quadrature input for encoder channel _N_.
**encoder**.__N__.**phase-B** bit in::
**encoder**.__N__.**phase-B** bool in::
Quadrature input.
**encoder**.__N__.**phase-Z** bit in::
**encoder**.__N__.**phase-Z** bool in::
Index pulse input.
**encoder**.__N__.**position** float out::
**encoder**.__N__.**position** real out::
Position in scaled units (see *position-scale*)
**encoder**.__N__.**position-interpolated** float out::
**encoder**.__N__.**position-interpolated** real out::
Position in scaled units, interpolated between encoder counts. Only
valid when velocity is approximately constant and above
*min-speed-estimate*. Do not use for position control.
**encoder**.__N__.**position-scale** float i/o::
**encoder**.__N__.**position-scale** real i/o::
Scale factor, in counts per length unit. For example, if
*position-scale* is 500, then 1000 counts of the encoder will be
reported as a position of 2.0 units.
**encoder**.__N__.**missing-teeth** s32 in::
**encoder**.__N__.**missing-teeth** sint in::
The number of teeth missing from the index gap. For example a 60 tooth
gear with two teeth shortened to form an index so that there are 58
pulses per revolution would use a position-scale of 60 and a
missing-teeth of 2.
**encoder**.__N__.**rawcounts** s32 out::
**encoder**.__N__.**rawcounts** sint out::
The raw count, as determined by *update-counters*. This value is
updated more frequently than *counts* and *position*. It is also
unaffected by *reset* or the index pulse.
**encoder**.__N__.**reset** bit in::
**encoder**.__N__.**reset** bool in::
When true, *counts* and *position* are reset to zero immediately.
**encoder**.__N__.**velocity** float out::
**encoder**.__N__.**velocity** real out::
Velocity in scaled units per second. *encoder* uses an algorithm that
greatly reduces quantization noise as compared to simply
differentiating the *position* output. When the magnitude of the true
velocity is below min-speed-estimate, the velocity output is 0.
**encoder**.__N__.**velocity-rpm** float out::
Velocity in scaled units per minute. Simply *encoder**.__N__.**velocity*
**encoder**.__N__.**velocity-rpm** real out::
Velocity in scaled units per minute. Simply **encoder**.__N__.**velocity**
scaled by a factor of 60 for convenience.
**encoder**.__N__.**x4-mode** bit i/o::
**encoder**.__N__.**x4-mode** bool i/o::
Enables times-4 mode. When true (the default), the counter counts each
edge of the quadrature waveform (four counts per full cycle). When
false, it only counts once per full cycle. In *counter-mode*, this
parameter is ignored.
**encoder**.__N__.**latch-input** bit in::
**encoder**.__N__.**latch-input** bool in::
+

**encoder**.__N__.**latch-falling** bit in (default: *TRUE*)::
**encoder**.__N__.**latch-falling** bool in (default: *TRUE*)::
+

**encoder**.__N__.**latch-rising** bit in (default: *TRUE*)::
**encoder**.__N__.**latch-rising** bool in (default: *TRUE*)::
+

**encoder**.__N__.**counts-latched** s32 out::
**encoder**.__N__.**counts-latched** sint out::
+

**encoder**.__N__.**position-latched** float out::
**encoder**.__N__.**position-latched** real out::
Update *counts-latched* and *position-latched* on the rising and/or
falling edges of *latch-input* as indicated by *latch-rising* and
*latch-falling*.
**encoder**.__N__.**counter-mode** bit rw::
**encoder**.__N__.**counter-mode** bool rw::
Enables counter mode. When true, the counter counts each rising edge
of the phase-A input, ignoring the value on phase-B. This is useful
for counting the output of a single channel (non-quadrature) sensor.
When false (the default), it counts in quadrature mode.
**encoder**.__N__.**capture-position.tmax** s32 rw::
**encoder**.__N__.**capture-position.tmax** sint rw::
Maximum time in ns it took to execute this function.

== PARAMETERS
Expand Down
20 changes: 10 additions & 10 deletions docs/src/man/man9/encoder_ratio.9.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ The *encoder-ratio.N.* format is shown in the following descriptions.

== PINS

**encoder-ratio.**_N_**.master-A** bit in::
**encoder-ratio.**_N_**.master-A** bool in::
+

**encoder-ratio.**_N_**.master-B** bit in::
**encoder-ratio.**_N_**.master-B** bool in::
+

**encoder-ratio.**_N_**.slave-A** bit in::
**encoder-ratio.**_N_**.slave-A** bool in::
+

**encoder-ratio.**_N_**.slave-B** bit in::
**encoder-ratio.**_N_**.slave-B** bool in::
The encoder channels of the master and slave axes.
**encoder-ratio.**_N_**.enable** bit in::
**encoder-ratio.**_N_**.enable** bool in::
When the enable pin is FALSE, the error pin simply reports the slave
axis position, in revolutions. As such, it would normally be connected
to the feedback pin of a PID block for closed loop control of the
Expand All @@ -60,18 +60,18 @@ The *encoder-ratio.N.* format is shown in the following descriptions.
minus the scaled master position. The scale factor is the ratio of
master teeth to slave teeth. As the master moves, error becomes
non-zero, and the PID loop will drive the slave axis to track the master.
**encoder-ratio.**_N_**.error** float out::
**encoder-ratio.**_N_**.error** real out::
The error in the position of the slave (in revolutions).

== PARAMETERS

**encoder-ratio.**_N_**.master-ppr** unsigned rw::
**encoder-ratio.**_N_**.master-ppr** uint rw::

**encoder-ratio.**_N_**.slave-ppr** unsigned rw::
**encoder-ratio.**_N_**.slave-ppr** uint rw::
The number of pulses per revolution of the master and slave axes.
**encoder-ratio.**_N_**.master-teeth** unsigned rw::
**encoder-ratio.**_N_**.master-teeth** uint rw::

**encoder-ratio.**_N_**.slave-teeth** unsigned rw::
**encoder-ratio.**_N_**.slave-teeth** uint rw::
The number of "teeth" on the master and slave gears.

== SEE ALSO
Expand Down
Loading
Loading