Service Types

Configuration Forms

A Firmware as defined in the previous section is a collection of services which will be run on a DAQAstra. Each service and associated configuration fields are defined in this section.

Table of Contents


Analog Input

analog_input

KeyTypeDescription
NameStringInternal reference to task.
TypeEnumPolynomial Logarithmic
AFloatConversion equation A coefficient
BFloatConversion equation B coefficient
CFloatConversion equation C coefficient
DFloatConversion equation D coefficient
UnitStringIndicates unit of measurement.
IntervalIntervalRate in milliseconds the task publishes a measurement to MQTT.
PinEnumChosen Analog Input Pin (AIN00-AIN07).
CommentStringComment to help user understand what this service is about.

Digital Input

digital_input

KeyTypeDescription
NameStringInternal reference to task.
PinEnumDI00 - DI15
Inverted LogicBooleanIs the input an active-high? Set to false. Otherwise, set to true.

Frequency Counter

frequency_counter

KeyTypeDescription
NameStringInternal reference to task.
SlopeFloatY = mX + b, m = Slope, x = millivolts measured.This is used to provide unit conversion (e.g. turning mV to PSI). The user determines this. The output, “Y”, is the unit-converted reading.
OffsetFloatmV to unit zero-offset. ‘b’ in the above equation.
UnitStringIndicates unit of measurement.
IntervalIntervalRate in milliseconds the task publishes a value to MQTT.
PinEnumChosen Digital or Analog Input Pin (AIN00-AIN07, DI0-DI5).

Analog Output

analog_out

The user can move the jumper labeled DAC VCC to either use 5V or 12V to set a hardware limit. Do this only with the DAQAstra powered off.

KeyTypeDescription
NameStringInternal reference to task.
Max VoltageFloatA software upper-limit on voltage that the DAC will output. Maximum is 12VDC.
PinEnum[DAC1, DAC2]

Digital Output

digital_out

KeyTypeDescription
NameStringInternal reference to task.
Logic LevelBooleanThe logic-level at boot.
Logic InversionBoolWhether the command logic should be inverted. True means logic-low is 'on'.
PinEnumDO00-DO09, RELAY0-RELAY3

PWM Output

pwm

KeyTypeDescription
NameStringInternal reference to task.
FrequencyNumberDefault PWM frequency at boot.
PinArray(Enum)Multi-select of pins desired to be under PWM control. Options are all available Digital Outputs and Relay pins.

Complementary PWM

comp_pwm

KeyTypeDescription
NameStringInternal reference to task.
FrequencyNumberDefault PWM frequency at boot.
PinArray(Enum)Multi-select of pins desired to be under Complementary PWM control. DO08 and DO09 are the available complementary pins.

Command

command

KeyTypeDescription
NameStringInternal reference to task.
Output TaskStringSelection of a valid (already-defined) services that can receive a command.
Has Inverse CommandBooleanWhether a different command should be sent when false is received by this service. enables Inverse Command Parameters.
Command ParametersObjectChanges depending on Output Tasks. This is the set of parameters you can change in the target service.
Inverse Command ParametersObjectThis is the same as Command Parameters but will be sent instead when this service receives a false message.

Math Channel

math

A configurable math channel to perform custom in-firmware computations with the data from other configured services. Functions must be written with Rust Syntax. The usable functions include sin, cos, tan,sqrt, log, exp, abs, floor, ceil, pow, max, min. You can also use the standard mathematical operations (+, −, ×, ÷) and boolean operations for logical equations (||, &&, !=, ==, >, >=, <, <=)

KeyTypeDescription
NameStringInternal reference to task.
Input TasksArray(String)A list of other defined services that provide a valid numeric input as a variable in the math functions.
Math FunctionsArray(Object)Each function contains an expression & an output type. If a logical function is used and results in true or false, choose bool. Otherwise use f32. The selection of input tasks will autofill the appropriate variable name for that input into a new function. You may use multiple input tasks in a single function, just copy the generated variable name into where it should be used.

PID Controller

pid

KeyTypeDescription
NameStringInternal reference to task.
Input TaskStringThe Name of an already defined task that is capable of acting as a PID input. These are Analog-Inputs and Thermocouples for now.
Output TaskStringThe Name of an already defined task that is capable of acting as a PID control output. This includes PWM channels and Analog-Outputs.
Proportional GainNumberDefault PID Kp at boot.
Integral GainNumberDefault PID Ki at boot.
Derivative GainNumberDefault PID Kd at boot.

Bang-Bang Controller

bang_bang

KeyTypeDescription
NameStringInternal reference to task.
Input TaskEnumData to use as feedback for the controller. Can come from Analog Input, Thermocouple, ADS7953.
Output TaskEnumOutput the controller will modulate. Can choose a Digital Output or PDU channel.
Upper ThresholdNumberUpper hysteresis limit for the controller.
Lower ThresholdNumberLower hysteresis limit for the controller.
Control Loop FrequencyNumberThe rate at which the controller will update the state of the output. If the Input Task updates faster than this rate, the input values will be averaged.

Stepper Motor

stepper

KeyTypeDescription
NameStringInternal reference to task.
Step SignalEnumOutput pin for the stepper-motor 'pulse' or step.
Motor DirectionEnumOutput pin for the stepper-motor direction signal
Motor EnableNumberOutput pin for stepper-motor enable. This powers the motor phases.
Limit Switch 1Enum or NullDigital input for wiring an optional limit switch that will interrupt a move command.
Limit Switch 2Enum or NullDigital input for wiring an optional limit switch that will interrupt a move command.

Actuator

actuator

This is a more naive implementation of Stateful Actuator. There is no enforcement of how the actuator enters or exits a state. This is really meant as a tool to automate a group of inputs and outputs with very simple states (on/off) and that do not require the traversal of multiple states to execute an action. If this is needed, use Stateful Actuator.

KeyTypeDescription
NameStringInternal reference to task.
LatchedBooleanWhether this actuator latches the outputs upon executing a command.
InputsArrayA multi-select of already-configured (compatible) inputs to the Stateful Actuator Service. In this case, we have two Digital-Input services that are used. Analog-Input may be used as well.
OutputsArrayA multi-select of already-configured (compatible) outputs for the Stateful Actuator Service. In this case, we have a PDU service defined. One may use Digital-Outputs too.
StatesArrayUser-defined names attached to certain combinations of the chosen Inputs' logic-levels and chosen Outputs commands that ought to result in this state's Inputs levels.

Actuator States

KeyTypeDescription
NameStringUser defined name attached to the specific state of the inputs.
ActuatorsArray of BooleansThe logic-levels that the service will command to each configured output to cause this transition.
SensorsArray of BooleansThe state of the Inputs that are associated with this State name.

Stateful Actuator

stateful_inputs

KeyTypeDescription
NameStringInternal reference to task.
LatchedBooleanWhether this actuator latches the outputs upon executing a command.
InputsArrayA multi-select of already-configured (compatible) inputs to the Stateful Actuator Service. In this case, we have two Digital-Input services that are used. Analog-Input may be used as well.
StatesArrayUser-defined names attached to certain combinations of the chosen Inputs' logic-levels.
OutputsArrayA multi-select of already-configured (compatible) outputs for the Stateful Actuator Service. In this case, we have a PDU service defined. One may use Digital-Outputs too.
TransitionsArrayUser-defined state transitions.
SequencesOptional ArrayUser-defined automation sequences with configured in-firmware triggers. Convenience method.

States

It is recommended that the configured states cover all possible combinations of states of the chosen inputs.

KeyTypeDescription
NameStringUser defined name attached to the specific state of the inputs.
SensorsArray of BooleansThe state of the Inputs that are associated with the given name.

Transitions

stateful_outputs

KeyTypeDescription
NameStringUser defined name attached to the specific state of the inputs.
FromEnumChose a defined State from which this transition may be triggered.
ToEnumChose a defined State to which this transition is expected to result in.
Move DurationIntDuration in milliseconds that may elapse before this transition times out.
OutputsArray of BooleansThe logic-levels that the service will command to each configured output to cause this transition.

Sequences

stateful_sequences

Consider a trigger as an in-firmware emergency-stop.

KeyTypeDescription
NameStringUser defined name attached to the automation sequence.
StepsArrayChose and order defined Transitions this sequence should attempt.
TriggerOptional EnumChoose an already-configured (but not used in this service) Analog-Input or Digital-Input that this sequence should track the state of.
Trigger StateBooleanThe state of the configured Trigger that ought to begin this sequence.

IMU (MPU6050)

imu

KeyTypeDescription
NameStringInternal reference to task.
I2C InterfaceEnumQwiic or MikroBus I2C interface.
I2C AddressNumberI2C Bus address for the MPU6050. Default is 104. Do not change unless the address is changed on the MPU6050, beforehand.
Sampling RateNumberDuration, in milliseconds, to sample and send data from the MPU6050.

Magnetometer (QMC5883L)

magnetometer

KeyTypeDescription
NameStringInternal reference to task.
I2C InterfaceEnumQwiic or Mikrobus interface used.
Sampling RateEnum10, 50, 100, or 200 Sa/s
Magnetic DeclinationNumberThe angular offset of magnetic North from true North at your location. This orients the magnetic compass to treat zero degrees as true North.

IR Camera (MLX90640)

ir

KeyTypeDescription
NameStringInternal reference to task.
I2C InterfaceEnumQwiic or Mikrobus interface used.
I2C AddressNumberI2C address of MLX90640 IR-camera. Default is 51 (0x33). This field is in decimal, not hex.

Thermocouple (MAX31855)

thermocouple

KeyTypeDescription
NameStringInternal reference to task.
SPI Chip SelectEnumDO Pins or MikroBus I/O. The expansion board provided by TransAstra uses MikroBus CS, INT, and PWM for T1, T2, and T3, respectively.
UnitsEnumCelsius, Fahrenheit, or Kelvin

Load Cell (HX711)

loadcell

Uses MikroBus SCK and MISO by default for the HX711 data interface.

KeyTypeDescription
NameStringInternal reference to task.
Tare Sample SizeIntNumber of samples to use when measuring a tare value.

ADS7953

ads

KeyTypeDescription
NameStringInternal reference to task.
SPI Chip SelectEnumDO Pins or MikroBus I/O.
ChannelsArrayAn array of Channel objects. Each object corresponds to the conversion and units for a given input to the ADS7953 chip.

Channel

KeyTypeDescription
Channel IndexIntA value 0-15, corresponds to the input on the ADS chip.
TypeEnumPolynomial Logarithmic
AFloatConversion equation A coefficient
BFloatConversion equation B coefficient
CFloatConversion equation C coefficient
DFloatConversion equation D coefficient
UnitStringIndicates unit of measurement.

Power-Distribution Unit (PDU)

pdu

The PDU board will connect to the UART RX & TX pins on the DAQAstra's SuperSeal connector.

KeyTypeDescription
NameStringInternal reference to task.