Skip to content
Snippets Groups Projects

MechaRaptor controller

The MechaRaptor is a tandem flapping wings system built for my Ph.D. at the University of Liège. The goal of this setup is to conduct experimental analysis of the aerodynamics of such configuration and better understand the wake dynamics and its impact on the performance of the aft wing.

The system is actuated by two sets of brushless DC motors (BLDC), each controlled with an Engine Speed Controller (ESC). The ESCs are themselves controlled using an Arduino Uno, which acts as the "brain" of the whole setup. This Arduino is the main interface for piloting the system and logging important metrics.

This repository contains the Arduino code and the wiring schematics for the electrical components of the setup.

Controller features

  • Manual (potentiometer) or automatic (serial) control of the BLDCs.
  • Both BLDCs run at the same speed (same flapping frequency on each module).
  • It is impossible for the BLDCs to keep an exact constant rotation speed during the entire run. The phase offset cannot be set precisely and will evolve during the entire run.

Note: A maximum rotation speed is imposed to the BLDC by the ESC. This value has been manually set for each ESC using the ESC's terminal (JETIBOX). The maximum BLDC speed is reflected in the Arduino code as well, so the inputs and outputs are calibrated properly.

Usage

Before powering the Arduino, set the ON/OFF switch in the appropriate position:

  • ON: Serial mode (control using a PC connected to the Arduino)
  • OFF: Manual mode (control using the potentiometer)

Further switch changes during the Arduino runtime will not be accounted for.

Then turn on the ESCs power using batteries or DC power supply.

If the setup is in manual mode, the potentiometer must be turned all the way down to initiate the setup. If it is in automatic mode, it will wait for a serial connection and initial user input.

Manual mode

In this mode, the potentiometer is used to control the motors. When it is turned at its maximum, the motors run at the maximum RPM allowed by the ESCs (typically 6000 RPM). Turn it all the way down to stop the motors.

Serial mode

In this mode, the Arduino is controlled through the serial port of a computer. If no computer is connected, nothing will happen.

When the serial connection is started, the console will prompt the user for the desired frequency and will use that value to control the motors. The potentiometer is completely bypassed.

To turn off the motor, send 0 to the console at any moment. This will first decrease the RPM to a moderate speed for three seconds. Then the motor will be turned off completely. Once the motor is completely stopped, the system will lock itself to prevent any accidental re-start. To start another run, close the serial connection and re-open a new one.

Data logging and visualization

Besides controlling the system, the Arduino also logs the input data and some measurements. The most important data are:

  • ESC input settings
  • Wing angles (for each wing)
  • PSU current and tension

These data are transmitted through the serial connection and can be saved on the computer that controls the Arduino for later analysis.

A json configuration file is provided in order to visualize the output stream in real time with serial-studio. This also allows the automatic logging and retention of all data in csv spreadsheets.

Angle calibration

The flapping angle of each wing is measured using an absolute encoder. These sensors need to be 'zeroed' properly so the value they output corresponds to the actual wing angle. This calibration process can be done automatically in Serial mode. It is only useful to calibrate the sensors after a re-assembly of the setup. Once the calibration has been made a first time, we recommend hard-coding the values measured and deactivate the calibration procedure altogether by putting gSKIP_CALIB = true.

Bill of Materials

Device Reference Usage
BLDC Plettenberg Advance 301 Motor
ESC JETI SPIN 75 Pro Opto Motor controller
ESC Terminal JETIBOX Program ESC, motor telemetry
PSU Electroautomatik PSI 8080 - 60 T (1500W)1 DC power supply
Controller board Arduino uno (Rev 3) Full setup control, data logging
Encoders Broadcom AEAT 6012 Flapping angle measurement
Potentiometer N/A Manual control of RPM
ON/OFF switch N/A Switch between Serial and Manual control
Resistors 47 k\Omega, 6.8 k\Omega Voltage divider & noise reduction
Current sensor Allegro SEN00982 PSU current logging

Schematics

To Do


  1. Discontinued by manufacturer. 2

  2. Using an ACS758 chip LCB050B-3370XAA-1044.