Fast settings for computer controlled quad
Fast settings for computer controlled quad
Hi!
Im trying to modify the PID's of my small 3d printed quad, that is being controlled by a computer...
So, my setup is as follows:
- Small 3d printed frame
- MW AIO board, 2.3, no changes to firmware
- 3DR modems for communication with GS, with Sik-Mw 2.3 firmware, 115k serial speed
- Using MW serial protocol to send commands wirelessly from matlab/simulink
- Markers on the quad to detect position/attitude with motion capture system
- position, height and trajectory control on GS, sending roll/pitch/throttle commands
So, I want to make automatic trajectories, for starters the classic circle and 8 figure...
And its actually doing them (i can post a video), the problem is that the quad responds a little slow actually, so, the circle is more like a very deform bizarre circle, so, i want to make it better. but i have found out, is that the mw is actually pitching or rolling at a very very slow rate, so, I want to make it faster, even if its very difficult for a human to control, what could be the best pid settings for that???
Im sending the control commands at 50hz.
The attached picture is for example a figure of 8 of one of the lasts tests.
Cheers!!
Im trying to modify the PID's of my small 3d printed quad, that is being controlled by a computer...
So, my setup is as follows:
- Small 3d printed frame
- MW AIO board, 2.3, no changes to firmware
- 3DR modems for communication with GS, with Sik-Mw 2.3 firmware, 115k serial speed
- Using MW serial protocol to send commands wirelessly from matlab/simulink
- Markers on the quad to detect position/attitude with motion capture system
- position, height and trajectory control on GS, sending roll/pitch/throttle commands
So, I want to make automatic trajectories, for starters the classic circle and 8 figure...
And its actually doing them (i can post a video), the problem is that the quad responds a little slow actually, so, the circle is more like a very deform bizarre circle, so, i want to make it better. but i have found out, is that the mw is actually pitching or rolling at a very very slow rate, so, I want to make it faster, even if its very difficult for a human to control, what could be the best pid settings for that???
Im sending the control commands at 50hz.
The attached picture is for example a figure of 8 of one of the lasts tests.
Cheers!!
Re: Fast settings for computer controlled quad
PIDs are very specific to many variables on the Quad such as: Props, motors, geometry, size, weight and weight distribution.
You can try tuning the quad's PIDs on a string to get a better idea of their effect (, also study the control loop and what effect the PID values have on the control. Then its going to be doing flight tests for fine tuning.
Are you sure it isn't the RF link and/or the Matlab code that is causing the response slowness?
The flight trajectory plot looks interesting. Do you have more info on this project somewhere?
You can try tuning the quad's PIDs on a string to get a better idea of their effect (, also study the control loop and what effect the PID values have on the control. Then its going to be doing flight tests for fine tuning.
Are you sure it isn't the RF link and/or the Matlab code that is causing the response slowness?
The flight trajectory plot looks interesting. Do you have more info on this project somewhere?
Re: Fast settings for computer controlled quad
mmm, maybe no the pid's, I just want the board to be quicker, to "fly" quicker, more responsive... so, i was playing with the mid, expo for throttle and rate, expo for roll/pitch...
is there another way to make it faster???
anyhow this are my specs:
- 5x3 props
- turnigy sk3 2110 kv
you can see more details here:
http://aldux.net/rd/tego-v3
i know from fact that simulink is always slow and a little not precise when it comes to timing... but I have the main loop and a rate limiter at 50hz...
And before starting with automatic control, I hook a joystick to the computer and did flights from the computer, and did noticed a slow response, it was pretty normal, so, i really dont think it is the modems or matlab... would it be another way to know from fact???
And my matlab code is only asking the MW board to update the rc serial, so, Im not getting attitudes or the rest of the things from the MW, just updating the RCSERIAL.
I still havent do any official publications about the project, because is still in progress, but when i solved all the issues, Ill write something and will share with anyone interested, but, I need to make it perfect hehehe
check at this circle trajectory...
The green plot is the trajectory that it needs to track, and the blue data is the actual flight position recorded with the motion tracking system...
is there another way to make it faster???
anyhow this are my specs:
- 5x3 props
- turnigy sk3 2110 kv
you can see more details here:
http://aldux.net/rd/tego-v3
i know from fact that simulink is always slow and a little not precise when it comes to timing... but I have the main loop and a rate limiter at 50hz...
And before starting with automatic control, I hook a joystick to the computer and did flights from the computer, and did noticed a slow response, it was pretty normal, so, i really dont think it is the modems or matlab... would it be another way to know from fact???
And my matlab code is only asking the MW board to update the rc serial, so, Im not getting attitudes or the rest of the things from the MW, just updating the RCSERIAL.
I still havent do any official publications about the project, because is still in progress, but when i solved all the issues, Ill write something and will share with anyone interested, but, I need to make it perfect hehehe
check at this circle trajectory...
The green plot is the trajectory that it needs to track, and the blue data is the actual flight position recorded with the motion tracking system...
Re: Fast settings for computer controlled quad
You may have an issue deciding when you are finished with a waypoint. I say this 'cause 3 of your points have roughly the same error and the opposite three also have roughly the same error in the same direction but smaller. Like there was a wind blowing the machine to one side and it wasn't sure when it had "passed" a waypoint.
Or I could be complely wrong..
-jim lee
Or I could be complely wrong..
-jim lee
Re: Fast settings for computer controlled quad
I was also thinking there could have been some wind that the program (matlab/simlink) does not know about. Wind can cause difficulties even flying LOS.
Maybe a 'weather station' with wind direction and speed data input to matlab could help. Or at least logging the wind data for analysis of the flight data
The slowness may be just the communication link latencies since you also experienced it with a joy stick on the computer.
I would measure the communication times and any latency between the MW FC sending data to when the MW FC receives the data.
Maybe a 'weather station' with wind direction and speed data input to matlab could help. Or at least logging the wind data for analysis of the flight data
The slowness may be just the communication link latencies since you also experienced it with a joy stick on the computer.
I would measure the communication times and any latency between the MW FC sending data to when the MW FC receives the data.
Re: Fast settings for computer controlled quad
No extra wind that I'm aware off... Im in a indoors lab, maybe some small turbulence created by the air flow hitting the walls?? maybe that...
and also ground effect was a issue at the beginning, we could even hear a very clear difference between certain heights and ground effect...
Ill try those settings Treym, and for throttle is the same?? so, .9 & .3 on both???
and also ground effect was a issue at the beginning, we could even hear a very clear difference between certain heights and ground effect...
Ill try those settings Treym, and for throttle is the same?? so, .9 & .3 on both???
Re: Fast settings for computer controlled quad
it may not be advisable to adjust the throttle expo/rate , A human pilot with a linear throttle curve will find it hard to hover ..
your are almost always at hovering speed and using a computer. Maybe he is quick enough to react, but you quad might not be heavy enough to drop out of the celling quick enough to avoid collision .
i would suggest you to use throttle_angle_correction : meant for altitude holde (z), the side effect of throttle_angle_correction is faster x/y changes.
with baseflight , it can be use without altitude hold.
this ways you will have extra throttle, up to +150, for yours movments along the x/y axis.
your are almost always at hovering speed and using a computer. Maybe he is quick enough to react, but you quad might not be heavy enough to drop out of the celling quick enough to avoid collision .
i would suggest you to use throttle_angle_correction : meant for altitude holde (z), the side effect of throttle_angle_correction is faster x/y changes.
with baseflight , it can be use without altitude hold.
this ways you will have extra throttle, up to +150, for yours movments along the x/y axis.
Re: Fast settings for computer controlled quad
ok, and dummy question... how do I activate throttle_angle_correction?? hehe
Re: Fast settings for computer controlled quad
multiwii 8 bit :
in config.h
baseflight/cleanflight 32bit :
wih the command line interface (cli) :
in config.h
Code: Select all
/************************ Angele throttle correction ********************/
/* Automatically increase throttle based on the angle of the copter
Original idea by Kraut Rob, first implementation HAdrian */
//#define THROTTLE_ANGLE_CORRECTION 40
baseflight/cleanflight 32bit :
wih the command line interface (cli) :
throttle_correction_value, throttle_correction_angle : the throttle_correction_value will be added to the throttle input. It will be maximal at the throttle_correction_angle and over, null when the copter is leveled and proportional in bewteen. The angle is set with 0.1 deg steps from 1 to 900, ie : 300 = 30.0 deg, 225 = 22.5 deg.
Re: Fast settings for computer controlled quad
Sorry for taking to much replying on this post...
I havent tried Treym's solution yet...
Im using now MW dev 2014 with the modified pid's algorithms and I'm getting better results, I'll post when I had something interesting to post
Meanwhile I'm going to try to use openlog to do some system identification on my small 3d printed quadrotor in order to be able to implement a nice controller in simulink...
Cheers!!
I havent tried Treym's solution yet...
Im using now MW dev 2014 with the modified pid's algorithms and I'm getting better results, I'll post when I had something interesting to post
Meanwhile I'm going to try to use openlog to do some system identification on my small 3d printed quadrotor in order to be able to implement a nice controller in simulink...
Cheers!!
Re: Fast settings for computer controlled quad
thanks for the update , keep us informed , it is interresting to see peolple building stuff like your project.