ESP32 based Custom Flight Controller - Drones

Thread Starter

TommasoB

Joined Nov 26, 2023
27
Hello,

My name is Tommaso Bugliesi and I am a mechanical engineer currently engaged in the development of an open-source flight controller centered around the ESP32 chip. While this project is ambitious, I find myself encountering challenges in the realm of PCB design—an area where my expertise as a mechanical engineer is limited. Nevertheless, I am eager to expand my knowledge in this field.

I successfully crafted the initial PCB (refer to the attached schematic and board layout) and had it manufactured by a PCB production company. I meticulously assembled it by procuring all the necessary electrical components from Digikey and AliExpress. Unfortunately, I've encountered a setback— the assembled board doesn't function as intended.

I am reaching out in the hopes that someone with expertise in PCB design could spare some time to assist me in identifying potential errors in my work.

The primary issue revolves around the CP2102N-QFN28 chip. Regrettably, I've been unable to establish a USB connection with the board. The first assembled board was recognized by Windows, albeit with a hardware error 43. The subsequent attempt, aimed at refining the soldering process, resulted in a non-functional board.

I meticulously inspected all the main traces on the board, and everything appears to be in order. The sole anomaly I detected is a continuous 0.15V reading at the DP/DP pin of the micro USB connector. To be precise, there's 0.15V at DP and 0V at DN (values measured directly at the USB connector pins).

I would highly appreciate any additional insights or critiques regarding both the schematic and the board layout.

Thank you sincerely for your valuable time.

Best regards,
Tommaso Bugliesi

Attachments description:
1) Board_picture: Printed board with components. You may notice that I try to invert TX and RX, but I also test the configuration with layout of the schematic.
2) Board_Version_1: First Layout of the PCB that corresponds to the board shown in 1)
3) Board_Version_2: Board that I expect to get manufactured in the next future
4) Schematic: Electrical schematic of the the board. If required I can also provide the list of the all components I bought for this project.
 

Attachments

Last edited:

Irving

Joined Jan 30, 2016
3,794
Can't see anything obviously wrong around the CP2102 pins 1 - 8, but I'm sorry to say, your soldering leaves a lot to be desired and is probably the cause of your issues.
 

Thread Starter

TommasoB

Joined Nov 26, 2023
27
Can't see anything obviously wrong around the CP2102 pins 1 - 8, but I'm sorry to say, your soldering leaves a lot to be desired and is probably the cause of your issues.
Thank you for your feedback, Irving. I'm happy that the schematic around the CP2102N is correct. However, I had a few doubts:

  1. Resistor R9 is supposed to be 1kOhm according to the datasheet, but I found working boards that use a 2kOhm resistor, so I opted for it (I didn't have the 1kOhm at hand).
  2. As the manufactured board has no ground plane, I wonder if that could affect the circuit impedance and compromise the power-up and the serial handshaking between the computer and the board.

I will enhance my soldering setup, which is currently made of a custom-built Arduino-based hot plate.

Can soldering affect the behavior of a board even if there is no clear evidence of short circuits? I tested every track and pin.

Furthermore, I am using a 138°C soldering paste, aiming to keep the temperature of every component below 200°C during the soldering process.
 

camerart

Joined Feb 25, 2013
3,643
Thank you for your feedback, Irving. I'm happy that the schematic around the CP2102N is correct. However, I had a few doubts:

  1. Resistor R9 is supposed to be 1kOhm according to the datasheet, but I found working boards that use a 2kOhm resistor, so I opted for it (I didn't have the 1kOhm at hand).
  2. As the manufactured board has no ground plane, I wonder if that could affect the circuit impedance and compromise the power-up and the serial handshaking between the computer and the board.

I will enhance my soldering setup, which is currently made of a custom-built Arduino-based hot plate.

Can soldering affect the behavior of a board even if there is no clear evidence of short circuits? I tested every track and pin.

Furthermore, I am using a 138°C soldering paste, aiming to keep the temperature of every component below 200°C during the soldering process.
Hi T,
When testing tracks between pins, I have had problems when testing surface mount pins. The pin can be pressed onto the track, so it looks good, when it isn't.
C
 

Irving

Joined Jan 30, 2016
3,794
Thank you for your feedback, Irving. I'm happy that the schematic around the CP2102N is correct. However, I had a few doubts:

  1. Resistor R9 is supposed to be 1kOhm according to the datasheet, but I found working boards that use a 2kOhm resistor, so I opted for it (I didn't have the 1kOhm at hand).
  2. As the manufactured board has no ground plane, I wonder if that could affect the circuit impedance and compromise the power-up and the serial handshaking between the computer and the board.

I will enhance my soldering setup, which is currently made of a custom-built Arduino-based hot plate.

Can soldering affect the behavior of a board even if there is no clear evidence of short circuits? I tested every track and pin.

Furthermore, I am using a 138°C soldering paste, aiming to keep the temperature of every component below 200°C during the soldering process.
Are you using a stencil to apply the solder paste?

A ground plane is generally good practice & simplifies issues such as decoupling and EMI but isn't essential for a board this small and will have no effect on the relatively low speed UART processes.
 

Thread Starter

TommasoB

Joined Nov 26, 2023
27
Are you using a stencil to apply the solder paste?

A ground plane is generally good practice & simplifies issues such as decoupling and EMI but isn't essential for a board this small and will have no effect on the relatively low speed UART processes.
Yes, I used a stencil this time.

For this board I chose to add a ground plane also because the other board I will connect to has four 10kHz PWM pins and uses 2xSPI. Below this board there is a Power Distribution Board to supply four Brushless motor (peak current around 100A).

In my opinion the issue might be related to the CP2102 chip. The soldering could be an issue but I did several attempts always checking for bad connections.

For the next board I will purchase an oscilloscope. I will post further updates in this post.
 

camerart

Joined Feb 25, 2013
3,643
Hi T,
I had a quick look at the ESP-32 chip, and it's far superiour to the 2x I'm using.
I use a PIC that has a Quadrature encoder on it, which reads the Incrmental encoder, which is one of the mian reasons for starting my project, that is my eye sight. I can't always tell which way round my Tricopter is aiming, and I have to crash to avoid getting into mischief.

I also am a limited programmer and still use BASIC as my programming language, where I'm sure you use C+??

I imagine that you use the libraries for each of the instructions such as SPI or I2C, where I have made my own, instead of the better path of going to a 5 year university course.
C.
 

Thread Starter

TommasoB

Joined Nov 26, 2023
27
Hi t,
Earlier did you say that you have set your project to only read GNRMC?
If so did you use U-Center?
C
Hi t,
Earlier did you say that you have set your project to only read GNRMC?
If so did you use U-Center?
C
I still have to dig deep into the GPS module. It's going to be a step 2 or 3 in the design because first I have to create a inner loop for the hovering control.

For this kind of control GPS is not needed.

Hoovering can be achieved with a PID controller based on compass and accelerometer data.

The GPS will come into play for the outer loop control, that handles the drone tracking

To display data from the GPS i think I will connect the remote control via usb to the laptop, sending there the coordinates. Then I will use them with an external application to print the drone position on a map
 

camerart

Joined Feb 25, 2013
3,643
I still have to dig deep into the GPS module. It's going to be a step 2 or 3 in the design because first I have to create a inner loop for the hovering control.

For this kind of control GPS is not needed.

Hoovering can be achieved with a PID controller based on compass and accelerometer data.

The GPS will come into play for the outer loop control, that handles the drone tracking

To display data from the GPS i think I will connect the remote control via usb to the laptop, sending there the coordinates. Then I will use them with an external application to print the drone position on a map
Hi T,
Ok.
When you're ready have a look into U-Center, it has many features. An example of a feature, is that boundaries can be set where the REMOTE won't cross. I have difficulty with it, but I have managed to set the M8N to 5x /sec and read only GNRMC.

I have 2x PCBS BASE and REMOTE, with the system I'm making, the location is sent to the REMOTE, instead of the other way round, where it is steered and sends it's posistion back to BASE.
The idea is, that once the REMOTE receives the location, it goes to it, and say it looses signal, then it shold be found at that location.
I haven't thought too much about the map yet, but I would move the joysticks and the sent location 'cross' should move across the map, at the height and aim set.
C.
 

Thread Starter

TommasoB

Joined Nov 26, 2023
27
Hi T,
Ok.
When you're ready have a look into U-Center, it has many features. An example of a feature, is that boundaries can be set where the REMOTE won't cross. I have difficulty with it, but I have managed to set the M8N to 5x /sec and read only GNRMC.

I have 2x PCBS BASE and REMOTE, with the system I'm making, the location is sent to the REMOTE, instead of the other way round, where it is steered and sends it's posistion back to BASE.
The idea is, that once the REMOTE receives the location, it goes to it, and say it looses signal, then it shold be found at that location.
I haven't thought too much about the map yet, but I would move the joysticks and the sent location 'cross' should move across the map, at the height and aim set.
C.
First you need to concentrate on the stabilization of the system that is gps independent. You need to find a way to stabilize your system. In your case the PID logic may work well but you definitely need and accelerometer and a magnetometer. Once the drone is stable, you can control the way it moves to a target point. You also need e sensor to estimate the height of the drone, a GPS is not suitable because it works at a low frequency, you need at least 500 Hz.
 

camerart

Joined Feb 25, 2013
3,643
First you need to concentrate on the stabilization of the system that is gps independent. You need to find a way to stabilize your system. In your case the PID logic may work well but you definitely need and accelerometer and a magnetometer. Once the drone is stable, you can control the way it moves to a target point. You also need e sensor to estimate the height of the drone, a GPS is not suitable because it works at a low frequency, you need at least 500 Hz.
Hi T,
I'm not skilled enough to change how I do things, so I just carry on, I accept that you age will give you a much better result.
I use the same Barometer as you, BMP280, which I've sested for height accuracy, so my system will say got to this height, and the REMOTE will check if it's pressure is higher or lower that the sent height and move accordingly.
As for stability, I intend to use a KK2 board, which hopefully will do this, but that's cheating :)
C
 
Top