{"id":20164849,"url":"https://github.com/px4/sapog","last_synced_at":"2025-07-27T09:35:39.268Z","repository":{"id":43496001,"uuid":"13923725","full_name":"PX4/sapog","owner":"PX4","description":"Sapog - advanced multiplatform ESC firmware","archived":false,"fork":false,"pushed_at":"2020-01-15T06:40:16.000Z","size":15576,"stargazers_count":209,"open_issues_count":3,"forks_count":142,"subscribers_count":71,"default_branch":"master","last_synced_at":"2025-03-31T17:18:14.210Z","etag":null,"topics":["bldc","bldc-motor-controller","can","can-bus","canbus","dronecode","drones","esc","px4","robotics","uav","uavcan","zubax"],"latest_commit_sha":null,"homepage":"https://kb.zubax.com/x/cYAh","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PX4.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}},"created_at":"2013-10-28T11:17:01.000Z","updated_at":"2025-03-25T08:54:19.000Z","dependencies_parsed_at":"2022-08-02T22:15:24.306Z","dependency_job_id":null,"html_url":"https://github.com/PX4/sapog","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PX4%2Fsapog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PX4%2Fsapog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PX4%2Fsapog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PX4%2Fsapog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PX4","download_url":"https://codeload.github.com/PX4/sapog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713258,"owners_count":20983683,"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","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":["bldc","bldc-motor-controller","can","can-bus","canbus","dronecode","drones","esc","px4","robotics","uav","uavcan","zubax"],"created_at":"2024-11-14T00:35:52.129Z","updated_at":"2025-04-07T19:16:17.642Z","avatar_url":"https://github.com/PX4.png","language":"C","readme":"PX4 Sapog\n=========\n\n[![Forum](https://img.shields.io/discourse/https/discuss.px4.io/users.svg)](https://discuss.px4.io/)\n[![Forum](https://img.shields.io/discourse/https/forum.uavcan.org/users.svg)](https://forum.uavcan.org)\n\n## Documentation\n\n**[Sapog v2 Reference Manual](https://files.zubax.com/products/io.px4.sapog/Sapog_v2_Reference_Manual.pdf)**\nis the main piece of project documentation; make sure to read it.\nAdditional documentation and related resources can be found at the\n**[Zubax Knowledge Base](https://kb.zubax.com/x/cYAh)**.\n\n## Change Log\n\n### v2.3\n\n* Configuration parameter `mot_i_shunt_mr` has been removed; now the firmware detects the shunt resistance\nbased on the HW ID pin states.\n* Migrated from GCC 4.9 to GCC 7.2.\n\n### v2.2\n\n* Added a low-pass filter on the estimated angular speed output.\nThis change led to improved performance on motors with severe phase asummetry.\n* Improved RGB LED indication in the bootloader.\n\n### v2.1\n\n* Fixed stability issues at extremely high RPM (\u003e10k mechanical RPM for 14 pole motor).\n* Default PWM frequency set to 60 kHz.\n\n### v2.0\n\n* Completely new, more robust spin up algorithm. Supports smooth start-up from standstill as well as picking up\nthe rotation if the rotor is already spinning.\n* Significantly more reliable operation during rapid acceleration and deceleration,\nespecially at high advance angles.\n* Wider PWM frequency range: 20...75 kHz.\n* Raised the maximum RPM limit; the new maximum for 14 pole motor exceeds 14000 mechanical RPM.\n\n## Firmware\n\nIf you're not running Linux or OSX natively, you can use\n[**Bistromathic** - a Linux virtual machine pre-configured for embedded development](https://kb.zubax.com/x/KIEh).\n\n### Bootloader\n\nThe bootloader allows to update the firmware via the standard UAVCAN firmware upgrade protocol,\nwhich is documented at [uavcan.org](http://uavcan.org/Specification/6._Application_level_functions/#firmware-update).\nNo additional steps are needed to build the bootloader - the build system will build it automatically together with\nthe firmware. The resulting `*.elf` file will be extended with the bootloader too, so it can be flashed directly into an\nfactory fresh MCU.\n\n### Build Instructions\n\n**Prebuilt binaries are available at \u003chttps://files.zubax.com/products/io.px4.sapog/\u003e.**\n\nPrerequisites:\n\n* GCC ARM 7.2\n* Python 3.2+\n* Linux or OSX host computer (Windows is not supported)\n\n```bash\ngit submodule update --init --recursive\ncd firmware\nmake RELEASE=1 # RELEASE is optional; omit to build the debug version\n```\n\nThe build outputs will be stored into `build/`:\n\n* `*.application.bin` - built application binary, suitable for uploading via the bootloader;\n* `*.compound.bin` - application binary together with the bootloader, in one image;\n* `compound.elf` - application ELF together with the bootloader, in one file; this option is recommended for debugging.\n\nExecute `./blackmagic_flash.sh [portname]` from the `tools` directory to flash the firmware with a Black Magic Debug Probe.\n\n### Development\n\nWe recommend Eclipse for IDE, but any other IDE will work equally well.\nIf you prefer Eclipse and need GUI debugging, avoid upgrading to any version newer than Luna,\nsince in newer releases GUI GDB debugging of embedded targets is broken.\nOtherwise we recommend to use the latest Eclipse together with CLI GDB client.\nIt's inconvenient, but unlike Eclipse it works reliably.\n\nWhen editing code, please follow the\n[PX4 coding conventions](https://github.com/PX4/Firmware/blob/master/CONTRIBUTING.md).\n\n### Hardware Timer Usage\n\n* TIM1 - 3-phase FET bridge PWM\n* TIM2 - ADC synchronization, works in lockstep with TIM1\n* TIM3 - RGB LED PWM\n* TIM4 - Hard real time callout interface for motor control logic (preempts the kernel)\n* TIM5 - RC PWM input capture\n* TIM6 - High precision timestamping for motor control logic (sub-microsecond resolution, never overflows)\n* TIM7 - General purpose timestamping\n\n## Hardware\n\nReference hardware design is published under CC BY-SA 3.0 in the [PX4 Hardware repository](https://github.com/PX4/Hardware).\n\nKnown commercially available compatible hardware designs are listed below.\n\n- [Zubax Orel 20](https://zubax.com/products/orel_20)\n- [Holybro Kotleta20](https://shop.holybro.com/kotleta20_p1156.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpx4%2Fsapog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpx4%2Fsapog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpx4%2Fsapog/lists"}