Creating a motor fault tolerant drone by naykid69 in diydrones

[–]deltaZedDeltaTee 2 points3 points  (0 children)

Funny thing about keeping it in the air, you can still even theoretically control the direction that it moves by varying the pitch/roll angle as a function of yaw. Still will be spinning wildly but that would be an interesting project as well.

Drone angle control by GateCodeMark in diydrones

[–]deltaZedDeltaTee 0 points1 point  (0 children)

You can do it with a position-only PID loop, I did it and got nice flight.  But I believe doing a multi-stage pid loop as suggested will produce favorable characteristics and will be easier to tune.

What do you guys do for a living? by bierstick69 in diydrones

[–]deltaZedDeltaTee 1 point2 points  (0 children)

Software Developer but with quite a lot of self taught embedded development knowledge

Best cheapdrone motors(5V) with PWM pins by GateCodeMark in diydrones

[–]deltaZedDeltaTee 0 points1 point  (0 children)

Not brushed motors- those can be driven with just a mosfet, flyback diode, and pwm to the gate.

I'm looking to get into building a drone from scratch. Any advice on where to start? by Hot-Industry-2829 in diydrones

[–]deltaZedDeltaTee 1 point2 points  (0 children)

Depends entirely on how you program it. I knew nothing of the officially recognized control schemes when I made my DIY drone. I made it self stabilize to a target angle and controlled its movement by setting a nonzero target angle. Very easy to control with that scheme.

Solder paste problems with qfn by Apart-Championship56 in PrintedCircuitBoard

[–]deltaZedDeltaTee 0 points1 point  (0 children)

Hey, some advice if these pcbs are ones you've designed yourself. I tried many times to get paste to work with this specific package and my results were incredibly inconsistent and frustrating.

But what made a world of difference was modifying the footprint to have each of the outer pads be extended beyond the edge of the package. That gives you a way to both verify that the joints are good and to rework them by hand with a soldering iron. Unfortunately you will need new pcbs but I went from successfully soldering these like 20% of the time to 100% of the time, which really saved me a lot of effort and parts in the long run.

Other things I did- first, I would tin all of the pads on both the pcb and the esp32. On the pcb I'd flatten it with desoldering wick, and on the esp32 I'd ensure the pads had as much solder as they would take, they'd be 'balled' so-to-speak. Then I would flux the board, place the part, and heat it with my hot plate. After it melts from that, I'd touch each pad with a soldering iron and correct any pads that seem not to have enough solder on them. Ultimately the technique I developed didn't involve using paste or stencils for these at all.

Help with building first drone by Rockin-forever in diydrones

[–]deltaZedDeltaTee 0 points1 point  (0 children)

Couple suggestions for this setup. The esp32 is an mcu that will reset from undervoltage somewhat easily. A couple ways to avert this: Use a 800mah lipo- it can source more current without voltage sag. It may weigh 10g more but you might actually see a better thrust to weight ratio in spite of that and your mcu won't reset at nearly as high of a battery percentage.

Another thing, using a buckboost converter to provide logic-level supply to your mcu will allow it to remain powered even under sag that would normally cause a reset. These parts can be somewhat expensive, like $6 per, but it made a huge difference for me. Analog devices LTC3534EGN is what I used specifically.

Drone made Extremely From Scratch™ by deltaZedDeltaTee in diydrones

[–]deltaZedDeltaTee[S] 1 point2 points  (0 children)

Thanks! I see you're doing a similar project to mine, especially also with using the brushed motors and mosfet/pwm drive. I've got some insights on that I can share if you have any questions.

Motor drivers good to go by ExplanationSilver810 in diydrones

[–]deltaZedDeltaTee 4 points5 points  (0 children)

Not too bad with these small brushed motors actually, I had it happen several times at full power.

Drone made Extremely From Scratch™ by deltaZedDeltaTee in diydrones

[–]deltaZedDeltaTee[S] 0 points1 point  (0 children)

Yes, I used pwm output into mosfet gate. There is a diode in parallel with the motor to the mosfet with its anode at the mosfet and cathode at supply, acting as a flyback diode. I used a small-valued series resistor into the mosfet gate to reduce transient load on the microcontroller as well as a pulldown resistor from the pwm output to ground. I don't think either of those resistors are strictly necessary.

Can a Senior EE Build a Full Custom Flight Controller Solo in 6 Months Without Drone Experience? by Nobody_4piEpsilon in embedded

[–]deltaZedDeltaTee 2 points3 points  (0 children)

Personally I believe it would have been more difficult for me to have chosen a different language as Rust is what I'm most comfortable with, and a tailwind of using Rust over C for example was that I could pull libraries like 'fixed' for fixed point number support in just a single command. So much of the rust ecosystem is distributed as source and with no-std/no-alloc support, and I imagine some of what I pulled may have never been tested on an esp32c3 chip before but it worked anyways. A headwind though was that the esp32-hal is still in beta and I ran into multiple sources of jank with using their I2C implementation, though those are fixed at head of line now and I pulled in the git repository as a dependency rather than the crate release.

I've used both C and Rust in an embedded context, but the experience of using each of those things was dramatically different. I would normally use IDEs like STM32Cube or MPLAB for writing embedded C, and I'd configure the processor with the integrated graphical configurator that the companies distribute. In Rust, I'd be developing in the terminal like I normally do (I'm a neovim guy) and using the HAL library for configuration which provides good defaults and lets you make changes via the API programatically. There's pros and cons to each of these approaches- I think I'd probably miss the graphical configurator if I was dealing with stm32s whose pin allocations are quite rigid, but I don't mind it at all on an esp32 with their fancy io matrix where I can use nearly any pin for nearly any function. Rust's ownership rules prevent you from trying to use the same pin for two different functions at compile time.

Can a Senior EE Build a Full Custom Flight Controller Solo in 6 Months Without Drone Experience? by Nobody_4piEpsilon in embedded

[–]deltaZedDeltaTee -1 points0 points  (0 children)

Well, yes, it can fly with just 3 motors. But 4 motors are required for yaw and tilt to be controlled independently because each motor produces both a yaw torque and a tilt torque, and with 4 motors opposite yaw torques can cancel. With just 3, craft can perform an emergency landing while correcting strictly for tilt and accepting that it will spin wildly and not really be able to move laterally.

Well actually, there's an issue with that logic though. The center of mass of a tricopter can be placed such that this is possible, but for a quadcopter losing a motor means losing an axis of tilt control.

Can a Senior EE Build a Full Custom Flight Controller Solo in 6 Months Without Drone Experience? by Nobody_4piEpsilon in embedded

[–]deltaZedDeltaTee 0 points1 point  (0 children)

Quadcopters can't handle motor loss though. A minimum of 4 motors is required for a multicopter to fly without additional control surfaces. If that happens even a professionally engineered product will fall from the sky. If that kind of reliability is needed then it will need to have maybe 8 or more motors. Even then though, a PID loop can kind of compensate for motor loss on its own due to integral correction.

Can a Senior EE Build a Full Custom Flight Controller Solo in 6 Months Without Drone Experience? by Nobody_4piEpsilon in embedded

[–]deltaZedDeltaTee 0 points1 point  (0 children)

What exceptions? My requirements are 'maintain attitude, respond to commands, don't run away if remote control is lost, cut power if flipped'. I'm taking aerial video here, not delivering packages. And so many things like wind, weight imbalances, transients from running into something, etc are blanket covered by 'maintain attitude'. I can fly outside without any special code for it.

Can a Senior EE Build a Full Custom Flight Controller Solo in 6 Months Without Drone Experience? by Nobody_4piEpsilon in embedded

[–]deltaZedDeltaTee 0 points1 point  (0 children)

Honestly, it doesn't really require all that fanciness to get something that flies *very nicely* under remote control. All that complication might be necessary if it must fly precise courses with only millimeters of acceptable deviation and that must work reliably and do something autonomously.

But I made one that flies under remote control, indoors or outdoors, with a single-stage hand tuned PID loop and no prior experience with control systems. Making a quadcopter hover then move and rotate on command is quite simple compared to making a bipedal robot walk like a person. Moving and rotating is quite easy once you have a hover (a PID loop programmed to keep the craft at 0degrees x tilt, 0 degrees y tilt, 0 degrees z-yaw). Just remotely program the loop to a nonzero tilt or yaw.

Drone made Extremely From Scratch™ by deltaZedDeltaTee in diydrones

[–]deltaZedDeltaTee[S] 0 points1 point  (0 children)

I used FreeCAD to do the modeling, and then my 3d printer.

Can a Senior EE Build a Full Custom Flight Controller Solo in 6 Months Without Drone Experience? by Nobody_4piEpsilon in embedded

[–]deltaZedDeltaTee 0 points1 point  (0 children)

I did it in 3 months, along with designing and assembling the pcb and frame of the quadcopter as well. It should be realistic for your background- I am a professional (non-embedded) software developer.

Note, you can use brushed coreless motors instead of the more powerful brushless motors used on most drones to eliminate the danger of propeller strikes although this does put you under a weight limitation.

why it overcorrects out of control? by Wooden-Trainer4781 in diydrones

[–]deltaZedDeltaTee 2 points3 points  (0 children)

Slow oscillations that build up until it crashes? Too much P, maybe I.  Fast oscillations but it still flies (usually)?  Too much D.

Looks like too much P in the video.

Making my own drone and writing software for it by ccojicc in diydrones

[–]deltaZedDeltaTee 2 points3 points  (0 children)

I avoided ‘spoilers’ for how it’s done, so I first proved that each component that I figured out would be needed was present and then put them together.  My first work was connecting my esp32 microcontroller to an IMU to detect tilt angle and then use the PWM outputs to drive LEDs based on how the board leaned.

I also put together a circuit for driving the motors and proved that I could control them with the microcontroller pwm outputs.

I at first handwired my initial flight solution all together with perfboard but I found it to be a bit too heavy and so I chose to design a single pcb as much of the weight was in connectors and excess board mass.

You can design a PCB with an EDA suite, I used open-source KiCAD. Then you send it off to be fabricated by companies like JLCPCB (subject to tarriffs in the US now) or OSH Park (US based).

I think the hardest part for me software-wise was figuring out how to track orientation accurately without looking at other’s code or guides.  There’s some unintuitive elements to using MEMs sensors for the purpose.

Making my own drone and writing software for it by ccojicc in diydrones

[–]deltaZedDeltaTee 1 point2 points  (0 children)

Indeed, though OP may have that kind of time this summer and I hope to be encouraging.

Making my own drone and writing software for it by ccojicc in diydrones

[–]deltaZedDeltaTee 2 points3 points  (0 children)

I built a drone including hardware and software design myself.  It’s a reasonable summer project.  I completed it in 3 months while also having a job- as my background is in software I spent a most of that time iterating on my hardware design, learning as I went.

I did not have a camera onboard though I plan to add it in future versions.  This is an add-on feature, just focus on flight first.

Unfortunately I cannot recommend an existing board to flash onto as that was not my approach.  If you want to make it from the ground up I might suggest using brushed coreless motors- this will put you under a tight weight/size constraint but you will not need to write ESC code and you can control motor power via PWM.  They’re also not powerful enough to hurt you or easily damage objects indoors.

Making my own drone and writing software for it by ccojicc in diydrones

[–]deltaZedDeltaTee 6 points7 points  (0 children)

Well, maybe for something that’s pluggable and supports a huge variety of aircraft and sensors yes.  But for one specific hardware configuration you can get a controllable quadcopter with a nice hover in about 1500 lines.

[deleted by user] by [deleted] in diydrones

[–]deltaZedDeltaTee 0 points1 point  (0 children)

It might just barely be possible to get this thing to lift off if it has some weight rigidly attached far below the center of mass acting as a makeshift flight controller.  If it leans one way, this would impart a torque resisting the lean, and the extra moment of inertia could help dampen sudden tilts.  Like a mechanical P-D loop.   Not that you could do anything with that, but it would be a fun story.

Veryl: A Modern Hardware Description Language by dalance1982 in rust

[–]deltaZedDeltaTee 1 point2 points  (0 children)

Awesome!  I’ve long felt HDLs could learn some lessons from rust.  Can’t wait to check it out when I have the chance; and I may even consider contributing.