I have a simple question

Kayle
Code: Select all
#define GYRO_SMOOTHING {20, 20, 3}
crashlander wrote:For mpu6050 I'm usingCode: Select all
#define GYRO_SMOOTHING {20, 20, 3}
with no LPF and it works perfectly (with default PID's).
Regards
Andrej
Kayle wrote:The main problem was that when i switch to "angle" mode my flying wing shakes so much that i don´t can fly with it. So the most time i use "passthrough" mode. I have a lot vibrations and use LPF Filter on 98hz and gyro smoothing. I think i must tune my pid ( at the moment the pid are default ). Or should i use a lower LPF Filter ?
Kayle
Kayle wrote:Hi Roman,
thanks for reply. My Plane is a HK Teksumo Flying Wing with "big" control throws. During gliding the "shaking" is not so much like with motor is on. So i think i have to much vibrations. First i fix the vibration and then i will lower my P Pid value.
Kayle
PatrikE wrote:I use a function to slowdown Flaps.
It could be possible to use similar function for Nav if Nav error is bigger than ex.100.
And if the error is less use full speed.
It could look like this.Code: Select all
// Test to slowdown servos NOTE!.. Untested
#define SERVOSPEED 3 // zero to disable Increase for faster speed reverse with minus
#define SLOW_ANGLE 100 // Ajust where slow servos activates >> if (dif > SLOW_ANGLE) <<
static int16_t slowNav = dif;
if (slowNav < dif ){slowNav+=SERVOSPEED;}else if(slowNav > dif){slowNav-=SERVOSPEED;}
if(abs(dif) > SLOW_ANGLE && SERVOSPEED != 0) dif = (constrain(slowNav,-GPS_MAXCORR*10, GPS_MAXCORR*10));
// Test to slowdown servos *******************
// Limit outputs
.....
The code compiles but is untested in the plane.
The servospeed is dependant on the cykleTime. It adds 3µs to slowNav every loop.
Be careful if testing.
Patrik
dr.tom wrote:I will try to install it int o 330+ km/h rc plane![]()
Code: Select all
if (GPS_distanceToHome <=20) dif=0; //new fly straight over home
// Wrap Heading 180
Code: Select all
#define RTH_BAILOUT false // Forced RTH Climbout with Level Wings
but while the plane was falling I tried to stick control the plane at least to slowdown the fall but it looked that no stick input had any effect.
means that navigation will be performed at CLIMBTHROTTLE 1800 and not CRUICETHROTTLE 1500
crashlander wrote:Ugly crash!but while the plane was falling I tried to stick control the plane at least to slowdown the fall but it looked that no stick input had any effect.
It is quite possible that during descend the plane was in very stable stall turn and thus the lack of stick control.
means that navigation will be performed at CLIMBTHROTTLE 1800 and not CRUICETHROTTLE 1500
I prefer this way of handling RTH since level wings normally takes my wing too far away and also at he end of climb the wing gets into uneasy "TH low > wing level > wing turn" maneuver that means immediate drop of height (my wing has quite big speed tolerances so it is hard to overspeed it especially in climb). Maybe you should lower CLIMBTHROTTLE.
Also from your video it does not seem that your plane is pitching up (climbing) when RTH is enabled, or is just camera wide angle?!
What about that strange beeping at the end?
My plane have quite weak engine (thrust about 60% of plane weight)
very low safe height (expecting it will overshoot anyway)
Code: Select all
#define CLIMBTHROTTLE
#define CRUICETHROTTLE
#define IDLE_THROTTLE
#define SCALER_THROTTLE
#define ELEVATORCOMPENSATION
Mine seemed to keep level wings, but did allow me to set it in a climb angle (and leave the sticks).
Code: Select all
GPS_AltErr = GPS_altitude - GPS_hold[ALT]; // Altitude error - means your'e to low
Code: Select all
GPS_AltErr = GPS_altitude - GPS_home[ALT]; // Altitude error - means your'e to low
Code: Select all
GPS_AltErr = GPS_altitude - GPS_home[ALT] - RTH_MINALTITUDE; // Altitude error - means your'e to low
Code: Select all
#define RTH_MINALTITUDE 50
Code: Select all
GPS_hold[ALT] = conf.pid[PIDALT].D8 + GPS_home[ALT];
It's works the same way for MUlticopters to.danielzt wrote:I checked that RTH only works when enabled with ANGLE or HORIZON... Why?
Not in the present code.danielzt wrote:Is there anyone working on waypoints? I would like to do it
rbirdie001 wrote:Kayle wrote:Hi Roman,
thanks for reply. My Plane is a HK Teksumo Flying Wing with "big" control throws. During gliding the "shaking" is not so much like with motor is on. So i think i have to much vibrations. First i fix the vibration and then i will lower my P Pid value.
Kayle
Probably you are right and vibrations from the motor are always bad and should be avoided as much a possible.
Higher speed gives more effect to control throws so to be sure, do an easy test:
Try gliding at minimal speed and then push a little elevator and let plane gain higher speed by descending. It the shaking get worse, you probably have too high P.
Be sure you don't have ACC active, only GYRO.
ACC is the next step when GYRO mode is OK.
Roman
Kayle wrote: But when i switch to ACC / Level Mode my FlyingWing does a "roll of death"It turns over right side and put the nose down.
crashlander wrote:Kayle wrote: But when i switch to ACC / Level Mode my FlyingWing does a "roll of death"It turns over right side and put the nose down.
Did you calibrate ACC with wing level (in GUI or with stick combination)?!
What happens when you enable Level/Horizon mode when wing is level in your hands/on the ground (normally you should not observe any real throw of control surfaces).
Even completely wrong P in level should not produce strong roll or pitch correction out of level when the above conditions are met.
Regards
Andrej
Kayle wrote:ACC is calibrated. On ground the control throws goes in correct direction. So i think i have to much vibrations when Motor is in
Kayle
crashlander wrote:@ Exyator
You asked incomplete question and got three correct but maybe insufficient answers...
So to summarize:
If your plane always tries to level with nose up (climbing) than you should set/reset level with slightly nose down.
If your plane levels perfectly on aileron axis but keeps pitch position in whatever angel for long time than it can be wrong PID on pitch axis. Planes tend to be more stable (harder to disturb) on pitch than on roll.
And perfectly level trimmed plane should keep its course (altitude and direction) in angle/level mode for long time and if you disturb-it it should return to level in short.
Regards
Andrej
Code: Select all
static int16_t My_average;
static uint8_t AvgLength = 5; // Adjust length
My_average=((My_average*(AvgLength-1))+ GPS_angle[PITCH])/AvgLength;
GPS_angle[PITCH] = My_average;
rbirdie001 wrote:Kayle wrote:ACC is calibrated. On ground the control throws goes in correct direction. So i think i have to much vibrations when Motor is in
Kayle
Hi Kayle,
not everything is caused by vibrations...![]()
If the gyro mode is OK, easy test for ACC:
Calibrate ACC with plane levelled in all axis. Then if it's in the same position as during calibration, switching between GYRO and ACC mode shouldn't move control surfaces.
When in ACC mode and you take it in hands and move e.g. nose up, elevator should move down and opposite. When you tilt the plane e.g. to the left, ailerons should move contra this movement. These throws should be permanent (i.e. elevator keeps deflected down as long as nose is held up, throw doesn't reset in time but only by levelling the plane back - this is different from GYRO reactions.)
Another trick is that you can guess ACC PID from GYRO PID. For the first attempt correct level PID in the same rate against defaults as you corrected pitch and roll GYRO PIDs.
Last test: When your plane is levelled on the table and GYRO/ACC switchover doesn't do anything, hold the plane firmly and start the engine. Starting engine shouldn't have (almost) any effect to control surfaces, otherwise you have too much vibrations.
OK?
Roman
Code: Select all
// Wrap Heading 180
if (dif <= - 180) dif += 360;
if (dif >= + 180) dif -= 360;
static int16_t Elevator_avg; //elevator filtering
static uint8_t AvgLength = 8; // Adjust length
Elevator_avg=((Elevator_avg*(AvgLength-1))+ GPS_angle[PITCH])/AvgLength;
GPS_angle[PITCH] = Elevator_avg;
// Limit outputs
GPS_angle[PITCH] = constrain(GPS_angle[PITCH],-GPS_MAXCLIMB*10,GPS_MAXCLIMB*10);
Kayle wrote:Hi Roman,
i recalibrated acc with plane levelled in all axis. When i switch between GYRO and ACC there is a very verry little movement on the Servo. The control throws goes in the correct directions when i tilt the plane. When i switch to ACC and then power up Motor there is also a very little movement on the control throws. So i decide to decrease the level pid from 9 to 5 for test. At the Weekend i will test the plane with acc.
Kaylerbirdie001 wrote:Kayle wrote:ACC is calibrated. On ground the control throws goes in correct direction. So i think i have to much vibrations when Motor is in
Kayle
Hi Kayle,
not everything is caused by vibrations...![]()
If the gyro mode is OK, easy test for ACC:
Calibrate ACC with plane levelled in all axis. Then if it's in the same position as during calibration, switching between GYRO and ACC mode shouldn't move control surfaces.
When in ACC mode and you take it in hands and move e.g. nose up, elevator should move down and opposite. When you tilt the plane e.g. to the left, ailerons should move contra this movement. These throws should be permanent (i.e. elevator keeps deflected down as long as nose is held up, throw doesn't reset in time but only by levelling the plane back - this is different from GYRO reactions.)
Another trick is that you can guess ACC PID from GYRO PID. For the first attempt correct level PID in the same rate against defaults as you corrected pitch and roll GYRO PIDs.
Last test: When your plane is levelled on the table and GYRO/ACC switchover doesn't do anything, hold the plane firmly and start the engine. Starting engine shouldn't have (almost) any effect to control surfaces, otherwise you have too much vibrations.
OK?
Roman