Skip to content

A solution to have speedy Servo and ESC feedback to your Flightcontroller

Notifications You must be signed in to change notification settings

tudelft/t4_actuators_board

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

The T4-Board is servo and ESC controller board based on a Teensy 4 PCB providing full telemetry feedback of actuators.

This repository provides code and building instructions to have the capability to establish a connection between a Flightcontroller and a T4-Board, enabling the very speedy accurate control of motors and servomotors.

Why

The big bonus of such a solution is the feedback information from all the servo and motor states. Realtime values of Forces, Angles, RPM, Voltage, Current and what have you. Yers, all those are returned values. This opens the opportunity to use these values in an autopilot control loop, so in the end to have much better controllability of an airframe. In the example setup, the refresh rate for the control and feedback of the motors is approximately 500 Hz, while the refresh rate for the control and feedback of the servos is approximately 200 Hz.

Hardware

Servos can be controlled in both Serial Mode as well as PWM mode. For the servo hardware used, we had great success using the Feetech STS3032, SCS0009 and SCS2332 SCS servos. but any serial servos employing the Dinamixel half-duplex serial communication can be used. A more detailed explanation of this serial servos protocol can be found in this document: serial_servo_protocol.pdf. The user has the flexibility to determine the refresh time of the UART communication packets with the flightcontroller by modifying the "COMM_REFRESH_TIME" define in the t4_servos_and_am32_escs_control_w_feedback.ino source file. This define specifies the delay in microseconds for each subsequent packet sent back to a Flightcontroller.

Note that it is very well possible to use another MCU, the MCU used on this PCB offered a swift and relatively cheap way to a robust solution.

Firmware

To compile the Firmware that needs to be flashed to a T4-Board one needs to install Arduino IDE and Teensy support via instruction follow this link. We used, and had great success with, v1.8.19. It is well possible a newer version even works, we did't try.

Real-life use

The Paparazzi UAV Autopilot stack is already flying around using this solution, see Paparazzi UAV with T4-Board It is important to note that for using this T4-Board also in your autopilot, the serial_act_t4 module should be added, and servotypes be set to t4, in your Airframe file. (Example is in the works...)

Wiring

For example one can use four(4) AM32 ESCs with KISS telemetry out, 10 Feetech STS3032 servos and 2 PWM servos connected to a T4-Board wired via this configuration:

Example of a T4-Board wirering schematic as a guide to build you own solution:

T4-Board wirering schematic

AM32 ESCs connection:

ESCs Signal PIN Telemetry PIN
ESC 1 4 0
ESC 2 8 7
ESC 3 24 15
ESC 4 9 25

Feetech STS3032 servos connection:

Servo number Servo ID PIN
Servo 1 1 20*21
Servo 2 2 20*21
Servo 3 3 20*21
Servo 4 4 20*21
Servo 5 5 20*29
Servo 6 6 28*29
Servo 7 7 28*29
Servo 8 8 28*29
Servo 9 9 28*29
Servo 10 10 28*29

The asterisk (*) symbol indicates that the pins need to be connected together. This common connection is required because the SerialBusServo utilizes a half-duplex serial protocol, where transmission and reception occur on the same line.

The Servo ID in this table above refers to the ID of the Serial servo that is connected to the BUS. The ID of the servo must first be set in the servo using a TTLinker Mini with this schematic using this TI SN74AHC1G04 inverter chip pre-made also available for example this one. There are numerous other suppliers to be found.

Generic PWM servos connection:

Servo number PIN
Servo 11 2
Servo 12 3

Connection to the Flightcontroller:

AP PIN Teensy PIN
AP UART TX 16
AP UART RX 17

Protocols used

If you want to improve, debug and understand this solution, the following documents may come in handy:

Serial Bus Servos

Implementation detail of the Serial Communication Servo (SCS) protocol to be found in this serial_servo_protocol.pdf document

DSHOT

Read all about the DSHOT protocol on this site

KISS

Get to know details about the KISS telemetry protocol in this document

T4

To get more about the T4-Board protocol current state the sourceode is the base

Links

A bunch of links we visited that helped in the quest towards this T4-Board solution.

Halfduplex single wire on STM32

Teensy UART related

Acknowledgements