
Micro DC motor controller
I have been exposed to the radio control hobby all my life whether it be planes, helicopters, boats, cars or quadcopters. Recently, quadcopters have become small enough to fly in a house and my dad wondered if a plane could be made small and light enough to fly indoors. He conceptualized a plane with no servos to control a rudder, elevator or ailerons, only two motors. Turning could be achieved with differential motor thrust, and increasing and decreasing throttle could change the altitude.
​
Being as small and light as possible was a priority and the available motor controllers off the shelf were larger than they needed to be. Additionally, one component, the wireless receiver that was chosen (weighing only 0.28 g) which would have been off the shelf regardless of the rest of the design had strict power requirements of no less than 3.7v requiring additional power regulation from the battery which could drop to 3v.
​
Given the lack of a simple existing solution, I figured that I could design a small embedded system to interface with this receiver and perform the necessary functions for this project.
​
The following were the design criteria of the the system:
​
-
Connect to two of the receiver channels and use the inputs to control the percentage of raw battery voltage applied to two independent motors.
-
Handle 2A of current to the motors at a max voltage of 4.2v.
-
Accept 1 cell LiPo batteries (voltage range: 2.5-4.2v) and be able to provide 500ma of power to the receiver between 3.7v and 4.2v (4.2v is the maximum voltage for specific small servos that could be used in additional plane designs later on).
-
Read battery voltage and flash an LED when battery voltage is below a calibrated threshold.
-
Break out additional receiver channels for potential future use.
-
Be as small and light as possible.
​
I decided to base design of the board around the Atmel ATtiny85 micro-controller. The ATtiny85 has two 8 bit counters, timer 1 has the option for a phase corrected PWM mode and can output on two independent pins with two independent compare match values allowing for independent duty cycle control on both channels. This is perfect for producing a variable output to control the average voltage on the motor. The output from these pins were each used to switch a MOSFET.

​
The second timer could then be used for timing functions related to interpreting the signal input from the receiver. For the inputs, the receiver outputs a pulse at 50Hz that has a varying width of roughly between 1-2ms. Timing this width gives the desired signal between 0-100%. One of the receivers outputs was attached to the single interrupt pin, and the AVR's pin change interrupt feature was used for the other channel. By capturing a timestamp on the inputs edges, the duty cycle of the PWM outputs is varied accordingly.
Having only 6 I/O pins, 4 of the pins were re-purposed for ISP programming functions aswell, 2 were used for outputs, 2 for inputs from the receiver, 1 for a simple output to an indication LED, and the last which is also a reset pin for the chip was used to read battery voltage. To prevent the chip from being reset, the reset pin must stay above 2.5v. The battery voltage was scaled such that it would stay above 2.5 and below the chip's Vcc during normal operation to be read by the ADC.
​
The last requirement of the project was the power regulation, I used a boost converter to regulate the output voltage to the ATtiny and receiver board to 4.2v accepting a wide range of input voltages outside intended ranges. The other nice thing about the regulation is that half of the board could be cut off keeping only the small section containing the regulator and its related components, this way, if a future project required the same off the shelf receiver board, this regulator could be re-purposed just for that.
​
In the end, the board weighed only 0.5g. The last picture shows the first successful 2 motor only radio control plane to use this board. In all, it weighs only 20g and can easily fly around a large open basement.
​
Related Project Links
There are no items in this list
I designed this wireless e-stop for my startup, Varden Labs. It allowed us to operate a self-driving golf cart safely without anyone in the vehicle. With two forms of redundancy, this device and the system around it allowed us to stop the vehicle should anything go wrong.