Using Velocity Roam with Cruise Control
« on: November 29, 2016, 10:13:28 pm »
Hi,

It seems when i use Velocity Roam, and tilt forward or sidewards the quad doesnt hold its Altitude anymore, means its going down because motor power is not adjusted automatically .
Think this is normal because Position Hold and Altitude Hold ist only active  when sticks are centered. Or am i wrong?

But wouldnt it be nice when you fly in any direction in Velocity Roam that Cruise Control can be activated, so the quad is not loosing height so much?
Or did i get somwething wrong?

« Last Edit: November 29, 2016, 10:18:36 pm by DocHardinger »
Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO

Re: Using Velocity Roam with Cruise Control
« Reply #1 on: November 30, 2016, 05:12:52 am »
VelocityRoam is supposed to automatically use CruiseControl.  If you increase your max angle in VtolPathFollowerSettings for a test, you should be able to hear the motors rev up just from the banking.

Is your quad fairly heavy, doesn't have much lift?

How well does it do in Attitude mode with CruiseControl?  If you see the same problem there, you should tune your vertical PIDs.  I'm not sure if which PID is used for what has changed recently, but there are several places.

Re: Using Velocity Roam with Cruise Control
« Reply #2 on: November 30, 2016, 07:53:29 am »
In attitude mode it works well ...yes its quiet heavy but also got a lot power...anyway i think my problem is that my quad not hovers at 50% input but maybe at 60...if i get everything right i just have to adjust the motors output curves. If i then switch to VR with throttle at 50% and move sticks it should work better, right?

And i will also try to adjust PIDs. Thx again cliff! Another service star for you :-)
« Last Edit: November 30, 2016, 08:03:27 am by DocHardinger »
Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO

Re: Using Velocity Roam with Cruise Control
« Reply #3 on: November 30, 2016, 08:10:50 am »
There is also a "throttle range" (I forget what it is called) with max, min, and neutral settings.  On my heavy quad that hovers above half I have it set to something like 30, 60, 100.

Mateusz

  • *
  • 808
Re: Using Velocity Roam with Cruise Control
« Reply #4 on: November 30, 2016, 08:37:34 am »
And i will also try to adjust PIDs. Thx again cliff! Another service star for you :-)

Hi Doc,

I will just supplement what Cliff wrote.

There are two categories of PIDs related to different things.

So while I had my stabilization PIDs working well on defaults, very small difference after tunning and it was flying great with CruiseControl on throttle.
The altitude hold (different thing than position hold) was not working for me and copter was oscillating whenever I switched to Throttle mode with Altitude-Vario or Altitude-Hold. These values depend on the quad-copter build, after adjusting them my Altitude Hold started working as expected.


Altitude hold is not a flight mode like position hold (similar names/different thing). But Position Hold or Velocity Roam are flight modes working with INS13 which require all sensors (including GPS) consequently also working altitude hold. Altitude hold on another hand is applied on Throttle and can be combined with Complementary (do not require INS13).

Another important thing to get good altitude is
  • Baro must be protected. Porous foam that lets air in, but stops rapid wind blows. Revo in case, best if case is not transparent, as baro is light sensitive.
  • Temp calibration. The temp calibration will try to compensate for changes in baro and gyro measurements introduce by changes in temperature. To get good temp calibration you need to leave your board in electrostatic bag in freezer for ~20min. I leave the usb cable hanging of the bag and seal it with rubber band. Then I put board inside my laptop case, where its dark and it stays motionless. Took approx 52min to get it done. You can extract then those UAVobjects from exported XML file and keep in separate file. The idea of temp calibration is to record linear dependence between temp and gyro or baro measurements independent of pressure changes or movement but dependent on temperature changes. Heating up with something that blows air, introduces movement or lamp that shines on baro is obviously not a good idea.

Another thing is I usually change throttle curve a bit, to be flatter in the middle. This gives me more fine grained control in hover.

Re: Using Velocity Roam with Cruise Control
« Reply #5 on: November 30, 2016, 09:11:24 am »
Thx for your detailed instructions.
I already done calibration and case and foam...altitude hold alone is nearly perfect...and with VR sticks in the middle its nailed in the air, i can smoke a cigarette and afterwards its exactly at the same position.
Anyway i think i need to adjust throttle curve or adjust Vertical PID's in VTolPathFollowerSetting cause Altitude PID's working just fine. And adjust the ThrustLimits under VTolPathFollowerSetting. There are also some Settings under StabilizationSettings especially for CruiseControl.

So i got a lot of things to try out, day is rescued  ;D
Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO

Re: Using Velocity Roam with Cruise Control
« Reply #6 on: December 06, 2016, 05:05:14 pm »
So VR is working nearly perfect, but i got one strange issue here. When flying to the south copter is always coming down. All other directions are fine. No matter which orientation copter has. I read about the east-west oscilation but this seems different. Seems to have something to do with CruiseControl but not sure. See the video for details and sorry for my bad english pronouncement  :-[ and yes its the queen you hear when changing flightmode :-)


« Last Edit: December 06, 2016, 05:20:00 pm by DocHardinger »
Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO

Re: Using Velocity Roam with Cruise Control
« Reply #7 on: December 07, 2016, 01:14:34 am »
baro is very light sensitive. make sure it is covered so light doesn't get in.  when light level changes, the sensor values change.

also, prop blast and wind affects it.  partial solution is cover with open cell foam to smooth out the wind.  you can still have issues if simply flying forward increases pressure (like inside an air scoop) and maybe flying backward decreases pressure.  If there is wind, then flying into the wind will have large effect and flying downwind may have zero effect.

Re: Using Velocity Roam with Cruise Control
« Reply #8 on: December 07, 2016, 07:45:55 am »
Its covered with foam and in a dark case but not fully light protected...
Hmm but i also thought about this light sensitivity...but then i thought when sticks are not centered copter dont use altitude hold anymore but only cruisecontrol...but if i am wrong with this that would make sense because in the directipn where copter is going down, the sun shined directly onto the top of the revo. I will try to protect it more against the light.

So to make it short: what kind of algorithm does VR uses when sticks are  not centered

Thx for your help again
Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO

Mateusz

  • *
  • 808
Re: Using Velocity Roam with Cruise Control
« Reply #9 on: December 07, 2016, 09:11:47 am »
So to make it short: what kind of algorithm does VR uses when sticks are  not centered

Velocity roam requires GPS (https://librepilot.atlassian.net/wiki/display/LPDOC/GPS+Flight+modes).
Every flight-mode that involves GPS, uses INS13 (which is Extended Kalman Filter implementation for navigation) https://librepilot.atlassian.net/wiki/display/LPDOC/INS13+-+GPS+Navigation
There are two steps prediction step and correction step. In correction step amongst other measurements also barometer altitude and GPS altitude are used. INS13 uses all sensors for estimation. If curious you could probably record each sensor data in scopes and see what happens if you enter brighter area.

Hope that answers your question :)

Re: Using Velocity Roam with Cruise Control
« Reply #10 on: December 07, 2016, 09:43:38 am »
Yes sir!
Thx!
Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO

Re: Using Velocity Roam with Cruise Control
« Reply #11 on: December 07, 2016, 10:53:43 am »
PH and VR both use all sensors, including baro and mags.  Basically any GPS mode uses all sensors.

There are different PIDs for different modes though, so it may respond more quickly in one mode than another.

Re: Using Velocity Roam with Cruise Control
« Reply #12 on: December 13, 2016, 12:49:40 am »
Ok now I did another test with just Altitude Vario with Complementary Mode. Baro with foam and perfectly light protected.
Totally stable when hovering. But when flying in any direction it goes down and comes up again when in stable position(no stick input).
So i read a post from you @TheOtherCliff where you wrote that Altitude Vario uses Cruisce Control as a helper.
So am i right that Baro is also in use when flying tilted? Or just Cruise Control? Maybe i have to adjust some Cruise Control Settings under "Stabilization>Expert"?
Or are there any other settings when flying in any direction in Altitude Vario mode?

If its the wind or the prop blast when flying tilted then normally it should go up not down, cause pressure rises, right?

Edit:
An ive found a setting called "CruiseControlFlightModeSwitchPosEnable" under "StabilizationSettings" where all 6 positions are set to False? Is this correct?

Sorry for all this questions, but i really need to learn :-)
« Last Edit: December 13, 2016, 01:01:34 am by DocHardinger »
Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO

Mateusz

  • *
  • 808
Re: Using Velocity Roam with Cruise Control
« Reply #13 on: December 13, 2016, 08:44:31 am »
So am i right that Baro is also in use when flying tilted? Or just Cruise Control?

Yes, Baro is always in use when INS13 is selected for position estimation in our three dimensional space. If Cruise Control (CC) applies additionally in Velocity Roam (VR) like Cliff wrote, then it's only used to compensate for less thrust when banking, but it "knows" nothing about altitude. I imagine PID controller must be tuned between two extrema a) overshooting or b) under-compensating. If it's overshooting it will oscillate, and when it's under-compensating it will take at worst forever to reach desired position. I would try to play with altitude PIDs such that copter comes back to desired altitude fast, but it's not oscillating. I think PID control is pretty well explained here
Save your current PIDs somewhere and experiment, watch out for your fingers (don't hurt yourself)...

That would be my gut's feeling what might be wrong form what you describe.

P.S Complementary is not using baro for position estimation, so INS13 might be better in maintaining altitude as there baro is fused with other sensors.

Re: Using Velocity Roam with Cruise Control
« Reply #14 on: December 13, 2016, 09:28:14 am »
Thx! But i dont use INS13, only complementary with altitude vario. (Its another quad, i build for my dad without mag and gps. And thought would be easier to fly with altitude vario).

So question again what is used when flying tilted in altitude vario in complementary mode? Cruise Control only? Or is baro also read(altitude vario is acting)and so the PIDs are used too?

Hope you get what i mean...

Just to be sure and i know where to search and tune.

PIDs seems to work fine cause with no stick input it goes straight up and stops quiet exactly on the correct height after going down when flying tilted. And i use PID controllers often in my work, so i know how they work, but its really good explained in the video. Only thing i need to know is answer to the question above so i can find out whats wrong..

Thx again

Hardware: F450 Frame--Revolution Board--EMax 2213-935kv--BullTec 30A Opto--5000mAh 3S 30C LiPo--NEO M8N GPS+MAG--Fr Sky Taranis Plus + OPLink Mini
Addon: sj5000x + two axis gimbal + minimosd + eachine VT + easycap
Software: Black Rhino, LP2GO