mirror of
https://gitlab.waag.org/make/fablab/interns/2025/sam.git
synced 2025-08-05 13:06:56 +00:00
Compare commits
10 Commits
2d1a6ae1f6
...
main
Author | SHA1 | Date | |
---|---|---|---|
774f7f41d6 | |||
2a585ff318 | |||
e700818a2f | |||
6be2d84f05 | |||
d943d6239e | |||
7a4b75c0a3 | |||
a46ad186db | |||
7b3c164c6d | |||
9da84bb7a8 | |||
1009a14673 |
@@ -1,7 +1,7 @@
|
||||
# FR-1 Trace lengths
|
||||
|
||||
## The experiment
|
||||
For the experiment, I used FR-1 that has a thickness of 35µm. On there I will mill 4 trace sizes (0.4 mm, 0,6 mm, 0,8 mm and 1 mm) and they all have the same length of 7.5 cm’s. The traces are seperated by 1 Cm.
|
||||
For the experiment, I used FR-1 that has a thickness of 35µm. On there I will mill 4 trace sizes (0.4 mm, 0,6 mm, 0,8 mm and 1 mm) and they all have the same length of 7.5 cm’s. The traces are separated by 1 Cm.
|
||||
|
||||

|
||||
|
||||
@@ -26,26 +26,29 @@ The capacitance of a PCB trace is the amount of energy it can hold. It works lik
|
||||
The capacitance is determined by the amount of copper is in the trace. So length, width and the thickness. When working with low frequency signals the capacitance is not super important.
|
||||
But when working with higher speed frequencies the capacitance can actually mess up the signal integrity.
|
||||
|
||||
## Heat generation
|
||||
Heat within traces is generated by the current flowing through it. Not the wattage. A good example of the is train lines. These run on 230.000 volts on thin wires while being able to supply multiple trains. The higher the voltage the easier it is the transport a higher amount of wattage.
|
||||
|
||||
## Results
|
||||
|
||||
the power. So I grabbed an old robot with 4 stepper motors attached but I could not get them to draw more than 30 watts. So that is why the maximum in this test is 30 watts. I also had a hard time finding a way to measure the temperature of the traces because we only had a heat gun here and the laser was not the place it was actually measuring. So 0,4 mm is not measured properly.
|
||||
the power. So I grabbed an old robot with 4 stepper motors attached but I could not get them to draw more than 1.6 Amperage. So that is why the maximum in this test is 1.6 Amperage. I also had a hard time finding a way to measure the temperature of the traces because we only had a heat gun here and the laser was not the place it was actually measuring. So 0,4 mm is not measured properly.
|
||||
|
||||
| Trace Width Trace | Resistance | Maximum safe wattage | Burn out wattage |
|
||||
| :---------------- | ---------- | -------------------- | ---------------- |
|
||||
| 0,4mm | 3,1Ω | 15 | 20 |
|
||||
| 0,6mm 2 | 2Ω | 22 | 26 |
|
||||
| 0,8mm | 2Ω | 27 | ?? |
|
||||
| 1mm | 1,85Ω | ?? | ?? |
|
||||
| | | | |
|
||||
| Trace Width Trace | Resistance | Maximum safe Current in Ampere | Burn out Ampere |
|
||||
| :---------------- | ---------- | ------------------------------ | --------------- |
|
||||
| 0,4mm | 3.1Ω | 0.7 | 0.85 |
|
||||
| 0,6mm | 2.7Ω | 0.9 | 1.05 |
|
||||
| 0,8mm | 2Ω | 1.6 | ?? |
|
||||
| 1mm | 1.85Ω | ?? | ?? |
|
||||
| | | | |
|
||||
|
||||
|
||||
* The 0,4 mm trace was the first one I tested. I started with 15 watts for a few seconds. After that I increased the wattage to 20 watts and the trace instantly exploded and burned so I could not get temperature readings there.
|
||||
* The 0,4 mm trace was the first one I tested. I started with 0.7 amps for a few seconds. After that I increased the wattage to 0.85 amps and the trace instantly exploded and burned so I could not get temperature readings there.
|
||||
|
||||
* The 0,6 mm trace it held up well up to 27 watts where it started getting burn marks within a 5-10 seconds. The temperature rose to 50 degrees celsius. At 29 watts the pcb burned out at 68 degrees celsius.
|
||||
* The 0,6 mm trace it held up well up to 0.9 amps where it started getting burn marks within a 5-10 seconds. The temperature rose to 50 degrees celsius. At 1.05 amps the pcb burned out at 68 degrees celsius.
|
||||
|
||||
* When testing the 0,8 mm trace I hit a roof with how much power I could consume with the robot. I could only get up to 30 watts and I did not manage to break the trace after powering it for a few minutes. The maximum I found before it started discoloring was 24 watts at 54 degrees celsius. This was measured after it was left on for 2 minutes.
|
||||
* When testing the 0,8 mm trace I hit a roof with how much power I could consume with the robot. I could only get up to 1.6 amps and I did not manage to break the trace after powering it for a few minutes. The maximum I found before it started discoloring was 24 watts at 54 degrees celsius. This was measured after it was left on for 2 minutes.
|
||||
|
||||
* I could not get to the 1mm trace because the robot could not draw more than 30 watts. So thats why these are not filled in the table.
|
||||
* I could not get to the 1mm trace because the robot could not draw more than 1.6 Amperage. So thats why these are not filled in the table.
|
||||
|
||||
|
||||
## Extra notes on temperature
|
||||
|
BIN
docs/final_project/DroneMain.f3z
Normal file
BIN
docs/final_project/DroneMain.f3z
Normal file
Binary file not shown.
BIN
docs/final_project/DroneMainBody.stl
Normal file
BIN
docs/final_project/DroneMainBody.stl
Normal file
Binary file not shown.
BIN
docs/final_project/New DroneArm v5.f3d
Normal file
BIN
docs/final_project/New DroneArm v5.f3d
Normal file
Binary file not shown.
BIN
docs/final_project/PXL_20250604_121528011(1).mp4
Normal file
BIN
docs/final_project/PXL_20250604_121528011(1).mp4
Normal file
Binary file not shown.
BIN
docs/final_project/SidePanel.stl
Normal file
BIN
docs/final_project/SidePanel.stl
Normal file
Binary file not shown.
BIN
docs/final_project/arm.stl
Normal file
BIN
docs/final_project/arm.stl
Normal file
Binary file not shown.
BIN
docs/final_project/drone_control_board.zip
Normal file
BIN
docs/final_project/drone_control_board.zip
Normal file
Binary file not shown.
@@ -1,29 +1,29 @@
|
||||
# Final project
|
||||
|
||||
## Introduction
|
||||
I wanted to combine 2 random objects that interest me into one project. A drone and a jumbotron. So im gonna make a drone with multiple screens on it that could for example be used for traffic control or entertainment purposes.
|
||||
I wanted to combine 2 random objects that interest me into one project. A drone and a jumbotron. So im gonna make a drone with multiple screens on it that could for example be used for traffic control or entertainment purposes. There is no real reason why I chose to make this beside it looking and sounding fun to design and build.
|
||||
|
||||
## What does the drone do?
|
||||
The drone needs to be able to fly for at least 20 minutes. It needs 2 screens on both side so it can display images or video. I wanna program the drone myself so I know how drones work and how they keep themselves upright.
|
||||
|
||||
## Drone Requirements
|
||||
### basic requirements
|
||||
* 2 screens
|
||||
* Speakers
|
||||
* 20 min flight time
|
||||
* custom microcontroller pcb that controls the drones and screens
|
||||
* 50 meter range from controller
|
||||
??? Drone Requirements
|
||||
### basic requirements
|
||||
* 2 screens
|
||||
* Speakers
|
||||
* 20 min flight time
|
||||
* custom micro controller pcb that controls the drones and screens
|
||||
* 50 meter range from controller
|
||||
|
||||
### Sensors
|
||||
* GPS
|
||||
* IMU/rotation sensor
|
||||
* Read voltage from battery know battery percentage
|
||||
### Sensors
|
||||
* GPS
|
||||
* IMU/rotation sensor
|
||||
* Read voltage from battery know battery percentage
|
||||
|
||||
### Requirements when far ahead
|
||||
* Docking station
|
||||
* Automatic docking
|
||||
* Automatic pathing
|
||||
* Design own electronic speed controllers
|
||||
### Requirements when far ahead
|
||||
* Docking station
|
||||
* Automatic docking
|
||||
* Automatic pathing
|
||||
* Design own electronic speed controllers
|
||||
|
||||
## Images
|
||||
|
||||
@@ -50,7 +50,7 @@ When designing the drone I wanted to do everything parametric. So im going to tr
|
||||
### Designing the drone parametrically
|
||||
Designing parametrically is very hard because every constraint needs to be perfect. Otherwise when changing lengths the design will fold into itself like this.
|
||||

|
||||
I've spend one day getting the constraints perfect for the sketch so it scales well with everything. And this is the result of that. When I change one parameter in the variable menu the entire body scales with it. This is the final result of my design. I've made the body myself and I've imported the components from grabcad. So I had more time for blender and Onshape and so I could visualize it better.
|
||||
I've spend one day getting the constraints perfect for the sketch so it scales well with everything. And this is the result of that. When I change one parameter in the variable menu the entire body scales with it. This is the final result of my design. I've made the body myself and I've imported the components from GrabCad. So I had more time for blender and Onshape and so I could visualize it better.
|
||||

|
||||
|
||||
### Rendering
|
||||
@@ -143,13 +143,15 @@ For the drone I will be using the [dRehmFlight VTOL program](https://github.com/
|
||||
```mermaid
|
||||
classDiagram
|
||||
namespace Drone {
|
||||
class ESPC6 Thread 1{
|
||||
class ESPC6{
|
||||
+Control Motors
|
||||
+keep drone in the air
|
||||
+Receive communication from controller
|
||||
Flightcontroller()
|
||||
}
|
||||
class MatrixControllerThread2 {
|
||||
class MatrixControllerRP2040 {
|
||||
+Receive communication from ESPC6 for Matrix data
|
||||
ShowMatrix()
|
||||
|
||||
}
|
||||
|
||||
@@ -164,13 +166,15 @@ namespace Controller {
|
||||
}
|
||||
}
|
||||
|
||||
ESPC3 --> ESPC6 Thread 1 : Send data to flight controller using ESPNOW
|
||||
ESPC3 --> ESPC6 : Send data to flight controller using ESPNOW
|
||||
ESPC6 --> MatrixControllerRP2040 : Serial communication
|
||||
|
||||
```
|
||||
Now that I am in week 15 this has changed. The change is on the drone are going to be 2 mcu's. One for the matrixes and one for the flight controller. So they are both separate systems and can't interfere with each other.
|
||||
|
||||

|
||||
|
||||
I've already gotten the motors to spin in [week 10](../Assignments/week_10_output_devices/output_devices.md) using the script in there. Now I also need to modify the original VTOL driver so my ESC's can properly understand it's instructions.
|
||||
I have already gotten the motors to spin in [week 10](../Assignments/week_10_output_devices/output_devices.md) using the script in there. Now I also need to modify the original VTOL driver so my ESC's can properly understand it's instructions.
|
||||
|
||||
There's one specific function I need to change.
|
||||
??? Old code
|
||||
@@ -344,6 +348,10 @@ Now I needed to make the same holes through the case itself in the same location
|
||||
From this tab I can edit the body with all the references in place. So I could use the holes in the drone arm as reference for my cuts for in the drone body.
|
||||

|
||||
|
||||
## 3D printing
|
||||
I chose to fully 3D print my drone due to it's complex shape and time constraints. I still had a lot of work from university to do. We got encouraged to do compositing but that is super hard with the current design. However it would have been better since it is often lighter and more durable while being a lot more eco friendly. For 3D printing I am planning on using PLA because it has a lower carbon footprint than ABS and it releases less toxic fumes.
|
||||
|
||||

|
||||
|
||||
## Burnout!
|
||||
### Part 1
|
||||
@@ -366,6 +374,7 @@ This time it was completely my fault for not paying attention to the wires when
|
||||

|
||||
|
||||
<video controls src="../PXL_20250528_093723437(1)(1).mp4" title="Title"></video>
|
||||
|
||||
## Cables
|
||||
The drone needs lots of cables to get power to the places where they need to be. I first started out by laying out everything that needed to be connected.
|
||||
|
||||
@@ -415,7 +424,7 @@ I tested the power consumption on the matrix by setting the brightness to 100 an
|
||||

|
||||
The result of this is that a single matrix consumed 3,8 amps at 5 volt. With 4 ESC's providing a total of 12 amps at 5 volts I should be easily able to power the mcu's and the matrixes.
|
||||
## Assembly
|
||||
Here I started assembly of the drone. I printed the motor arms and screwed all the motors into them and soldered pogo pins to each to connect them to the esc's. Unfortanetly I don't know how to connect them yet because the wires aren't labeled. 2 motors need to spin left and the other 2 right for stability.
|
||||
Here I started assembly of the drone. I printed the motor arms and screwed all the motors into them and soldered pogo pins to each to connect them to the esc's. Unfortunately I don't know how to connect them yet because the wires aren't labeled. 2 motors need to spin left and the other 2 right for stability.
|
||||

|
||||
I also saw during assembly that the drone body warped a bit but that isn't going to ruin the fun. It will still fly.
|
||||

|
||||
@@ -441,10 +450,46 @@ And when doing heated inserts make sure to do a couple of extra wall layers. So
|
||||
## TODO
|
||||
* [ ] Matrix panel subsystem
|
||||
* [x] Rewrite PWM esc control system in driver
|
||||
* [ ] Does it fly?
|
||||
* [ ] Does it fly? (No it didn't)
|
||||
* [x] Power distribution system (for matrixes and mcu's)
|
||||
* [x] Test physical controller
|
||||
|
||||
## Testing the drone(V1)
|
||||
|
||||
The first test of the drone went horribly wrong. This was a first test with analog control with not stabilization feedback from the IMU to see if it would come off the ground. Sadly it did not go as expected.
|
||||
<video controls src="../PXL_20250604_121528011(1).mp4" title="Title"></video>
|
||||
|
||||
### What went wrong
|
||||
* The drone was not balanced
|
||||
* The drone was a bit too heavy
|
||||
* The drone didn't have good footing to the ground
|
||||
* Motors recalibrating themselves at some startups (Last startup that didn't happen)
|
||||
* The drone arm was too weak to resist the impact of the motors
|
||||
* The batteries weren't fastened inside the drone
|
||||
|
||||
### Improvements for next design
|
||||
* Proper legs so the drone doesn't fall over during takeoff
|
||||
* Lighter design while being as strong as possible with the least amount of material
|
||||
* A power switch because everything instantly starts once it gets power and that could be dangerous with extremely fast spinning propellors.
|
||||
* Fastened batteries
|
||||
|
||||

|
||||
|
||||
### The damage
|
||||

|
||||
One matrix board got a few ripped of leds and capacitors but I think I am able to repair that.
|
||||
|
||||

|
||||
2 ESC's and motors got completely tangled wires. I expect them to still work since they where still spinning after the impact.
|
||||
3/4 arms got ripped off due to the crash.
|
||||
|
||||

|
||||

|
||||
Luckily we placed cardboard under the drone incase something would happen. The propellors completely mauled the cardboard away where it hit.
|
||||
|
||||
Now that the drone is ripped into several pieces I will be abandoning this design and start from scratch on a second design. From this point on I can only go up.
|
||||
|
||||
|
||||
## BOM (bill of materials)
|
||||
|
||||
### Drone
|
||||
@@ -467,14 +512,14 @@ And when doing heated inserts make sure to do a couple of extra wall layers. So
|
||||
| | | |
|
||||
|
||||
#### Files
|
||||
* [Drone main body F3D]
|
||||
* [Drone arm F3D]
|
||||
* [Drone main body STL]
|
||||
* [Drone main arm STL]
|
||||
* [Drone side panel STL]
|
||||
* [Drone PCB's KiCad]
|
||||
* [Drone Software]
|
||||
* [Matrix Software]
|
||||
* [Drone main body F3Z](DroneMain.f3z)
|
||||
* [Drone arm F3D]("New DroneArm v5.f3d")
|
||||
* [Drone main body STL](DroneMainBody.stl)
|
||||
* [Drone main arm STL](arm.stl)
|
||||
* [Drone side panel STL](SidePanel.stl)
|
||||
* [Drone PCB's KiCad](drone_control_board.zip)
|
||||
* [Drone Software]()
|
||||
* [Matrix Software]()
|
||||
|
||||
### Drone controller
|
||||
#### Parts
|
||||
|
BIN
docs/final_project/image343.jpg
Normal file
BIN
docs/final_project/image343.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
BIN
docs/final_project/imaged-1.jpg
Normal file
BIN
docs/final_project/imaged-1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 86 KiB |
BIN
docs/final_project/imaged-2.jpg
Normal file
BIN
docs/final_project/imaged-2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
BIN
docs/final_project/imaged-3.jpg
Normal file
BIN
docs/final_project/imaged-3.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 76 KiB |
BIN
docs/final_project/imaged-4.jpg
Normal file
BIN
docs/final_project/imaged-4.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 79 KiB |
BIN
docs/final_project/imaged.jpg
Normal file
BIN
docs/final_project/imaged.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 76 KiB |
@@ -27,4 +27,34 @@ Im also busy with a project with connecting 4 led matrixes together so I can sho
|
||||
For this project I wanna build a traffic drone that can be used as temporary traffic signs or can be used at festivals to quickly display information.
|
||||
|
||||
### What software/hardware am I using
|
||||
For this project I'm using a mix of manjaro and windows. I use Windows for Fusion360 since I can't install it on manjaro and I use manjaro for the rest of my stuff since I daily drive it. I use visual studio code as my editor.
|
||||
For this project I'm using a mix of manjaro and windows. I use Windows for Fusion360 since I can't install it on manjaro and I use manjaro for the rest of my stuff since I daily drive it. I use visual studio code as my editor.
|
||||
|
||||
|
||||
## Schedule
|
||||
|
||||
| Date | Deadline |
|
||||
| ------ | -------------------------------------------------------------------------- |
|
||||
| Jan 29 | principles and practices, presentations, introductions, project management |
|
||||
| Feb 5 | computer-aided design |
|
||||
| Feb 12 | computer-controlled cutting |
|
||||
| Feb 19 | embedded programming |
|
||||
| Feb 26 | 3D scanning and printing |
|
||||
| Mar 5 | electronics design |
|
||||
| Mar 12 | computer-controlled machining |
|
||||
| Mar 19 | electronics production |
|
||||
| Mar 26 | input devices |
|
||||
| Apr 2 | output devices + Intermediate assessment |
|
||||
| Apr 9 | networking and communications |
|
||||
| Apr 16 | mechanical design, machine design |
|
||||
| Apr 30 | molding and casting |
|
||||
| May 7 | interface and application programming |
|
||||
| May 11 | Research paper version 1 |
|
||||
| May 13 | Drone revision 2 done |
|
||||
| May 14 | system integration |
|
||||
| May 28 | applications and implications + Last version research paper |
|
||||
| Jun 5 | Drone flight day |
|
||||
| Jun 6 | Presentation |
|
||||
| Jun 9 | final assignment presentations |
|
||||
| Jun 10 | Portfolio version 1 |
|
||||
| Jun 21 | Portfolio last version |
|
||||
| Jun 24 | Finals Assessment |
|
@@ -68,8 +68,11 @@ int x = matrix.width();
|
||||
int pass = 0;
|
||||
|
||||
void loop() {
|
||||
scrollingText("Hello World!", 50, matrix.Color(255, 0, 255));
|
||||
// matrixSerialLoop();
|
||||
matrix.fillScreen(0);
|
||||
matrix.setCursor(0, 0);
|
||||
matrix.setTextColor(matrix.Color(255, 0, 255));
|
||||
matrix.print("Outch");
|
||||
matrix.show();
|
||||
}
|
||||
|
||||
void scrollingText(String text, int speed, int color) {
|
||||
|
@@ -8,8 +8,8 @@ U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/U8X8_PIN_NONE);
|
||||
|
||||
const int MAXPWMVALUE = 2000;
|
||||
const int MINPWMVALUE = 1000;
|
||||
const uint8_t broadcastAddress[] = {0x8C, 0xBF, 0xEA, 0xCC, 0x8B, 0x18};
|
||||
// 8c:bf:ea:cc:8b:18
|
||||
const uint8_t broadcastAddress[] = {0xE4, 0xB3, 0x23, 0xB5, 0x8D, 0xD0};
|
||||
// e4:b3:23:b5:8d:d0
|
||||
//=====================================================================================//
|
||||
// Struct declarations
|
||||
typedef struct filteredJoystickData
|
||||
|
@@ -28,7 +28,6 @@ http://www.bolderflight.com
|
||||
Thank you to:
|
||||
RcGroups 'jihlein' - IMU implementation overhaul + SBUS implementation.
|
||||
Everyone that sends me pictures and videos of your flying creations! -Nick
|
||||
|
||||
*/
|
||||
|
||||
//========================================================================================================================//
|
||||
@@ -237,10 +236,10 @@ const int ch5Pin = 17; // gear (throttle cut)
|
||||
const int ch6Pin = 17; // aux1 (free aux channel)
|
||||
const int PPM_Pin = 17;
|
||||
// OneShot125 ESC pin outputs:
|
||||
const int m1Pin = D10;
|
||||
const int m2Pin = D9;
|
||||
const int m3Pin = D3;
|
||||
const int m4Pin = D2;
|
||||
const int m1Pin = D9; // Front Right CW (top right motor)
|
||||
const int m2Pin = D10; // Front Left CCW (top left motor)
|
||||
const int m3Pin = D3; // Back Right CCW (bottom right motor)
|
||||
const int m4Pin = D2; // Back Left CW (bottom left motor)
|
||||
const int m5Pin = D7; //for some readon D9 doesnt work
|
||||
const int m6Pin = D8;
|
||||
|
||||
@@ -360,6 +359,8 @@ int pulseWidthToDutyCycle(int pulseWidth);
|
||||
void setupMatrixSerial();
|
||||
void printPitchInfo();
|
||||
void printAttitudeDebug();
|
||||
void testIndividualMotors();
|
||||
void armMotors();
|
||||
//========================================================================================================================//
|
||||
// VOID SETUP //
|
||||
//========================================================================================================================//
|
||||
@@ -411,7 +412,7 @@ void setup()
|
||||
|
||||
delay(5);
|
||||
|
||||
// calibrateESCs(); //PROPS OFF. Uncomment this to calibrate your ESCs by setting throttle stick to max, powering on, and lowering throttle to zero after the beeps
|
||||
calibrateESCs(); //PROPS OFF. Uncomment this to calibrate your ESCs by setting throttle stick to max, powering on, and lowering throttle to zero after the beeps
|
||||
// Code will not proceed past here if this function is uncommented!
|
||||
|
||||
// Arm OneShot125 motors
|
||||
@@ -430,6 +431,8 @@ void setup()
|
||||
|
||||
// If using MPU9250 IMU, uncomment for one-time magnetometer calibration (may need to repeat for new locations)
|
||||
// calibrateMagnetometer(); //Generates magentometer error and scale factors to be pasted in user-specified variables section
|
||||
// armMotors();
|
||||
// testIndividualMotors(); // Test individual motors by commanding them to 1200us pulse length for 1 second each
|
||||
}
|
||||
|
||||
//========================================================================================================================//
|
||||
@@ -512,10 +515,10 @@ void controlMixer()
|
||||
*/
|
||||
|
||||
// Quad mixer with pitch bias because the sensor isnt flat on the board
|
||||
m1_command_scaled = thro_des - pitch_PID + roll_PID - yaw_PID; // Front Left CCW
|
||||
m2_command_scaled = thro_des - pitch_PID - roll_PID + yaw_PID; // Front Right CW
|
||||
m3_command_scaled = thro_des + pitch_PID - roll_PID - yaw_PID; // Back Right CCW
|
||||
m4_command_scaled = thro_des + pitch_PID + roll_PID + yaw_PID; // Back Left CW
|
||||
m1_command_scaled = thro_des + roll_PID - pitch_PID + yaw_PID; // Front Right CW
|
||||
m2_command_scaled = thro_des - roll_PID - pitch_PID - yaw_PID; // Back Left CW
|
||||
m3_command_scaled = thro_des + roll_PID + pitch_PID - yaw_PID; // Back Right CCW
|
||||
m4_command_scaled = thro_des - roll_PID + pitch_PID + yaw_PID; // Front Left CCW
|
||||
|
||||
m5_command_scaled = 0;
|
||||
m6_command_scaled = 0;
|
||||
@@ -1460,21 +1463,6 @@ void commandMotors() {
|
||||
ledcWrite(m6Pin, pulseWidthToDutyCycle(m6_duty));
|
||||
}
|
||||
|
||||
void armMotors()
|
||||
{
|
||||
// DESCRIPTION: Sends many command pulses to the motors, to be used to arm motors in the void setup()
|
||||
/*
|
||||
* Loops over the commandMotors() function 50 times with a delay in between, simulating how the commandMotors()
|
||||
* function is used in the main loop. Ensures motors arm within the void setup() where there are some delays
|
||||
* for other processes that sometimes prevent motors from arming.
|
||||
*/
|
||||
for (int i = 0; i <= 50; i++)
|
||||
{
|
||||
commandMotors();
|
||||
delay(2);
|
||||
}
|
||||
}
|
||||
|
||||
void calibrateESCs()
|
||||
{
|
||||
// DESCRIPTION: Used in void setup() to allow standard ESC calibration procedure with the radio to take place.
|
||||
@@ -1929,6 +1917,56 @@ void printAttitudeDebug() {
|
||||
}
|
||||
}
|
||||
|
||||
void testIndividualMotors() {
|
||||
Serial.println("=== MOTOR PIN TEST - PROPS OFF! ===");
|
||||
|
||||
// Test each pin individually for 3 seconds
|
||||
Serial.println("Testing D3 (m1Pin) for 3 seconds...");
|
||||
ledcWrite(D3, pulseWidthToDutyCycle(1300));
|
||||
delay(3000);
|
||||
ledcWrite(D3, pulseWidthToDutyCycle(1000));
|
||||
delay(2000);
|
||||
|
||||
Serial.println("Testing D2 (m2Pin) for 3 seconds...");
|
||||
ledcWrite(D2, pulseWidthToDutyCycle(1300));
|
||||
delay(3000);
|
||||
ledcWrite(D2, pulseWidthToDutyCycle(1000));
|
||||
delay(2000);
|
||||
|
||||
Serial.println("Testing D10 (m3Pin) for 3 seconds...");
|
||||
ledcWrite(D10, pulseWidthToDutyCycle(1300));
|
||||
delay(3000);
|
||||
ledcWrite(D10, pulseWidthToDutyCycle(1000));
|
||||
delay(2000);
|
||||
|
||||
Serial.println("Testing D9 (m4Pin) for 3 seconds...");
|
||||
ledcWrite(D9, pulseWidthToDutyCycle(1300));
|
||||
delay(3000);
|
||||
ledcWrite(D9, pulseWidthToDutyCycle(1000));
|
||||
delay(2000);
|
||||
|
||||
Serial.println("Test complete! Note which physical motor each pin controls.");
|
||||
|
||||
while(true) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
void armMotors(){
|
||||
|
||||
|
||||
ledcWrite(m1Pin, pulseWidthToDutyCycle(2000)); // maximum pulse width (2000μs)
|
||||
ledcWrite(m2Pin, pulseWidthToDutyCycle(2000));
|
||||
ledcWrite(m3Pin, pulseWidthToDutyCycle(2000));
|
||||
ledcWrite(m4Pin, pulseWidthToDutyCycle(2000));
|
||||
|
||||
delay(9000);
|
||||
ledcWrite(m1Pin, pulseWidthToDutyCycle(1000)); // Minimum pulse width (1000μs)
|
||||
ledcWrite(m2Pin, pulseWidthToDutyCycle(1000));
|
||||
ledcWrite(m3Pin, pulseWidthToDutyCycle(1000));
|
||||
ledcWrite(m4Pin, pulseWidthToDutyCycle(1000));
|
||||
}
|
||||
|
||||
//=========================================================================================//
|
||||
|
||||
// HELPER FUNCTIONS
|
||||
|
Reference in New Issue
Block a user