stabilizer mode variable in the firmware? and other basic PID Qs

Post here to get support
Post Reply
cafeciaojoe
Beginner
Posts: 25
Joined: Mon Jun 18, 2018 2:37 am

stabilizer mode variable in the firmware? and other basic PID Qs

Post by cafeciaojoe » Tue Jan 22, 2019 6:41 am

stabilizer mode variable in the firmware? and other basic PID Qs

Hi crazyfliers

Have some really basic questions here.

[1] Does rate and attitude mode still exist in the current crazyflie firmware? If so can someone point me to it in the code?

One user said it is here??

https://github.com/bitcraze/crazyflie-f ... rpyt.c#L70 but I cant see it in the eclipse project space (see picture attached)

I can'd find it in the wiki either...

[2] what is the difference between putting all of the attitude pid values to 0 and hard coding the CF into Rate mode?

don't both methods stop the attitude loop of the pid from doing anything?

[3] when I am PID tuning the CF on a string, do any of these setting need to change? like max angle and slew limit? (see picture attached.)

Thanks everyone!
Attachments
where is RPYType.PNG
change to 0.PNG
advanced mode settings.PNG
advanced mode settings.PNG (7.06 KiB) Viewed 605 times



cafeciaojoe
Beginner
Posts: 25
Joined: Mon Jun 18, 2018 2:37 am

Re: stabilizer mode variable in the firmware? and other basic PID Qs

Post by cafeciaojoe » Tue Jan 29, 2019 10:31 pm

bump, if that's ok.

tobias
Bitcraze
Posts: 1904
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: stabilizer mode variable in the firmware? and other basic PID Qs

Post by tobias » Wed Jan 30, 2019 3:04 pm

[1] Yes rate and attitude mode still exist however it is now put in a setpoint struct and this is done in crtp_commander_rpyt.c. Maybe you can tell us a bit more what you want to achieve, will be easier to help out then.

[2] If you set all PID gains to 0 you will get 0 as output which is probably not what you want. If you set P gain to 1 you will get the error as output which is not what you want either. I don't know if it's possible to do without bypassing the attitude PID.

[3] When tuning it you don't have to change anything else other then the PID gains.

cafeciaojoe
Beginner
Posts: 25
Joined: Mon Jun 18, 2018 2:37 am

Re: stabilizer mode variable in the firmware? and other basic PID Qs

Post by cafeciaojoe » Thu Jan 31, 2019 3:08 am

Hey Tobias thanks for the reply,

I am trying to fly the drone in the proposed configuration (see attached picture or first prototype). as I want the LED ring mounted on the top which is why I am trying to figure out how to flip the viewtopic.php?f=5&t=3311&p=16063#p16063.

I have flown the drone without the foam skirt with decent results but not terribly stable so I thought I should tune the PID.

The drone does not have to be agile or acrobatic, the smoother the flight and the slower it reacts the better. (I have sent you a video of the application via PM)

Would I need to comment one of these out to put the drone in rate mode? perhaps I am not understanding what these mean. I thought It disabled one of the PID loops (either rate or attitude loop)

typedef struct setpoint_s {
uint32_t timestamp;

Code: Select all

  attitude_t attitude;      // deg
  attitude_t attitudeRate;  // deg/s

Best
Joe
Attachments
IMG_9337.JPG
IMG_9336.JPG
IMG_9335.JPG
IMG_9334.JPG
IMG_9332.JPG

tobias
Bitcraze
Posts: 1904
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: stabilizer mode variable in the firmware? and other basic PID Qs

Post by tobias » Thu Jan 31, 2019 9:51 am

Ahhh, now I know what you want to achieve. Ratemode is basically meant for manual flight, then you want to control the speed of rotation rather then the attitude, which is common for FPV flight. It could also be useful if you want to implement the higher level of control on e.g. a PC.

How far have you come when it comes to flipping the CF2? How would you like to control the CF2?

cafeciaojoe
Beginner
Posts: 25
Joined: Mon Jun 18, 2018 2:37 am

Re: stabilizer mode variable in the firmware? and other basic PID Qs

Post by cafeciaojoe » Sun Feb 03, 2019 12:14 am

Ah ok.

I would like to control the CF through the Qualisys Tab.

I have successfully flipped the motors and flown the CF using the qualisys tab

I am yet to flip the deck and the motors (as mentioned. want to use the led ring facing up.) But thanks to your reply, I should be able to that in the next couple of days.

[1] now that I know what rate mode is typically for. it does not sound like i need to tune the drone in rate mode. as I will not be controlling it manually.

I can just

a ] string the drone up as per previous PID tuning posts

b ] tune as be these instructions viewtopic.php?f=6&t=192&p=1181&hilit=ad ... trol#p1181

c ] write the new values into the firmware.

Best
J

Post Reply