{"id":16241292,"url":"https://github.com/dtex/servo-tuner","last_synced_at":"2025-10-13T23:22:35.364Z","repository":{"id":66259139,"uuid":"117486739","full_name":"dtex/servo-tuner","owner":"dtex","description":null,"archived":false,"fork":false,"pushed_at":"2018-01-15T02:33:25.000Z","size":294,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T09:52:12.521Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dtex.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-15T02:21:27.000Z","updated_at":"2018-01-15T14:37:25.000Z","dependencies_parsed_at":"2023-02-20T18:45:51.429Z","dependency_job_id":null,"html_url":"https://github.com/dtex/servo-tuner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dtex/servo-tuner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Fservo-tuner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Fservo-tuner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Fservo-tuner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Fservo-tuner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dtex","download_url":"https://codeload.github.com/dtex/servo-tuner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtex%2Fservo-tuner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017243,"owners_count":26086015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T14:06:58.932Z","updated_at":"2025-10-13T23:22:35.319Z","avatar_url":"https://github.com/dtex.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# servo-tuner\n\nCalibrating your servo and fine tuning the PWM range is critical for projects that use inverse kinematics or require exact positioning.\n\nThe ideal PWM range for a servo varies by manufacturer and the default PWM range varies by library and micro controller. \n\nThis tool will help you find which PWM range is best for your servo.\n\n## Installation\n\nYou will need [nodejs](https://nodejs.org). \n\nDownload and extract the zip file or clone this repo:\n````bash\ngit clone https://github.com/dtex/servo-tuner\n````\n\nInstall dependencies\n````bash\nnpm install\n````\n\nMake sure you are running a firmata variant on your Arduino:\n1. In the Arduino IDE under \"File\" select Examples\u003eFirmata\u003eStandardFirmata (any variation of Firmata should work)\n2. Make sure the right port is selected under \"Tools\"\n3. Make sure the right board is selected under \"Tools\"\n4. Click \"Upload\"\n\n## Usage\n\nWire up your arduino, power supply and servo.\n\n![Attached servo](/assets/servo_bb.png?raw=true \"Optional Title\")\n\nFor a standard 180° servo on pin 5 just run\n\n````\nnode index\n````\n\nIf you need to use a different pin on the Arduino you can pass that as a parameter:\n\n````bash\n// 180 degree servo on pin 9\nnode index 9\n````\n\nIf you have a non-180 degree servo you can pass the servo's range as a second parameter:\n\n````bash\n// 90° servo on pine 5\nnode index 5 90\n\n// 8 turn winch servo on pin 11\nnode index 11 2880\n````\n\n### Find the Lower Limit of the PWM Range\nThe servo will start at the midpoint. Move it to the minimum value by pressing ```opt + left```. \n\nPress ```shift + z``` to reduce the lower limit of the PWM range in increments of 10. Do this until the servo stops responding or the servo begins to behave in an unexpected manner (i.e. it moves further than it should, or starts slowly panning). Move it back the other way by pressing ```shift + c``` until it begins to behave as it should.\n\nNow do the same using just ```z``` and ```c``` to adjust the low end of the PWM range in increments of 1 to find the exact limit.\n\n### Find the Upper Limit of the PWM Range\nMove the servo to its maximum value by pressing ```opt + right```.\n\nRepeat the incremental trial and error process using ```shift + e```, ```shift + q```, ```e```, and ```q```.\n\n### Test It\nUse ```opt + left```, ```up```, and ```opt + right``` to test the range of the servo. This is ideally done with a servo protractor. If you are getting more than the expected range on your servo you can fine tune the PWM range. If on the other hand you are still getting less than the expected range you probably just have a crappy servo.\n\n### Using What You've Learned\n\nIn firmata.js:\n\n````js\nboard.on(\"ready\", function() {\n    // Don't use board.pinMode(5, board.MODES.SERVO);\n    board.servoConfig(5, \u003cPWM Lower Limit\u003e, \u003cPWM Upper Limit\u003e);\n});\n````\n\nIn Johnny-Five:\n````js\nnew five.Servo({\n    pin: 5,\n    pwmRange: [\u003cPWM Lower Limit\u003e, \u003cPWM Upper Limit\u003e]\n});\n````\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtex%2Fservo-tuner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdtex%2Fservo-tuner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtex%2Fservo-tuner/lists"}