Skip to main content
1 of 2
tuskiomi
  • 205
  • 1
  • 11

What is the proper way to implenet PID

I'm having some trouble conceptualizing how to go about implementing PID into my Drone. there are a few ways I'm thinking about implementing the pipeline: Having one PID Object for each of the six motors, Having one PID Object for each axis

How I would implement PIDs on a per-motor basis: enter image description here

How I would implement PIDs on a per-axis basis: enter image description here

I'm guessing that the second one will be the best course of action, as it can all be put into it's own loop, where the PID data will be available on-demand, as oppose to calculations it on the spot. It is object oriented, and runs in the background.

The first one has it's appeals, too. It eliminates some of the caluclations needed in order to find the acutal value. It is procedural, and very straight forward and performes on the spot.

What do you guys think?

tuskiomi
  • 205
  • 1
  • 11