{"action":"closed","number":603,"pull_request":{"url":"https://api.github.com/repos/diydrones/ardupilot/pulls/603","id":9050107,"html_url":"https://github.com/diydrones/ardupilot/pull/603","diff_url":"https://github.com/diydrones/ardupilot/pull/603.diff","patch_url":"https://github.com/diydrones/ardupilot/pull/603.patch","issue_url":"https://api.github.com/repos/diydrones/ardupilot/issues/603","number":603,"state":"closed","locked":false,"title":"AP_TECS : Functionality Enhancements","user":{"login":"priseborough","id":3596952,"avatar_url":"https://avatars.githubusercontent.com/u/3596952?v=3","gravatar_id":"","url":"https://api.github.com/users/priseborough","html_url":"https://github.com/priseborough","followers_url":"https://api.github.com/users/priseborough/followers","following_url":"https://api.github.com/users/priseborough/following{/other_user}","gists_url":"https://api.github.com/users/priseborough/gists{/gist_id}","starred_url":"https://api.github.com/users/priseborough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/priseborough/subscriptions","organizations_url":"https://api.github.com/users/priseborough/orgs","repos_url":"https://api.github.com/users/priseborough/repos","events_url":"https://api.github.com/users/priseborough/events{/privacy}","received_events_url":"https://api.github.com/users/priseborough/received_events","type":"User","site_admin":false},"body":"1) Support for automatic landings\r\n\r\nDuring flight_stage = FLIGHT_LAND_APPROACH  the speed weighting parameter is faded to zero at a rate of 0.2/second. This improves height accuracy as the ground approaches and also prevents reductions in airspeed due to gusts and wind gradient from causing the nose being pushed down by TECS to maintain airspeed. \r\n\r\nDuring flight_stage = FLIGHT_LAND_FINAL the speed weighting parameter is set to zero.\r\n\r\nDuring flight_stage = FLIGHT_LAND_APPROACH  or flight_stage = FLIGHT_LAND_FINAL an increment is added to the true airspeed demanded of 1/3 of the difference between the true airspeed and groundspeed. This allows for airspeed reductions due to gusts and descent through the wind gradient. A time constant of 5 seconds is applied to this offset to prevent gust transients casing significant changes in demanded airspeed.\r\n\r\nFurther Work Required\r\n\r\nThe speed weighting could also be faded based on time to landing waypoint or on height. The drawback with the method proposed here is that if the user sets the waypoint for the start of the landing approach a long way back, the vehicle could be flying in height priority for some time (throttle would still be able to control airspeed). I could schedule the fading of the speed weighting to use height above the landing waypoint - say fading linearly between 30 and 10 metres. The advantage with fading early as per the current approach is that it can accommodate the aircraft being too high at the start of approach which is possible if  TECS_SPDWEIGHT of 2.0 is being used as the default and the airframe is low drag. Fading from a weighting of 2.0 to 0.0 with the aircraft too high will result in a dive to regain the glide-slope. This would not be advisable at low altitude.\r\n\r\nUsers need to be educated about the implications of setting the first landing waypoint too soon or too late and the importance of setting an appropriate glide-slope angle. \r\n\r\n2) Addition of a mode to enable flight at the airspeed for best range\r\n\r\nThe sink rate polar for the airframe is calculated from the min sink and min sink airspeed and the max airspeed and sink rate at the max airspeed. \r\nThe ground track, wind vector, airspeed triangle is solved and the effective headwind calculated. \r\nThe tangent intercept between a straight line that passes through the horizontal axis at the headwind value and the sink polar is calculate to obtain the  speed that maximises glide range. The current algorithm can also compensate for rising/sinking air by moving the sink polar up or down, but this input has been disabled because the current vertical wind estimate suffers from bias errors and and a revised estimation algorithm will be required.\r\n\r\nThe calculation takes into account the ratio from EAS to TAS.\r\n\r\nFollowing preliminary tests with a Skywalker X-8 in gusty 10m/s wind conditions, a low-pass filter with a 5sec time constant has been applied to the demanded airspeed to reduce pitch/throttle disturbances in gusty conditions and the mode has been inhibited whilst circling a waypoint.\r\n\r\nFurther Work:\r\n\r\nMore flight testing required.","created_at":"2013-10-12T22:28:38Z","updated_at":"2015-01-23T04:32:30Z","closed_at":"2015-01-23T04:32:30Z","merged_at":null,"merge_commit_sha":"824b466ae3d709242e29a3da673ab63dcbe7f173","assignee":{"login":"priseborough","id":3596952,"avatar_url":"https://avatars.githubusercontent.com/u/3596952?v=3","gravatar_id":"","url":"https://api.github.com/users/priseborough","html_url":"https://github.com/priseborough","followers_url":"https://api.github.com/users/priseborough/followers","following_url":"https://api.github.com/users/priseborough/following{/other_user}","gists_url":"https://api.github.com/users/priseborough/gists{/gist_id}","starred_url":"https://api.github.com/users/priseborough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/priseborough/subscriptions","organizations_url":"https://api.github.com/users/priseborough/orgs","repos_url":"https://api.github.com/users/priseborough/repos","events_url":"https://api.github.com/users/priseborough/events{/privacy}","received_events_url":"https://api.github.com/users/priseborough/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/diydrones/ardupilot/pulls/603/commits","review_comments_url":"https://api.github.com/repos/diydrones/ardupilot/pulls/603/comments","review_comment_url":"https://api.github.com/repos/diydrones/ardupilot/pulls/comments/{number}","comments_url":"https://api.github.com/repos/diydrones/ardupilot/issues/603/comments","statuses_url":"https://api.github.com/repos/diydrones/ardupilot/statuses/462fd0007f1bc996863810682580407a9fa2078d","head":{"label":"priseborough:landspeed-wip","ref":"landspeed-wip","sha":"462fd0007f1bc996863810682580407a9fa2078d","user":{"login":"priseborough","id":3596952,"avatar_url":"https://avatars.githubusercontent.com/u/3596952?v=3","gravatar_id":"","url":"https://api.github.com/users/priseborough","html_url":"https://github.com/priseborough","followers_url":"https://api.github.com/users/priseborough/followers","following_url":"https://api.github.com/users/priseborough/following{/other_user}","gists_url":"https://api.github.com/users/priseborough/gists{/gist_id}","starred_url":"https://api.github.com/users/priseborough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/priseborough/subscriptions","organizations_url":"https://api.github.com/users/priseborough/orgs","repos_url":"https://api.github.com/users/priseborough/repos","events_url":"https://api.github.com/users/priseborough/events{/privacy}","received_events_url":"https://api.github.com/users/priseborough/received_events","type":"User","site_admin":false},"repo":{"id":8208289,"name":"ardupilot","full_name":"priseborough/ardupilot","owner":{"login":"priseborough","id":3596952,"avatar_url":"https://avatars.githubusercontent.com/u/3596952?v=3","gravatar_id":"","url":"https://api.github.com/users/priseborough","html_url":"https://github.com/priseborough","followers_url":"https://api.github.com/users/priseborough/followers","following_url":"https://api.github.com/users/priseborough/following{/other_user}","gists_url":"https://api.github.com/users/priseborough/gists{/gist_id}","starred_url":"https://api.github.com/users/priseborough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/priseborough/subscriptions","organizations_url":"https://api.github.com/users/priseborough/orgs","repos_url":"https://api.github.com/users/priseborough/repos","events_url":"https://api.github.com/users/priseborough/events{/privacy}","received_events_url":"https://api.github.com/users/priseborough/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/priseborough/ardupilot","description":"","fork":true,"url":"https://api.github.com/repos/priseborough/ardupilot","forks_url":"https://api.github.com/repos/priseborough/ardupilot/forks","keys_url":"https://api.github.com/repos/priseborough/ardupilot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/priseborough/ardupilot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/priseborough/ardupilot/teams","hooks_url":"https://api.github.com/repos/priseborough/ardupilot/hooks","issue_events_url":"https://api.github.com/repos/priseborough/ardupilot/issues/events{/number}","events_url":"https://api.github.com/repos/priseborough/ardupilot/events","assignees_url":"https://api.github.com/repos/priseborough/ardupilot/assignees{/user}","branches_url":"https://api.github.com/repos/priseborough/ardupilot/branches{/branch}","tags_url":"https://api.github.com/repos/priseborough/ardupilot/tags","blobs_url":"https://api.github.com/repos/priseborough/ardupilot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/priseborough/ardupilot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/priseborough/ardupilot/git/refs{/sha}","trees_url":"https://api.github.com/repos/priseborough/ardupilot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/priseborough/ardupilot/statuses/{sha}","languages_url":"https://api.github.com/repos/priseborough/ardupilot/languages","stargazers_url":"https://api.github.com/repos/priseborough/ardupilot/stargazers","contributors_url":"https://api.github.com/repos/priseborough/ardupilot/contributors","subscribers_url":"https://api.github.com/repos/priseborough/ardupilot/subscribers","subscription_url":"https://api.github.com/repos/priseborough/ardupilot/subscription","commits_url":"https://api.github.com/repos/priseborough/ardupilot/commits{/sha}","git_commits_url":"https://api.github.com/repos/priseborough/ardupilot/git/commits{/sha}","comments_url":"https://api.github.com/repos/priseborough/ardupilot/comments{/number}","issue_comment_url":"https://api.github.com/repos/priseborough/ardupilot/issues/comments/{number}","contents_url":"https://api.github.com/repos/priseborough/ardupilot/contents/{+path}","compare_url":"https://api.github.com/repos/priseborough/ardupilot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/priseborough/ardupilot/merges","archive_url":"https://api.github.com/repos/priseborough/ardupilot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/priseborough/ardupilot/downloads","issues_url":"https://api.github.com/repos/priseborough/ardupilot/issues{/number}","pulls_url":"https://api.github.com/repos/priseborough/ardupilot/pulls{/number}","milestones_url":"https://api.github.com/repos/priseborough/ardupilot/milestones{/number}","notifications_url":"https://api.github.com/repos/priseborough/ardupilot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/priseborough/ardupilot/labels{/name}","releases_url":"https://api.github.com/repos/priseborough/ardupilot/releases{/id}","created_at":"2013-02-14T21:43:40Z","updated_at":"2015-01-14T15:18:36Z","pushed_at":"2015-01-22T21:33:37Z","git_url":"git://github.com/priseborough/ardupilot.git","ssh_url":"git@github.com:priseborough/ardupilot.git","clone_url":"https://github.com/priseborough/ardupilot.git","svn_url":"https://github.com/priseborough/ardupilot","homepage":null,"size":72004,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"diydrones:master","ref":"master","sha":"d7d6ae97ded0a0170406d9e5729b30193b334442","user":{"login":"diydrones","id":3189387,"avatar_url":"https://avatars.githubusercontent.com/u/3189387?v=3","gravatar_id":"","url":"https://api.github.com/users/diydrones","html_url":"https://github.com/diydrones","followers_url":"https://api.github.com/users/diydrones/followers","following_url":"https://api.github.com/users/diydrones/following{/other_user}","gists_url":"https://api.github.com/users/diydrones/gists{/gist_id}","starred_url":"https://api.github.com/users/diydrones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diydrones/subscriptions","organizations_url":"https://api.github.com/users/diydrones/orgs","repos_url":"https://api.github.com/users/diydrones/repos","events_url":"https://api.github.com/users/diydrones/events{/privacy}","received_events_url":"https://api.github.com/users/diydrones/received_events","type":"Organization","site_admin":false},"repo":{"id":7512484,"name":"ardupilot","full_name":"diydrones/ardupilot","owner":{"login":"diydrones","id":3189387,"avatar_url":"https://avatars.githubusercontent.com/u/3189387?v=3","gravatar_id":"","url":"https://api.github.com/users/diydrones","html_url":"https://github.com/diydrones","followers_url":"https://api.github.com/users/diydrones/followers","following_url":"https://api.github.com/users/diydrones/following{/other_user}","gists_url":"https://api.github.com/users/diydrones/gists{/gist_id}","starred_url":"https://api.github.com/users/diydrones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diydrones/subscriptions","organizations_url":"https://api.github.com/users/diydrones/orgs","repos_url":"https://api.github.com/users/diydrones/repos","events_url":"https://api.github.com/users/diydrones/events{/privacy}","received_events_url":"https://api.github.com/users/diydrones/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diydrones/ardupilot","description":"APM Plane, APM Copter, APM Rover source","fork":false,"url":"https://api.github.com/repos/diydrones/ardupilot","forks_url":"https://api.github.com/repos/diydrones/ardupilot/forks","keys_url":"https://api.github.com/repos/diydrones/ardupilot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diydrones/ardupilot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diydrones/ardupilot/teams","hooks_url":"https://api.github.com/repos/diydrones/ardupilot/hooks","issue_events_url":"https://api.github.com/repos/diydrones/ardupilot/issues/events{/number}","events_url":"https://api.github.com/repos/diydrones/ardupilot/events","assignees_url":"https://api.github.com/repos/diydrones/ardupilot/assignees{/user}","branches_url":"https://api.github.com/repos/diydrones/ardupilot/branches{/branch}","tags_url":"https://api.github.com/repos/diydrones/ardupilot/tags","blobs_url":"https://api.github.com/repos/diydrones/ardupilot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diydrones/ardupilot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diydrones/ardupilot/git/refs{/sha}","trees_url":"https://api.github.com/repos/diydrones/ardupilot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diydrones/ardupilot/statuses/{sha}","languages_url":"https://api.github.com/repos/diydrones/ardupilot/languages","stargazers_url":"https://api.github.com/repos/diydrones/ardupilot/stargazers","contributors_url":"https://api.github.com/repos/diydrones/ardupilot/contributors","subscribers_url":"https://api.github.com/repos/diydrones/ardupilot/subscribers","subscription_url":"https://api.github.com/repos/diydrones/ardupilot/subscription","commits_url":"https://api.github.com/repos/diydrones/ardupilot/commits{/sha}","git_commits_url":"https://api.github.com/repos/diydrones/ardupilot/git/commits{/sha}","comments_url":"https://api.github.com/repos/diydrones/ardupilot/comments{/number}","issue_comment_url":"https://api.github.com/repos/diydrones/ardupilot/issues/comments/{number}","contents_url":"https://api.github.com/repos/diydrones/ardupilot/contents/{+path}","compare_url":"https://api.github.com/repos/diydrones/ardupilot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diydrones/ardupilot/merges","archive_url":"https://api.github.com/repos/diydrones/ardupilot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diydrones/ardupilot/downloads","issues_url":"https://api.github.com/repos/diydrones/ardupilot/issues{/number}","pulls_url":"https://api.github.com/repos/diydrones/ardupilot/pulls{/number}","milestones_url":"https://api.github.com/repos/diydrones/ardupilot/milestones{/number}","notifications_url":"https://api.github.com/repos/diydrones/ardupilot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diydrones/ardupilot/labels{/name}","releases_url":"https://api.github.com/repos/diydrones/ardupilot/releases{/id}","created_at":"2013-01-09T00:58:52Z","updated_at":"2015-01-23T02:49:21Z","pushed_at":"2015-01-23T02:49:20Z","git_url":"git://github.com/diydrones/ardupilot.git","ssh_url":"git@github.com:diydrones/ardupilot.git","clone_url":"https://github.com/diydrones/ardupilot.git","svn_url":"https://github.com/diydrones/ardupilot","homepage":"http://ardupilot.com/","size":97206,"stargazers_count":894,"watchers_count":894,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1434,"mirror_url":null,"open_issues_count":484,"forks":1434,"open_issues":484,"watchers":894,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/diydrones/ardupilot/pulls/603"},"html":{"href":"https://github.com/diydrones/ardupilot/pull/603"},"issue":{"href":"https://api.github.com/repos/diydrones/ardupilot/issues/603"},"comments":{"href":"https://api.github.com/repos/diydrones/ardupilot/issues/603/comments"},"review_comments":{"href":"https://api.github.com/repos/diydrones/ardupilot/pulls/603/comments"},"review_comment":{"href":"https://api.github.com/repos/diydrones/ardupilot/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/diydrones/ardupilot/pulls/603/commits"},"statuses":{"href":"https://api.github.com/repos/diydrones/ardupilot/statuses/462fd0007f1bc996863810682580407a9fa2078d"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":4,"review_comments":0,"commits":19,"additions":180,"deletions":25,"changed_files":8}}