{"id":16238277,"url":"https://github.com/bdring/sgsetup_esp32","last_synced_at":"2026-03-04T02:32:05.522Z","repository":{"id":136847579,"uuid":"188704513","full_name":"bdring/SgSetup_ESP32","owner":"bdring","description":"TMC2130 StallGuard2 Setup on ESP32","archived":false,"fork":false,"pushed_at":"2019-06-05T19:09:28.000Z","size":17,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T04:33:24.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bdring.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-05-26T16:06:55.000Z","updated_at":"2025-03-16T07:48:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"5cefcf7e-c1b0-4d22-a200-5cf4887c3423","html_url":"https://github.com/bdring/SgSetup_ESP32","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bdring/SgSetup_ESP32","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdring%2FSgSetup_ESP32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdring%2FSgSetup_ESP32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdring%2FSgSetup_ESP32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdring%2FSgSetup_ESP32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdring","download_url":"https://codeload.github.com/bdring/SgSetup_ESP32/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdring%2FSgSetup_ESP32/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30070085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T01:03:42.280Z","status":"online","status_checked_at":"2026-03-04T02:00:07.464Z","response_time":59,"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-10T13:39:39.910Z","updated_at":"2026-03-04T02:32:05.477Z","avatar_url":"https://github.com/bdring.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Trinamic TMC2130 StallGaurd2 Setup on ESP32\n\nThis is a simple little program to setup sensorless stall detection with a Trinamic TMC2130 driver on a stepper motor. This program runs on a ESP32 in the Arduino IDE\n\nYou send the following characters with a serial terminal to tune the settings until you can sense a stall.\n\n```TMC2130 StallGuard2 test program\nTMC2130 StallGuard2 test program\n\n'+' = faster\n'-' = slower\n'1' = run\n'0' = pause\n'r' = reverse\n'i' = inc sg\n'd' = dec sg\nSend '1' character to begin\n```\n\nThe output will look like the following...\n\n```RPM:10 SGT:24 SGV:0428 TSTEP: 01407 SG: 0 I:0410 \nRPM:10 SGT:24 SGV:0428 TSTEP: 01406 SG: 0 I:0410 \nRPM:10 SGT:24 SGV:0434 TSTEP: 01406 SG: 0 I:0410 \nRPM:10 SGT:24 SGV:0434 TSTEP: 01407 SG: 0 I:0410 \nRPM:10 SGT:24 SGV:0094 TSTEP: 01406 SG: 0 I:0410 \nRPM:10 SGT:24 SGV:0094 TSTEP: 01407 SG: 0 I:0410 \nRPM:10 SGT:24 SGV:0094 TSTEP: 01406 SG: 0 I:0410 \nRPM:10 SGT:24 SGV:0000 TSTEP: 01407 SG: 1 I:0410 \nRPM:10 SGT:24 SGV:0000 TSTEP: 01409 SG: 1 I:0410 \nRPM:10 SGT:24 SGV:0000 TSTEP: 01407 SG: 1 I:0410\n```\n\n ### Output\n\n * Typical: RPM:10 SGT:24 SGV:0442 TSTEP: 01407 SG:0 I:397\n * RPM = Current Spped of the motors\n * SGT = Current StallGuard Threashold\n * SGV = Current reported StallGaurd value\n * TSTEP = Time in microseconds between steps. Use this to determine TCOOLTHRS value\n * SG = Stall detected (1 or 0)\n * I = Motor current in mA \n\n### Tips\n\n* StallGuard only works in coolstep mode. It will not work in the quiet Stealthchop modes\n* It only works reliably in a narrow speed band. You will want to find this speed and \nuse it for your homing. Start with about 10 RPM\n* Play with RPM (+ \u0026 - keys) and StallGuard Threadhold (i \u0026 d keys) until you see high SGV  \nwhile running and a SG=1 when stalling (or nearly stalling)\n* Note the the TSTEP value and plug a slightly lower value in TCOOLTHRS. This will prevent SG=1 at at slower values.\n\n### Libraries Used\n\n* [TMC2130Stepper](https://github.com/teemuatlut/TMC2130Stepper) Control library for TMC2130 Drivers\n* [printf](https://github.com/mpaland/printf) Adds printf, sprintf, etc to make well formated output easy.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdring%2Fsgsetup_esp32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdring%2Fsgsetup_esp32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdring%2Fsgsetup_esp32/lists"}