So i am trying to program for a diy quad Flight Controller with Arduino Due.My sensor reading time is approximately 2060us to get euler angle :o .so i am concerned about the control loop frequency.if any one can pitch in with thoughts I will be great full.Thanks in advance.
Approximately 2 milliseconds to compute an angle means that you can compute the angle approximately 500 times per second. Just how fast can your quadcopter go pear-shaped? Seems like providing correction input 500 times a second should be often enough.
Why does it take that long to get an angle?
The Long Interval for calculation of angle is because of the Sensor(BNO055,which give euler angle in less that 300us sometimes and very few times below 2060us .so i am keeping a timer to calculate upto 2060us.
But there will be other calculation time also require.so i am asking how low control frequency quad-copter flight controller can be.
so i am asking how low control frequency quad-copter flight controller can be.
That depends on how stable your quadcopter is. That is, how long does it take for things to go pear-shaped if you don't stay on top of them?
If your quadcopter is inherently stable, then updating it once a week is good. If your quadcopter is unstable, updating several times to several hundred times a second may be needed, depending on how unstable it is.
PaulS:
If your quadcopter is inherently stable, then updating it once a week is good.
HAha. That sarcasm.
well quad-copters are inherently unstable.The lowest frequency of control loop i have seen is 250Hz On something called YMFC-3D.
Thanks by the way
well quad-copters are inherently unstable
Why? If there are 4 nearly identical motors on the corners, spinning 4 nearly identical propellers, at nearly identical speeds, I would expect a quadcopter to be stable. Of course, nearly identical is not the same as identical, so there will be some instability.
The smaller the craft the faster the control loop has to be.
Hello ghoshatanu56,
Since mastering of the PID and "looptime" seem to be the core of a quadcopter flight, this could be a good start:
Actually I have developed a algorithm for quadcopter.lf any one can look into it
1.Initialize BNO055
Initialize pid for bumpless start
2.Read Values for Yaw, Pitch, Roll. Subtract Yaw, Pitch & Roll offsets from Each Reading.
3.Calculate The angles of yaw, Pitch & Roll
- Read Joystick Yaw, Pitch & Roll
5.Range the joystick Yaw, Pitch & Roll using map/Custom Map function
6.A) Find The error for each Yaw Pitch Roll Error=Present Yaw/Pitch /Roll-Transmitter Yaw/Pitch/Roll
B) Proportional=Kp*Error
C)Integral=Previous Integral + Error*Ki
D)Derivative= (Error-Previous Error) *Kd
7.a)Motor_1=Throttle - PID Output Pitch + PID Output Roll - PID Output Yaw
b)Motor_2=Throttle + PID Output Pitch + PID Output Roll + PID Output Yaw
c)Motor_3=Throttle + PID Output Pitch - PID Output Roll - PID Output Yaw
d)Motor_4=Throttle - PID Output Pitch - PID Output Roll + PID Output Yaw
PaulS:
Why? If there are 4 nearly identical motors on the corners, spinning 4 nearly identical propellers, at nearly identical speeds, I would expect a quadcopter to be stable. Of course, nearly identical is not the same as identical, so there will be some instability.
Not the case, completely unstable without a control loop because craft orientation is the double integral of
torque. The centre of mass is not suspended below the lift centre as in a helicopter.