Table of Contents

1 HAL Components

1.1 Commands and Userspace Components

Some of these will have expanded descriptions from the man pages. Some will have limited descriptions. All of the components have man pages. From this list you know what components exist and can use man n name to get additional information. For example in a terminal window type

man 1 axis 

to view the information in the man page.

1.2 Realtime Components

Some of these will have expanded descriptions from the man pages. Some will have limited descriptions. All of the components have man pages. From this list you know what components exist and can use man n name to get additional information in a terminal window.

1.2.1 abs

Compute the absolute value and sign of the input signal

Loading
loadrt abs [count=N|names=name1[,name2...]]
Functions
addf abs.N|name thread-name
Pins
abs.N.in (float in) Input value
abs.N.out (float out) Output Value, always positive
abs.N.sign (bit out) Sign of Input, false = positive, true = negative

The first abs loaded will be abs.0 and each one after that the "N" number will increment.

1.2.2 and2

Two-input AND gate. For out to be true both inputs must be true

Loading
loadrt and2 [count=N|names=name1[,name2...]]
Functions
addf and2.N|name thread-name
Pins
and2.N.in0 (bit in) Input 0
and2.N.in1 (bit in) Input 1
and2.N.out (bit out) Output

1.2.3 at_pid

proportional/integral/derivative controller with auto tuning

1.2.4 axis

accepts NML motion commands, interacts with HAL in realtime

1.2.5 biquad

Biquad IIR filter

1.2.6 bldc_hall3

3-wire Bipolar trapezoidal commutation BLDC motor driver using Hall sensors

1.2.7 blend

Perform linear interpolation between two values

Loading
loadrt blend [count=N|names=name1[,name2...]]
Functions
addf blend.N|name thread-name
Pins
blend.N.in1 (float in) First input.
blend.N.in2 (float in) Second input.
blend.N.select (float in) Select input.
blend.N.out (float out) Output value.
Parameters
blend.N.open (bit r/w)
Description

If select is equal to 0.0 output is equal to in1.

If select is equal to 1.0, the output is equal to in2.

For select values between 0.0 and 1.0, the output changes linearly from in1 to in2.

If blend.N.open is true, select values outside the range 0.0 to 1.0 give values outside the range in1 to in2. If false, outputs are clamped to the the range in1 to in2

1.2.8 charge_pump

Create a square-wave for the "charge pump" input of some controller boards

Loading
loadrt charge_pump
Functions
addf charge-pump
Pins
charge-pump.out (bit out)
charge-pump.enable (bit in) default = TRUE
Description

Outputs a square wave if enable is TRUE or unconnected, low if enable is FALSE

1.2.9 clarke2

Two input version of Clarke transform

Loading
loadrt clarke2 [count=N|names=name1[,name2...]]
Functions
addf clarke2.N | name
Pins
clarke2.N.a (float in) phase a input
clarke2.N.b (float in) phase b input
clarke2.N.x (float out) cartesian components of output
clarke2.N.y (float out) cartesian components of output
Description

The Clarke transform can be used to translate a vector quantity from a three phase system (three components 120 degrees apart) to a two phase Cartesian system.

clarke2 implements a special case of the Clarke transform, which only needs two of the three input phases. In a three wire three phase system, the sum of the three phase currents or voltages must always be zero. As a result only two of the three are needed to completely define the current or voltage. clarke2 assumes that the sum is zero, so it only uses phases A and B of the input. Since the H (homopolar) output will always be zero in this case, it is not generated.

1.2.10 clarke3

Clarke (3 phase to cartesian) transform

Loading
loadrt clarke3 [count=N|names=name1[,name2...]]
Functions
addf clarke3.N | name
Pins
clarke3.N.a (float in) three phase input vector
clarke3.N.b (float in) three phase input vector
clarke3.N.c (float in) three phase input vector
clarke3.N.x (float out) cartesian components of output
clarke3.N.y (float out) cartesian components of output
clarke3.N.h (float out) homopolar component of output
Description

The Clarke transform can be used to translate a vector quantity from a three phase system (three components 120 degrees apart) to a two phase Cartesian system (plus a homopolar component if the three phases don't sum to zero).

clarke3 implements the general case of the transform, using all three phases. If the three phases are known to sum to zero, see clarke2 for a simpler version.

1.2.11 clarkeinv

Inverse Clarke transform

Loading
loadrt clarkeinv [count=N|names=name1[,name2...]]
Functions
addf clarkeinv.N | name
Pins
clarkeinv.N.x (float in) cartesian components of input
clarkeinv.N.y (float in) cartesian components of input
clarkeinv.N.h (float in) homopolar component of input (usually zero)
clarkeinv.N.a (float out) three phase output vector
clarkeinv.N.b (float out) three phase output vector
clarkeinv.N.c (float out) three phase output vector
Parameters
Description

The inverse Clarke transform can be used to translate a vector quantity from Cartesian coordinate system to a three phase system (three components 120 degrees apart).

1.2.12 classicladder

Realtime software plc based on ladder logic

1.2.13 comp

Two input comparator with hysteresis

1.2.14 constant

Use a parameter to set the value of a pin

1.2.15 conv_bit_s32

Convert a value from bit to s32

1.2.16 conv_bit_u32

Convert a value from bit to u32

1.2.17 conv_float_s32

Convert a value from float to s32

1.2.18 conv_float_u32

Convert a value from float to u32

1.2.19 conv_s32_bit

Convert a value from s32 to bit

1.2.20 conv_s32_float

Convert a value from u32 to bit

1.2.21 conv_s32_u32

Convert a value from s32 to u32

1.2.22 conv_u32_bit

Convert a value from u32 to bit

1.2.23 conv_u32_float

Convert a value from u32 to float

1.2.24 conv_u32_s32

Convert a value from u32 to s32

1.2.25 counter

counts input pulses (deprecated)

1.2.26 ddt

Compute the derivative of the input function

1.2.27 deadzone

Return the center if within the threshold

1.2.28 debounce

filter noisy digital inputs, for more information see [->]

1.2.29 edge

Edge detector

1.2.30 encoder

software counting of quadrature encoder signals, for more information see [->]

1.2.31 encoder_ratio

an electronic gear to synchronize two axes

1.2.32 estop_latch

ESTOP latch

1.2.33 feedcomp

Multiply the input by the ratio of current velocity to the feed rate

1.2.34 flipflop

D type flip-flop

1.2.35 freqgen

software step pulse generation

1.2.36 gantrykins

A kinematics module that maps one axis to multiple joints

1.2.37 gearchange

Select from one two speed ranges

1.2.38 genhexkins

Gives six degrees of freedom in position and orientation (XYZABC). The location of the motors is defined at compile time.

1.2.39 genserkins

Kinematics that can model a general serial-link manipulator with up to 6 angular joints.

1.2.40 hm2_7i43

HAL driver for the Mesa Electronics 7i43 EPP Anything IO board with HostMot2

1.2.41 hm2_pci

HAL driver for the Mesa Electronics 5i20, 5i22, 5i23, 4i65, and 4i68 Anything IO boards, with HostMot2 firmware

1.2.42 hostmot2

HAL driver for the Mesa Electronics HostMot2 firmware

1.2.43 hypot

Three-input hypotenuse (Euclidean distance) calculator

1.2.44 ilowpass

Low-pass filter with integer inputs and outputs

1.2.45 integ

Integrator

1.2.46 invert

Compute the inverse of the input signal

1.2.47 joyhandle

sets nonlinear joypad movements, deadbands and scales

1.2.48 kins

kinematics definitions for emc2

1.2.49 knob2float

Convert counts (probably from an encoder) to a float value

1.2.50 limit1

Limit the output signal to fall between min and max

1.2.51 limit2

Limit the output signal to fall between min and max

1.2.52 limit3

Limit the output signal to fall between min and max

1.2.53 logic

Experimental general logic function component

1.2.54 lowpass

Low-pass filter

1.2.55 lut5

Arbitrary 5-input logic function based on a look-up table

1.2.56 maj3

Compute the majority of 3 inputs

1.2.57 match8

8-bit binary match detector

1.2.58 maxkins

Kinematics for a tabletop 5 axis mill named "max" with tilting head (B axis) and horizintal 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.

1.2.59 minmax

Track the minimum and maximum values of the input to the outputs

1.2.60 motion

accepts NML motion commands, interacts with HAL in realtime

1.2.61 mult2

Product of two inputs

1.2.62 mux2

Select from one of two input values

1.2.63 mux4

Select from one of four input values

1.2.64 mux8

Select from one of eight input values

1.2.65 near

Determine whether two values are roughly equal

1.2.66 not

Inverter

1.2.67 offset

Adds an offset to an input, and subtracts it from the feedback value

1.2.68 oneshot

one-shot pulse generator

1.2.69 or2

Two-input OR gate

1.2.70 pid

proportional/integral/derivative controller, for more information see [->]

1.2.71 pluto_servo

Hardware driver and firmware for the Pluto-P parallel-port FPGA, for use with servos

1.2.72 pluto_step

Hardware driver and firmware for the Pluto-P parallel-port FPGA, for use with steppers

1.2.73 pwmgen

software PWM/PDM generation, for more information see [->]

1.2.74 rotatekins

The X and Y axes are rotated 45 degrees compared to the joints 0 and 1.

1.2.75 sample_hold

Sample and Hold

1.2.76 sampler

sample data from HAL in real time

1.2.77 scale

applies a scale and offset to its input

1.2.78 scarakins

kinematics for SCARA-type robots

1.2.79 select8

8-bit binary match detector

1.2.80 serport

Hardware driver for the digital I/O bits of the 8250 and 16550 serial port

1.2.81 siggen

signal generator, for more information see [->]

1.2.82 sim_encoder

simulated quadrature encoder, for more information see [->]

1.2.83 sphereprobe

Probe a pretend hemisphere

1.2.84 stepgen

software step pulse generation, for more information see [->]

1.2.85 steptest

Used by Stepconf to allow testing of acceleration and velocity values for an axis

1.2.86 streamer

stream file data into HAL in real time

1.2.87 sum2

Sum of two inputs (each with a gain) and an offset

1.2.88 supply

set output pins with values from parameters (deprecated)

1.2.89 thc

Torch Height Control using a Mesa THC card.

1.2.90 threads

creates hard realtime HAL threads

1.2.91 threadtest

component for testing thread behavior

1.2.92 timedelay

The equivalent of a time-delay relay

1.2.93 timedelta

component that measures thread scheduling timing behavior

1.2.94 toggle

push-on, push-off from momentary pushbuttons

1.2.95 toggle2nist

toggle button to nist logic

1.2.96 tripodkins

The joints represent the distance of the controlled point from three predefined locations (the motors), giving three degrees of freedom in position (XYZ)

1.2.97 tristate_bit

Place a signal on an I/O pin only when enabled, similar to a tristate buffer in electronics

1.2.98 tristate_float

Place a signal on an I/O pin only when enabled, similar to a tristate buffer in electronics

1.2.99 trivkins

There is a 1:1 correspondence between joints and axes. Most standard milling machines and lathes use the trivial kinematics module.

1.2.100 updown

Counts up or down, with optional limits and wraparound behavior

1.2.101 wcomp

Window comparator

1.2.102 weighted_sum

convert a group of bits to an integer

1.2.103 xor2

Two-input XOR (exclusive OR) gate

Loading
Functions
Pins
Parameters
Description

Index