Drone Motor Control Development

By European Editors

Contributed By Digi-Key's European Editors

The world’s population could be close to 10 billion people by 2050. To provide enough food, agricultural output will need to increase by as much as 50% according to the 2017 Future of Food & Agriculture report by the Food and Agriculture Organization (FAO) of the United Nations (UN).

The UN FAO points out several challenges that need to be addressed to feed the world. These include improving prosperity in rural areas, improving food systems, and increasing agricultural productivity. Advanced technology has a role to play in helping to meet these challenges. Smart agriculture is emerging as a means of helping improve crop yields and animal management. One example is the use of Internet of Things (IoT) technologies to improve crop performance and animal health.

Gathering data such as crop heights, planting density, leaf condition, or livestock temperatures, enables farmers to optimize plant or animal care, and to predict and maximize yields. Once the data has been analyzed, farmers need effective means of expediting the decisions that have been made based upon the information gathered. The main problem is that farms can be extremely large, spreading across thousands of acres. This can make examining crops or animals extremely time consuming. It can also be difficult to form an overall picture of crop or animal health, identify problems such as localized under-planting, dryness or pest infestation in a specific area.

Drones are ready to come to the rescue. Technology companies are already finding ways to enable farmers to use drones to survey large areas quickly and gather in-depth information at visible and non-visible wavelengths (Figure 1). The emergence of precision agriculture assisted by unmanned aerial vehicles (UAVs) has also opened opportunities for specialists to develop cloud-based analysis tools for interpreting the data collected during UAV flights to determine appropriate responses. These can help farmers boost yields by optimizing irrigation, fertilization or pest control, and to cut costs by utilizing agricultural chemicals more efficiently.

Image of cloud analysis of aerial images

Figure 1: Cloud analysis of aerial images can help monitor crop and soil condition. (Image source: PrecisionHawk).

Agricultural UAVs are not confined to data gathering roles. Multi-rotor UAVs able to carry payloads of 10 kg, 20 kg or more offer several advantages over conventional crop spraying that uses tractors or light aircraft. Training a UAV pilot is far quicker and less expensive than training an aircraft pilot, and the vehicle itself is less expensive to buy and operate. Compared to using a tractor, a crop spraying UAV can be faster, and does not damage any of the crops. Moreover, flying can proceed even if recent rain has waterlogged the ground.

UAV technology for precision agriculture

The market for UAVs in precision agriculture is young and evolving, and regulations are far from being finalized. Presently, commercial UAV flying is not permitted, although the US Federal Aviation Authority (FAA) can grant permission on an individual basis.

As far as UAV technology is concerned, a suitable aircraft requires basic motor and flight controls, sensors, telemetry, and for crop spraying, systems such as valve actuators and liquid level sensing. Radar based collision avoidance has also been proposed.

For data gathering, lightweight and low-power hyperspectral sensors can tell farmers more about the condition of their crops than conventional cameras that operate in the visible spectrum. Hyperspectral sensors have their origins in spectroscopic technology first proved in satellite applications. They capture data at wavelengths beyond the visible spectrum using an array of detectors, each tuned to operate within a narrow range such as very-near infrared (VNIR, from 380 - 1000 nm), near infrared (NIR, 900 - 1700 nm) or short wavelength infrared (SWIR, 950 - 2500 nm). The chemical signatures of crop diseases or other pests can be observed more clearly in these wavelengths than within the visible spectrum alone. Affordably priced hyperspectral sensors are now entering the market that offer low distortion, a wide field of view, and on-board processing to remove noise and ensure the accuracy of the captured image.

Making it fly

UAVs for precision agriculture vary from small fixed-wing aircraft to multi-rotor quad-copter drone-type platforms. UAVs for crop spraying may have six or more rotors to provide enough lift, depending on the intended payload.

The DC motors for driving lift rotors in drone-type UAVs tend to be brushed or brushless (BLDC) types. Smaller vehicles may use brushed motors for low weight and simplicity, while greater reliability and reduced electromagnetic noise are persuasive reasons to use BLDCs, particularly in larger UAVs.

At the core of the vehicle, a flight controller is needed to handle navigation, control the motors to achieve liftoff, and maintain height and heading while in flight. GPS-based navigation and lightweight, miniature MEMS sensors such as a 3-axis accelerometer, a 3-axis gyroscope and a barometric pressure sensor enable accurate positioning, motion control and altitude awareness. As far as ensuring stability during flight is concerned, flight controllers for today’s multi-rotor UAVs share some of their DNA with model helicopter controllers that manage the anti-torque tail rotor to prevent the airframe from turning about its own axis. In the UAV controller, inertial measurement based on MEMS sensor fusion coordinates adjustment of the individual motor speeds to keep the vehicle fixed on the desired heading.

As a tool to aid precision agriculture, the true power of the flight controller is manifested in the user interface and the features provided to help define the UAV’s flight path. A farmer needs to predetermine exactly where the UAV should fly to capture a complete set of images from a given field, or to ensure full spraying coverage with minimal overspray, with minimal time and effort.

Accelerating motor control development

To simplify the development of motor drives, a variety of evaluation kits are available from various manufacturers. Control algorithms such as field-oriented control (FOC) using Hall sensors or back EMF measurement for rotor position detection are typically available free of charge. These can help engineers get various types of motors up and running quickly by providing example software that can give a head start for application development.

Even with the help of these kits, however, engineers need some expertise in designing with motors to achieve accurate control of speed and torque. Challenges lie in setting up the software for the chosen motor, and subsequently fine tuning the parameters to optimize responses to speed and torque commands. The engineer needs to find out the motor’s voltage constant (Ke), friction coefficient and moment of inertia. If the controller is to rely on back-EMF measurement, sensorless state observation as well as speed regulation must be set up. Recently, vendors such as TI and STMicroelectronics have successfully simplified motor characterization and tuning, enabling developers to drive the motor without first having to familiarize themselves with its properties. The two manufacturers have taken subtly different approaches.

ST has built identification and tuning functionality into its MC Workbench motor control development environment (Figure 2). This motor profiler automatically detects the motor parameters using static open and closed-loop tests, each taking a few seconds to complete. Other parameters describing the power stage, driver and control stage are entered via the MC Workbench GUI. The project is then generated and compiled, allowing the motor to be turned and controlled. The MC Workbench one touch tuning feature then provides a straightforward way to adjust the settings for smooth speed and torque control.

Image of STMicroelectronics’ MC Workbench (click for full-size)

Figure 2: ST’s MC Workbench aids setup. A motor profiler tool captures unknown motor parameters.

Implementing this functionality in MC Workbench allows developers to choose from various microcontrollers such as the wide selection of STM32 MCUs, and use the STM32 ecosystem to create a low-cost development platform. In a different approach, ST has recently introduced the STSPIN32F0. It integrates a complete STM32F0 microcontroller in the same package as a three-phase half-bridge gate driver, has over current/over voltage/over temperature protection, and a set of op amps for Hall sensor decoding. The STEVAL-SPIN3201 evaluation board, which is used with the STSW-STM32100 motor control library, combines the STSPIN32F0 IC with power management features. A firmware example, STSW-SPIN3201, can be downloaded and used in conjunction with MC Workbench to quickly drive the motor and start development.

TI’s approach is based on having their InstaSPIN™-MOTION software solution embedded in the ROM of microcontrollers such as C2000 Piccolo™ series devices like the TMS320F28069M. InstaSPIN-MOTION includes TI’s FAST™ (Flux, Angle, Speed, Torque) software-based rotor-flux sensor. It also has components for motor profiling, single parameter tuning, and disturbance rejection to identify the motor type (Figure 3).

Diagram of Texas Instruments' InstaSPIN-MOTION

Figure 3: TI’s InstaSPIN-MOTION uses firmware embedded in the microcontroller to characterize the motor.

Developers can exercise the features of InstaSPIN-MOTION through TI’s MotorWare™ software environment. The DRV8312-69M-KIT combines a control board containing a TMS320F28069M and a power module baseboard containing a DRV8312 IC, which is an integrated three-phase inverter that contains the circuitry needed for driving a brushless DC motor. A 55 W motor is also provided.


Precision agriculture represents yet another exciting opportunity for drone technology. The imperative to optimize production in a cost-effective manner will help the sector flourish. Software to simplify flight programming and interpret captured data, as well as leveraging readily available motor control expertise to quickly build a stable, controllable airframe, will be key to success.

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.

About this author

European Editors

About this publisher

Digi-Key's European Editors