{"action":"created","comment":{"url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/comments/49271523","id":49271523,"diff_hunk":"@@ -0,0 +1,175 @@\n+Tacho Driver Update Proposal\n+============================\n+\n+The tacho drivers work in most cases, but they have the following defects\n+loggead against them:\n+\n+- [ ] [ev3dev/ev3dev#488](https://github.com/ev3dev/ev3dev/issues/488)\n+- [ ] [ev3dev/ev3dev#467](https://github.com/ev3dev/ev3dev/issues/467)\n+- [ ] [ev3dev/ev3dev#455](https://github.com/ev3dev/ev3dev/issues/455)\n+- [ ] [ev3dev/ev3dev#454](https://github.com/ev3dev/ev3dev/issues/454)\n+- [ ] [ev3dev/ev3dev#453](https://github.com/ev3dev/ev3dev/issues/453)\n+- [ ] [ev3dev/ev3dev#356](https://github.com/ev3dev/ev3dev/issues/356)\n+- [ ] [ev3dev/ev3dev#224](https://github.com/ev3dev/ev3dev/issues/224)\n+- [ ] [ev3dev/ev3dev#149](https://github.com/ev3dev/ev3dev/issues/149)\n+- [ ] [ev3dev/ev3dev#148](https://github.com/ev3dev/ev3dev/issues/148)\n+- [ ] [ev3dev/ev3dev#54](https://github.com/ev3dev/ev3dev/issues/54)\n+\n+Other tasks that need to be dealt with for this proposal:\n+\n+- [ ] Add LibreOffice Template for graphs - I'd like to make sure that we have\n+a consistent format for the diagrams so that when they need changes we're not\n+recreating them from scratch.\n+- [ ] Update `spec.json` so so that it's got a brief description of the attributes\n+but has a link to the [official driver docs on the website](http://www.ev3dev.org/docs/drivers/tacho-motor-class/). This document is auto-generated from the driver source so\n+that's where any updates as a result of this proposal should go.\n+\n+The `tacho-motor` drivers must strike a balance between doing the most common\n+functions that a robot builder needs but not becoming so complex that the\n+operation is unreliable or mysterious.\n+\n+## The sys Interface\n+\n+All motor operations are contolled by writing data to attributes within the\n+`/sys/class/tacho-motor/motorN/` folder. There is one folder per motor.\n+\n+The read and write operations may return the following return codes:\n+\n+| RETURN CODE    | DESCRIPTION\n+| ------------   | -----------\n+| 0              | Operation sucessful\n+| -13 EACCES     | Permission denied\n+| -16 EBUSY      | Device or resource busy\n+| -22 EINVAL     | Invalid argument\n+| -95 EOPNOTSUPP | Operation not supported on transport endpoint\n+\n+Note that some hardware supported by the [ev3dev.org] distribution uses\n+I2C or UART communication channels for motor control, and may return \n+additional error codes.\n+\n+The attributes operate as described in the\n+[`tacho-motor` class document](http://www.ev3dev.org/docs/drivers/tacho-motor-class/).\n+In most cases, changing attributes after writing to the `command` attribute\n+will not take effect until the next write to `command`.\n+\n+## Changes to the current operation\n+\n+### `run-direct-duty-cycle` and `run-direct-speed`\n+\n+The `command` attribute will be updated to replace `run-direct` with\n+two new commands that are intended for applications that need more\n+advanced control over the motors. This includes \"steering\" mode control\n+where you want motors to operate at a ratio to each other.\n+\n+The new commands ignore the value of any attribute except for the one\n+that they are named after. \n+\n+| `command` value         | Controlling attribute\n+| ------------------      | ---------------------\n+| `run-direct-duty-cycle` | `duty_cycle_sp`\n+| `run-direct-speed`      | `speed_sp`\n+\n+If a motor does not support a particular commands, then the write\n+will return `EOPNOTSUPP`.\n+\n+When these commands are used, there is no support for ramping - it is\n+up to the application program to handle any requirements for motion\n+control algorithms.\n+\n+Note that if the motor supports `run-direct-speed` the attributes for\n+the PID control do affect speed regulation, but they do not take\n+effect until the next write to `command`.\n+\n+The value of the controlling attribute can be changed at any time and will\n+take effect immediately.\n+\n+When the value of the controlling attribute is set to 0, then the motor\n+is stopped according to the value in the `stop_command` attribute.\n+\n+When `stop` is written to the `command` attribute, then the motor\n+is stopped according to the value in the `stop_command` attribute.\n+\n+A write to any other attribute will not take effect until the next\n+write to `command`.\n+\n+### Ramping Updates\n+\n+The automatic linear ramping only works when one of the following\n+values is written to the `command` attribute:\n+\n+- `run-forever`\n+- `run-timed`\n+- `run-to-abs-pos`\n+- `run-to-rel-pos`\n+- `stop`\n+","path":"TACHO_DRIVER.md","position":105,"original_position":105,"commit_id":"f19e99a9d7d11e71036996f109ce12dabe324c5d","original_commit_id":"f19e99a9d7d11e71036996f109ce12dabe324c5d","user":{"login":"rhempel","id":5571620,"avatar_url":"https://avatars.githubusercontent.com/u/5571620?v=3","gravatar_id":"","url":"https://api.github.com/users/rhempel","html_url":"https://github.com/rhempel","followers_url":"https://api.github.com/users/rhempel/followers","following_url":"https://api.github.com/users/rhempel/following{/other_user}","gists_url":"https://api.github.com/users/rhempel/gists{/gist_id}","starred_url":"https://api.github.com/users/rhempel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhempel/subscriptions","organizations_url":"https://api.github.com/users/rhempel/orgs","repos_url":"https://api.github.com/users/rhempel/repos","events_url":"https://api.github.com/users/rhempel/events{/privacy}","received_events_url":"https://api.github.com/users/rhempel/received_events","type":"User","site_admin":false},"body":"My original implementation of the motor driver had this feature - it slowed down before hitting the position setpoint to avoid overshoot and abrupt stops. There was some math involved and the performance was very load dependent when speed regulation was off.\r\n\r\nIf the underlying motor driver does not support timed ramping - then return EOPNOTSUPP when writing those attributes.\r\n\r\nWe have very good control of the EV3 hardware, so I think we should support ramping - for motors that use their own fixed ramping or PID we don't support it. We don't want the kernel driver to keep having to write I2C messages for example.\r\n\r\nAs far as supporting similar PID performance, that will be difficult. The scaling value `k` can certainly be eliminated, but I would not expect the same PID parameters to have the same effect for different motor drive hardware.\r\n\r\nAgain, let's keep our eyes on the common goal of great support for EV3 hardware, the other shields may require tweaking of scripts by users. And realistically, what percentage of users will expect to run the same script on two different platforms without a bit of tweaking?\r\n\r\nIt's better to document differences than to write to the lowest common denominator.","created_at":"2016-01-10T04:35:08Z","updated_at":"2016-01-10T04:35:08Z","html_url":"https://github.com/ev3dev/lego-linux-drivers/pull/23#discussion_r49271523","pull_request_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/comments/49271523"},"html":{"href":"https://github.com/ev3dev/lego-linux-drivers/pull/23#discussion_r49271523"},"pull_request":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/23","id":55545169,"html_url":"https://github.com/ev3dev/lego-linux-drivers/pull/23","diff_url":"https://github.com/ev3dev/lego-linux-drivers/pull/23.diff","patch_url":"https://github.com/ev3dev/lego-linux-drivers/pull/23.patch","issue_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/23","number":23,"state":"open","locked":false,"title":"Tacho driver update","user":{"login":"rhempel","id":5571620,"avatar_url":"https://avatars.githubusercontent.com/u/5571620?v=3","gravatar_id":"","url":"https://api.github.com/users/rhempel","html_url":"https://github.com/rhempel","followers_url":"https://api.github.com/users/rhempel/followers","following_url":"https://api.github.com/users/rhempel/following{/other_user}","gists_url":"https://api.github.com/users/rhempel/gists{/gist_id}","starred_url":"https://api.github.com/users/rhempel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhempel/subscriptions","organizations_url":"https://api.github.com/users/rhempel/orgs","repos_url":"https://api.github.com/users/rhempel/repos","events_url":"https://api.github.com/users/rhempel/events{/privacy}","received_events_url":"https://api.github.com/users/rhempel/received_events","type":"User","site_admin":false},"body":"This PR is so we can comment on the proposal in TACHO_DRIVER.md\r\n\r\nThat file will me merged into other docs eventually, but for now it's where I'd like to discuss the proposed changes.\r\n\r\nWe'll also use this PR for managing the actual changes to the driver, OK?","created_at":"2016-01-09T16:08:34Z","updated_at":"2016-01-10T04:35:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2795678302bd77fecef4242d7c3602d73fc3dce6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/23/commits","review_comments_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/23/comments","review_comment_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/23/comments","statuses_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/statuses/f19e99a9d7d11e71036996f109ce12dabe324c5d","head":{"label":"rhempel:tacho-driver-update","ref":"tacho-driver-update","sha":"f19e99a9d7d11e71036996f109ce12dabe324c5d","user":{"login":"rhempel","id":5571620,"avatar_url":"https://avatars.githubusercontent.com/u/5571620?v=3","gravatar_id":"","url":"https://api.github.com/users/rhempel","html_url":"https://github.com/rhempel","followers_url":"https://api.github.com/users/rhempel/followers","following_url":"https://api.github.com/users/rhempel/following{/other_user}","gists_url":"https://api.github.com/users/rhempel/gists{/gist_id}","starred_url":"https://api.github.com/users/rhempel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhempel/subscriptions","organizations_url":"https://api.github.com/users/rhempel/orgs","repos_url":"https://api.github.com/users/rhempel/repos","events_url":"https://api.github.com/users/rhempel/events{/privacy}","received_events_url":"https://api.github.com/users/rhempel/received_events","type":"User","site_admin":false},"repo":{"id":49237571,"name":"lego-linux-drivers","full_name":"rhempel/lego-linux-drivers","owner":{"login":"rhempel","id":5571620,"avatar_url":"https://avatars.githubusercontent.com/u/5571620?v=3","gravatar_id":"","url":"https://api.github.com/users/rhempel","html_url":"https://github.com/rhempel","followers_url":"https://api.github.com/users/rhempel/followers","following_url":"https://api.github.com/users/rhempel/following{/other_user}","gists_url":"https://api.github.com/users/rhempel/gists{/gist_id}","starred_url":"https://api.github.com/users/rhempel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhempel/subscriptions","organizations_url":"https://api.github.com/users/rhempel/orgs","repos_url":"https://api.github.com/users/rhempel/repos","events_url":"https://api.github.com/users/rhempel/events{/privacy}","received_events_url":"https://api.github.com/users/rhempel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rhempel/lego-linux-drivers","description":"LEGO MINDSTORMS and LEGO WeDo drivers for Linux from the ev3dev project","fork":true,"url":"https://api.github.com/repos/rhempel/lego-linux-drivers","forks_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/forks","keys_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/teams","hooks_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/hooks","issue_events_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/issues/events{/number}","events_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/events","assignees_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/assignees{/user}","branches_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/branches{/branch}","tags_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/tags","blobs_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/statuses/{sha}","languages_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/languages","stargazers_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/stargazers","contributors_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/contributors","subscribers_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/subscribers","subscription_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/subscription","commits_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/contents/{+path}","compare_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/merges","archive_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/downloads","issues_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/issues{/number}","pulls_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/pulls{/number}","milestones_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/milestones{/number}","notifications_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/labels{/name}","releases_url":"https://api.github.com/repos/rhempel/lego-linux-drivers/releases{/id}","created_at":"2016-01-07T23:40:16Z","updated_at":"2016-01-07T23:40:17Z","pushed_at":"2016-01-09T22:23:25Z","git_url":"git://github.com/rhempel/lego-linux-drivers.git","ssh_url":"git@github.com:rhempel/lego-linux-drivers.git","clone_url":"https://github.com/rhempel/lego-linux-drivers.git","svn_url":"https://github.com/rhempel/lego-linux-drivers","homepage":"http://www.ev3dev.org","size":1162,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ev3dev:master","ref":"master","sha":"60e10e00b0c11a004fcfc638b7f9617b8c0b6523","user":{"login":"ev3dev","id":6878323,"avatar_url":"https://avatars.githubusercontent.com/u/6878323?v=3","gravatar_id":"","url":"https://api.github.com/users/ev3dev","html_url":"https://github.com/ev3dev","followers_url":"https://api.github.com/users/ev3dev/followers","following_url":"https://api.github.com/users/ev3dev/following{/other_user}","gists_url":"https://api.github.com/users/ev3dev/gists{/gist_id}","starred_url":"https://api.github.com/users/ev3dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ev3dev/subscriptions","organizations_url":"https://api.github.com/users/ev3dev/orgs","repos_url":"https://api.github.com/users/ev3dev/repos","events_url":"https://api.github.com/users/ev3dev/events{/privacy}","received_events_url":"https://api.github.com/users/ev3dev/received_events","type":"Organization","site_admin":false},"repo":{"id":28286217,"name":"lego-linux-drivers","full_name":"ev3dev/lego-linux-drivers","owner":{"login":"ev3dev","id":6878323,"avatar_url":"https://avatars.githubusercontent.com/u/6878323?v=3","gravatar_id":"","url":"https://api.github.com/users/ev3dev","html_url":"https://github.com/ev3dev","followers_url":"https://api.github.com/users/ev3dev/followers","following_url":"https://api.github.com/users/ev3dev/following{/other_user}","gists_url":"https://api.github.com/users/ev3dev/gists{/gist_id}","starred_url":"https://api.github.com/users/ev3dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ev3dev/subscriptions","organizations_url":"https://api.github.com/users/ev3dev/orgs","repos_url":"https://api.github.com/users/ev3dev/repos","events_url":"https://api.github.com/users/ev3dev/events{/privacy}","received_events_url":"https://api.github.com/users/ev3dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ev3dev/lego-linux-drivers","description":"LEGO MINDSTORMS and LEGO WeDo drivers for Linux from the ev3dev project","fork":false,"url":"https://api.github.com/repos/ev3dev/lego-linux-drivers","forks_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/forks","keys_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/teams","hooks_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/hooks","issue_events_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/events{/number}","events_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/events","assignees_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/assignees{/user}","branches_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/branches{/branch}","tags_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/tags","blobs_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/git/refs{/sha}","trees_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/statuses/{sha}","languages_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/languages","stargazers_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/stargazers","contributors_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/contributors","subscribers_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/subscribers","subscription_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/subscription","commits_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/commits{/sha}","git_commits_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/git/commits{/sha}","comments_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/comments{/number}","issue_comment_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/comments{/number}","contents_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/contents/{+path}","compare_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/merges","archive_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/downloads","issues_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues{/number}","pulls_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls{/number}","milestones_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/milestones{/number}","notifications_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/labels{/name}","releases_url":"https://api.github.com/repos/ev3dev/lego-linux-drivers/releases{/id}","created_at":"2014-12-21T02:41:32Z","updated_at":"2015-12-18T23:49:20Z","pushed_at":"2016-01-09T22:23:26Z","git_url":"git://github.com/ev3dev/lego-linux-drivers.git","ssh_url":"git@github.com:ev3dev/lego-linux-drivers.git","clone_url":"https://github.com/ev3dev/lego-linux-drivers.git","svn_url":"https://github.com/ev3dev/lego-linux-drivers","homepage":"http://www.ev3dev.org","size":1161,"stargazers_count":13,"watchers_count":13,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":1,"forks":21,"open_issues":1,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/23"},"html":{"href":"https://github.com/ev3dev/lego-linux-drivers/pull/23"},"issue":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/23"},"comments":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/ev3dev/lego-linux-drivers/statuses/f19e99a9d7d11e71036996f109ce12dabe324c5d"}}}}