Skip to main content

Posts

Showing posts from 2018

High Resolution PWM Signal Generation for RC Servos With STM32

Currently, I'm building an RC transmitter/receiver based on the SX1280 RF chip. One of the goal for the project is that I want 12 bit servo resolution from the sticks all away down to the servos. Partly because modern digital servos have 12 bit resolution secondly a high-end transmitter is using 12 bits anyway. I was investigating how I can generate high resolution PWM signals on STM32 devices. I'm using black pill (STM32F103C8T8) at the moment for the prototype.

Hardware
Any STM32F103 development board (blue pill, black pill, etc.) A USB power bank as power supply STM32 programmer (Segger j-links, ST-LINK/V2, or simply an st-link clone) Software
STM32CubeMXAtollic TrueSTUDIO for STM32Project source from github The Obvious Solution
Probably the easiest solution is to use one of the timer which can generate PWM signals, like TIM1-3 on an STM32F103. For a modern digital servo the frame rate can go down to 5 ms or so, but for an old analog servo it should be 20 ms or 50 Hz. So…

Controlling RC Servos Wirelessly Over UDP

In this project I want to use my iPhone to control RC servos. I'll use the accelerometer to control two servos over UDP connection. This is a Proof Of Concept project to verify that a connection between an iPhone and a peripheral can achieve high update rates (higher then BLE) using UDP.

Hardware
ESP8266 (Wemos D1 mini pro) boardTwo RC servos A USB power bank as power supply Some jumper wires An iPhone or iPad using iOS12 A mac to build the project Software
Arduino IDE with ESP8266 Arduino core installed: Installation manualXcode 10: https://developer.apple.com/xcode/The arduino sketch can be found here The Swift source of the iPhone app is here Hardware setup


The hardware setup is very simple. I use the D1 (pitch) and D2 (roll) output on the ESP8266 board to control the RC servos respectively. The board is powered from a USB power bank. The RC servos are powered from the 5v and GND pin of the board.
Software The control app for the iPhone is written in Swift which connects to the …