CRServoF - The CSRF serial protocol to PWM servo converter

Overview

CRServoF - The CSRF serial protocol to PWM servo converter

I wanted to create a small project to mess around with PWM servo output for ExpressLRS, and thought this might be of use for other people.

YouTube Demo

What it does

If you have a receiver that outputs CRSF serial protocol (ExpressLRS, Crossfire, Tracer) but want to directly drive servos without a flight controller, I guess you're in the right place. That's exactly what this does. Hook up a CRSF RX to UART2 and your servos to various pins of an STM32F103C8 "blue pill" board and away you go. Not much to it other than that.

Wiring and Flashing

Pin Description
5V 5V power input, 3.5V - 5.5V
GND Ground, gotta have this
PA2 TX (connect to CRSF RX)
PA3 RX (connect to CRSF TX)
PA15 Servo output CH1 - CRSF Channel 1
PB3 Servo output CH2 - CRSF Channel 2
PB10 Servo output CH3 - CRSF Channel 3
PB11 Servo output CH4 - CRSF Channel 4
PA6 Servo output CH5 - CRSF Channel 6
PA7 Servo output CH6 - CRSF Channel 7
PB0 Servo output CH7 - CRSF Channel 8
PB1 Servo output CH8 - CRSF Channel 12
A0 VBAT needs voltage divider, see below

To flash, use platformio and an STLINK adapter, build either target but the F103_serial environment creates a USB serial port for debug logging when plugged in over USB.

Channel Mapping

To change the channel mapping, use the OUTPUT_MAP[] array at the top. These are 1-based channels from the CRSF output, so 1 is usually Roll, 2 is Pitch and so on. 5 is AUX1 up to 12 is AUX8 for ExpressLRS, or up to 16 AUX12 for Crossfire models. The default map is [ Roll, Pitch, Throttle, Yaw, AUX2, AUX3, AUX4, AUX12 ] for my radio setup.

Failsafe

The code has failsafe detection which happens if no channel packets are received for a short time (300ms currently). The default failsafe setting is to set CH1-4 to 1500, 1500, 988, 1500, CH4-7 to hold their last position, and CH8 to stop putting out pulses. To change the failsafe behavior, modify the OUTPUT_FAILSAFE[] array with either the microseconds position to set on failsafe or fsaNoPulses (stop outputting PWM) or fsaHold (hold last received value).

VBAT

The code sends a BATTERY telemetry item back to the CRSF RX, using A0 as the input value. You can not plug VBAT directly in. The maximum input voltage is 3.3V so the voltage needs to be scaled down. The code expects a resistor divider VBAT -- 8.2kohm -A0- 1.2kohm -- GND with VBAT on one end, GND on the other, and A0 connected in the middle. That should be good up to 6S voltage if I did my math right. The voltage can be calibrated using the VBAT_SCALE define in the top of main.cpp, and different resistors can be used by changing the VBAT_R1 and VBAT_R2 defines.

ExpressLRS_via_BetaflightPassthrough

The serial UART will attempt to emulate a Betaflight CLI so ExpressLRS can flash the connected RX with yet another RC version. This works, I dunno, like 80% of the time? It is hard to get all the timing just right, but if it fails, you'l likely need to repower the whole device because the RX is in the bootloader and probably at the wrong autobaud.

Issues
  • add USB HID Joystick Support

    add USB HID Joystick Support

    Is there interest in adding a feature similar to the HID Joystick Support found in betaflight 3.4+?

    I am not expecting there will be enough desire to yield implementation.

    Thank you for building this @CapnBry, -p

    unlikely 
    opened by pitts-mo 4
Releases(v0.3)
Owner
Bryan Mayland
Bryan Mayland
Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactively receive/edit/monitor data and send commands to an embedded system via the serial bus

See wiki for full documentation Serial Data Monitor Description Serial Data Monitor is a multiplatform (Windows, Linux, Mac, ...) tool to interactivel

monnoliv 4 Oct 29, 2021
The function is based on MQTT. When the original serial of ESP8266/ESP32 cannot be used, it can replace serial print.

MqttPrint and MqttMonitor The function is based on MQTT. When the original serial of ESP8266/ESP32 cannot be used, it can replace serial print. MqttPr

fw-box 3 Jan 10, 2022
John Walker 15 Jun 16, 2022
The movements of your RC vehicles are jerky and not smooth? This Arduino device will solve this issue by adding acceleration and deceleration ramps to the PWM signals!

This is an Arduino Pro Mini 3.3V / 8MHz based RC servo ramp / delay generator Features: 4 RC servo PWM inputs and outputs (can be enhanced) Reads the

null 4 Apr 15, 2022
custom esp8266 controller for driving the pwm led controller

room8266 custom esp8266 controller for driving the pwm led controller designed to drive this: https://github.com/austinscreations/PWM-LED-Controller t

null 1 Nov 1, 2021
Simple ATTiny85 based PS/2 to Amiga keyboard protocol converter that fits inside the keyboard.

Simple ATTiny85 based PS/2 to Amiga keyboard protocol converter that fits inside the keyboard.

Jari Tulilahti 8 May 6, 2022
Servo library with stm developed by the Liek Software Team. We are working on new versions.

Liek-Servo-Library Liek Servo Library is a library that makes it easy for you to drive servo motors with STM32F10x series cards. The library is still

null 14 Jan 13, 2022
Zerobug is a 3D-printed micro-servo hexapod robot powered by a Raspberry Pi Zero and a STM32F103

ZeroBug - DIY Hexapod Robot Zerobug is a 3D-printed micro-servo hexapod robot powered by a Raspberry Pi Zero and a STM32F103. The Pi Zero is in charge

Max K 138 Jun 24, 2022
visual servo for mars rover

Mars_Rover visual servo for mars rover Start the simulation without mars environment roslaunch curiosity_mars_rover_description main_simple.launch Sta

Chenghao Wang 16 Apr 25, 2022
Tiny and cheap robot car for inspecting sewer pipes >= 125 mm. With pan servo for the ESP32-Cam module

ESP32-Cam Sewer inspection car Version 1.0.0 - work in progress Based on esp32-cam-webserver by Owen Carter. Additional Features Pan servo for the ESP

Armin 3 Feb 17, 2022
4 channel servo controller code for Arduino Mega 2560 for AASD-15A and similar motor driver

eh-msc-4dof 4 channel servo controller code for Arduino Mega 2560 for AASD-15A and similar motor driver Arduino sketch for generating pulses needed to

null 4 Jan 8, 2022
A STM32F428I-DISC1 based sonar which implements the HC-SR04 ultrasonic sensor and a mini-servo

STM32 Sonar Youtube This is a Sonar based on the STM32 microcontroller. It uses the following parts: STM32F428I-DISC1 Devboard HC-SR04 ultrasonic sens

Robert Sorić 1 Nov 29, 2021
Cross-platform, Serial Port library written in C++

Serial Communication Library (Linux and OS X) (Windows) This is a cross-platform library for interfacing with rs-232 serial like ports written in C++.

William Woodall 1.5k Jun 19, 2022
experiments with the Gameboy Advance serial interface

(I'm hedging my bets with this repo name. I'd want to add more serial setup tutorials. For example, I bought a bunch of Gameboy Advance wireless adapt

Ties Stuij 28 May 13, 2022
Synology DSM 7 USB serial drivers

Missing USB serial drivers for DSM 7 Supported drivers cp210x ch341 Supported platforms apollolake (linux-4.4.x) armada38x (linux-3.10.x-bsp) armadaxp

Robert Klep 81 Jun 16, 2022
A handy little system information monitor using and ESP32 + ILI9488 TFT. Receives data over Serial Bluetooth.

Bluetooth-System-Monitor A handy little system information monitor using and ESP32 + ILI9488 TFT. Receives data over Serial Bluetooth and thus giving

Dustin Watts 24 May 28, 2022
An OLED gauge for the Speeduino ECU. Uses UART (secondary serial) for communication.

speeduino-ardugauge An OLED gauge for the Speeduino ECU. Uses UART (secondary serial) for communication. See demo video. See screenshots. NOTE: The ga

null 9 Jun 17, 2022
A software serial driver package by using the hardware timer capture / comparison functionality.

Soft serial 1.简介 Soft serial 是利用硬件定时器捕获/比较功能实现软件模拟串口的软件包。 1.1目录结构 Soft serial 软件包目录结构如下所示: soft_serial ├───inc // 头文件目录 │

齐永忠 2 Oct 2, 2021
USB serial TTY for the Arduino Uno with ILI9341 LCD screen shield

ILI9341TTY USB serial TTY for the Arduino Uno with ILI9341 LCD screen shield [video] Semigraphics, ANSI, unicode, and an Arduino LCD-screen terminal I

M Rule 71 Mar 12, 2022