BigQuad used but the drone is very unstable

Firmware/software/electronics/mechanics
Post Reply
Allen
Beginner
Posts: 17
Joined: Tue Nov 24, 2020 2:05 am

BigQuad used but the drone is very unstable

Post by Allen »

Hello!

I tried to use the BigQuad to build a bigger drone,and now, I successfully assembled a bigger drone.

when I didn't install the propeller,I tried to connect the drone to the client,and use the remote control to control it ,I sent some commands through the remote control,

but the drone shaked violently,then I realized that I need to change some parameters in the code,

so my question is what parameters do I need to change ,and where are they in the code ?

Is there any basis for changing the parameters? And how to evaluate a good parameter?

thank you very much!
tobias
Bitcraze
Posts: 2120
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: BigQuad used but the drone is very unstable

Post by tobias »

We are still lacking a tuning guide :oops:

Some pointers you can find in this post. There are tuns of guides on the internet though which might be a good start. Generally a bigquad/bolt will be more powerful so start by reducing RATE P,I and D by half end test. You can use the parameter framework to test them "live" but currently to make them stick you need to change pid.h and compile->flash.
Allen
Beginner
Posts: 17
Joined: Tue Nov 24, 2020 2:05 am

Re: BigQuad used but the drone is very unstable

Post by Allen »

tobias wrote: Mon Apr 12, 2021 11:37 am We are still lacking a tuning guide :oops:

Some pointers you can find in this post. There are tuns of guides on the internet though which might be a good start. Generally a bigquad/bolt will be more powerful so start by reducing RATE P,I and D by half end test. You can use the parameter framework to test them "live" but currently to make them stick you need to change pid.h and compile->flash.

Thanks for your reply!
I have another question.I read other blogs,some of them mentioned kalman filter, I want to know if I want to make the bigger drone more stable,what should I do besides change the pid? For example the mass of the bigger drone and the thrust of the bigger drone. And how to change these values? In the config. mk or somewhere else?
Thanks!
tobias
Bitcraze
Posts: 2120
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: BigQuad used but the drone is very unstable

Post by tobias »

Hi,

The Kalman filter no longer needs the weight/thrust so nothing to do there. What might need tuning is the different position controllers. If you are using the PID (which is a good start) you should alter the BaseThrust here. The other PID position parameters should work but could also be tuned for e.g. more "aggressive" behavior.

So what should be enough to get you started is to define this in my config.mk file:

Code: Select all

# Bolt/bigQuad compile flags. Set CF_MASS in kg and DEFAULT_IDLE_THRUST to appropriate idle trust value.
CFLAGS += -DCF_MASS=0.1f
CFLAGS += -DENABLE_ONESHOT125
CFLAGS += -DSTART_DISARMED
CFLAGS += -DDEFAULT_IDLE_THRUST=5000
Tune pid.h and position_controller_pid.c which can be tested "live" using the parameters in the cfclient.
Allen
Beginner
Posts: 17
Joined: Tue Nov 24, 2020 2:05 am

Re: BigQuad used but the drone is very unstable

Post by Allen »

tobias wrote: Fri Apr 16, 2021 8:57 am Hi,

The Kalman filter no longer needs the weight/thrust so nothing to do there. What might need tuning is the different position controllers. If you are using the PID (which is a good start) you should alter the BaseThrust here. The other PID position parameters should work but could also be tuned for e.g. more "aggressive" behavior.

So what should be enough to get you started is to define this in my config.mk file:

Code: Select all

# Bolt/bigQuad compile flags. Set CF_MASS in kg and DEFAULT_IDLE_THRUST to appropriate idle trust value.
CFLAGS += -DCF_MASS=0.1f
CFLAGS += -DENABLE_ONESHOT125
CFLAGS += -DSTART_DISARMED
CFLAGS += -DDEFAULT_IDLE_THRUST=5000
Tune pid.h and position_controller_pid.c which can be tested "live" using the parameters in the cfclient.
Thanks,but what does "f" mean in "0.1f"? :? my drone is probably 1kg.
tobias
Bitcraze
Posts: 2120
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: BigQuad used but the drone is very unstable

Post by tobias »

CF_MASS should be in kg so in your case 1.0f. "f" is to tell the compiler it is a floating point number.
Allen
Beginner
Posts: 17
Joined: Tue Nov 24, 2020 2:05 am

Re: BigQuad used but the drone is very unstable

Post by Allen »

tobias wrote: Fri Apr 16, 2021 8:57 am Hi,

The Kalman filter no longer needs the weight/thrust so nothing to do there. What might need tuning is the different position controllers. If you are using the PID (which is a good start) you should alter the BaseThrust here. The other PID position parameters should work but could also be tuned for e.g. more "aggressive" behavior.

So what should be enough to get you started is to define this in my config.mk file:

Code: Select all

# Bolt/bigQuad compile flags. Set CF_MASS in kg and DEFAULT_IDLE_THRUST to appropriate idle trust value.
CFLAGS += -DCF_MASS=0.1f
CFLAGS += -DENABLE_ONESHOT125
CFLAGS += -DSTART_DISARMED
CFLAGS += -DDEFAULT_IDLE_THRUST=5000
Tune pid.h and position_controller_pid.c which can be tested "live" using the parameters in the cfclient.
hi,
I tried and only used the following code in config.mk:

Code: Select all

CFLAGS += -DCF_MASS=0.56f 
CFLAGS += -DENABLE_BQ_DECK
CFLAGS += -DSTART_DISARMED
CFLAGS += -DDEFAULT_IDLE_THRUST=5000
CFLAGS += -DENABLE_ONESHOT125
but when I control the drone in the client,the propeller did not turn.
Even when I only use these codes:

Code: Select all

CFLAGS += -DCF_MASS=0.56f 
CFLAGS += -DENABLE_BQ_DECK
CFLAGS += -DENABLE_ONESHOT125
the propeller did not turn,either.

And I am sure ESC is in oneshot125 mode.
Do I need to add other codes to the config.mk file? or what code do I need to delete?
Thank you!
Allen
Beginner
Posts: 17
Joined: Tue Nov 24, 2020 2:05 am

Re: BigQuad used but the drone is very unstable

Post by Allen »

tobias wrote: Fri Apr 16, 2021 8:57 am Hi,

The Kalman filter no longer needs the weight/thrust so nothing to do there. What might need tuning is the different position controllers. If you are using the PID (which is a good start) you should alter the BaseThrust here. The other PID position parameters should work but could also be tuned for e.g. more "aggressive" behavior.

So what should be enough to get you started is to define this in my config.mk file:

Code: Select all

# Bolt/bigQuad compile flags. Set CF_MASS in kg and DEFAULT_IDLE_THRUST to appropriate idle trust value.
CFLAGS += -DCF_MASS=0.1f
CFLAGS += -DENABLE_ONESHOT125
CFLAGS += -DSTART_DISARMED
CFLAGS += -DDEFAULT_IDLE_THRUST=5000
Tune pid.h and position_controller_pid.c which can be tested "live" using the parameters in the cfclient.
when I add

Code: Select all

CFLAGS += -DCF_MASS=0.56f 
CFLAGS += -DENABLE_BQ_DECK
CFLAGS += -DDEFAULT_IDLE_THRUST=5000
CFLAGS += -DENABLE_ONESHOT125
to config.mk,the motor can turn.
After trying one by one, I found when I add

Code: Select all

CFLAGS += -DSTART_DISARMED
in the above program,the motor cannot turn...

so why?
thank you!
tobias
Bitcraze
Posts: 2120
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: BigQuad used but the drone is very unstable

Post by tobias »

Yes the START_DISARMED probably needs some explanation. It is a safety mechanism and you can decide if you like to use it or not. To arm the motors the parameter system.forceArm needs to be set to 1. This will arm the motors.
Post Reply