IQUART Flight Controller Interface (IFCI)

This client is used to simplify communication between flight controllers and multiple modules connected to the IQUART bus.

Arduino

To use the IQUART Flight Controller Interface in Arduino, ensure iquart_flight_controller_interface_client.hpp is included. This allows the creation of a IQUartFlightControllerInterfaceClient object. See the Message Table below for available messages. All message objects use the Short Name with a trailing underscore. All messages use the standard Get/Set/Save functions.

A minimal working example for the IQUartFlightControllerInterfaceClient is:

#include <iq_module_communication.hpp>

IqSerial ser(Serial2);
IQUartFlightControllerInterfaceClient iquartFlightControllerInterface(0);

void setup() {
    ser.begin();
    // Initialize Serial (for displaying information on the terminal)
    Serial.begin(115200);
}

void loop() {
    int pulsingVoltageMode = 0;
    if(ser.get(iquartFlightControllerInterface.telemetry_, pulsingVoltageMode))
    Serial.println(pulsingVoltageMode);
}

C++

To use the IQUART Flight Controller Interface client in C++, include iquart_flight_controller_interface_client.hpp. This allows the creation of an IQUartFlightControllerInterface object. See the Message Table below for available messages. All message objects use the Short Name with a trailing underscore. All messages use the standard Get/Set/Save functions.

IFCITelemetryData Struct

The data returned by the telemetry endpoint contains 16 bytes. A struct called IFCITelemetryData is required to store this data. Here is a description of the IFCITelemetryData struct:

struct IFCITelemetryData
{
    int16_t mcu_temp;       // Temperature of the microcontroller in centi °C
    int16_t coil_temp;      // Temperature of the coils in centi °C
    int16_t voltage;        // Supply voltage in centi-volts
    int16_t current;        // Supply current in centi-amps
    int16_t consumption;    // Consumtion in mAh
    int16_t speed;          // Velocity of the motor in rad/s
    uint32_t uptime;        // Uptime in seconds
};

Simply create an IFCITelemetryData object to store the response from the telemetry endpoint. A minimal working example for the IQUartFlightControllerInterfaceClient using the telemetry endpoint is:

Note

Interfacing with Serial looks different on different machines. Therefore, this example does not include code for interfacing with the hardware.

For more, see Full C++ Code Example (w/ LibSerial)

#include "generic_interface.hpp"
#include "iquart_flight_controller_interface_client.hpp"
#include <iostream>

void main(){
    // Make a communication interface object
    GenericInterface com;

    // Make a IQUART Flight Controller Interface object with obj_id 0
    IQUartFlightControllerInterfaceClient iquartFlightControllerInterface(0);

    // Use the IQUART Flight Controller Interface Client
    iquartFlightControllerInterface.telemetry_.get(com)

    // Insert code for interfacing with hardware here

    // Store telemetry data in an IFCITelemetryData object
    IFCITelemetryData telemetry = iquart_flight_controller_interface.telemetry_.get_reply()

    // Examples on how to access each property of IFCITelemetryData
    cout << "telemetry coil_temp: " << telemetry.coil_temp << endl;
    cout << "telemetry consumption: " << telemetry.consumption << endl;
    cout << "telemetry current: " << telemetry.current << endl;
    cout << "telemetry mcu temp: " << telemetry.mcu_temp << endl;
    cout << "telemetry speed: " << telemetry.speed << endl;
    cout << "telemetry uptime: " << telemetry.uptime << endl;
    cout << "telemetry voltage: " << telemetry.voltage << endl;
}

Matlab

To use the IQUART Flight Controller Interface client in Matlab, all Vertiq communication code must be included in your path. This allows the creation of a IQUartFlightControllerInterfaceClient object. See the Message Table below for available messages. All message strings use the Short Names. All messages use the standard Get/Set/Save functions.

A minimal working example for the IQUartFlightControllerInterfaceClient is:

% Make a communication interface object
com = MessageInterface('COM18', 115200);
% Make a IQUART Flight Controller Interface object with obj_id 0
% IQUART Flight Controller Interface objects are always obj_id 0
IquartFlightControllerInterface = IQUartFlightControllerInterfaceClient('com', com);
% Use the IQUART Flight Controller Interface object
throttleCvi= IquartFlightControllerInterface.get('throttle_cvi');

Python

To use the IQUART Flight Controller Interface Client in Python, import iqmotion and create a module that has the Arming Handler Client within its firmware. See the table below for available messages. All message strings use the Short Names. All messages use the standard Get/Set/Save functions.

A minimal working example for the IQUART Flight Controller Interface Client is:

import iqmotion as iq

com = iq.SerialCommunicator("/dev/ttyUSB0")
|variable_name| = iq.|module_name|(com, 0, firmware="pulsing")

telemetry = |variable_name|.get("iquart_flight_controller_interface", "telemetry")
print(f"Pulsing voltage mode: {telemetry}")

Message Table

Type ID 88 | IQUART Flight Controller Interface
IQUART Flight Controller Interface

Sub ID

Short Name

Access

Data Type

Unit

Note

1

telemetry

get

See IFCITelemetryData struct

\(\text{16 Byte Array}\)

Returns 16 bytes of telemetry information. See the IFCITelemetryData struct notes.

2

throttle_cvi

get, set, save

uint8

\(\text{Index [0, 255]}\)

The control value index for the throttle.

3

x_cvi

get, set, save

uint8

\(\text{Index [0, 255]}\)

The control value index value for the x rectangular coordinate.

4

y_cvi

get, set, save

uint8

\(\text{Index [0, 255]}\)

The control value index value for the y rectangular coordinate.