You are browsing as a guest. Sign up (or log in) to start making projects!

1h 15m 1s logged

Devlog #3
I replaced the attitude lag from Devlog #2 with real rotational dynamics such as torque, inertia, and actual angular acceleration. Previously, I was assuming that attitude eventually catches up.


New states and new physics
The state vector went from 9 to 12: added p, q, r, the drone’s spin rate around its own x, y, and z axes. These are the rotational equivalent of vx, vy, vz, just measuring how fast orientation is changing instead of how fast position is changing.
I added an inertia matrix, a diagonal 3x3 of made-up placeholder numbers representing how hard it is to spin the drone around each axis, similar to mass.
The output is torque instead of thrust, and it feeds into torque divided by inertia to produce angular acceleration.


Bugs

  1. The desired-attitude error vector and the spin-rate vector were stacked in different orders (theta/phi/psi vs. p/q/r, which is roll/pitch/yaw), so the controller was correcting the wrong axis against the wrong spin rate.
  2. The drone would approach a waypoint and then spiral into a slowly tightening orbit around it instead of settling, and in one attempt, diverged outward entirely. It reproduced the same spiral with a single fixed target and no waypoint switching at all. I found that the actual fix wasn’t more damping. Increasing the damping gain alone made it worse, not better. The real issue was that the attitude loop needed to react faster overall to keep pace with how aggressively the position loop was demanding tilt changes. Increasing the correction gain substantially fixed it for now.

Where it stands now
With gains rebalanced, the drone flies a full waypoint sequence with real torque-driven attitude dynamics. Spin rates spike on each maneuver and cleanly damp back to zero. One nice side effect of finally having real dynamics is that the path through a waypoint now visibly curves rather than shooting straight there, because aggressive tilting to accelerate sideways steals from the vertical thrust component.


Next up
Everything from here is trajectory generation such as replacing simple point-to-point waypoint chasing with differential-flatness-based polynomial paths. The journey has been difficult so far, especially as this is my first time interacting with vectors and matrices (3b1b’s linear algebra series is the only thing helping me out). Nevertheless, I am persevered to get a finished project.

0
28

Comments 0

No comments yet. Be the first!