https://github.com/cybergear-robotics/cybergear
ESP-IDF library for Xiaomi CyberGear motors
https://github.com/cybergear-robotics/cybergear
cybergear esp-idf espidf-component xiaomi xiaomi-cybergear xiaomi-robot
Last synced: 4 months ago
JSON representation
ESP-IDF library for Xiaomi CyberGear motors
- Host: GitHub
- URL: https://github.com/cybergear-robotics/cybergear
- Owner: cybergear-robotics
- License: mit
- Created: 2025-01-12T13:01:10.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-14T15:10:32.000Z (over 1 year ago)
- Last Synced: 2025-06-26T07:03:16.004Z (12 months ago)
- Topics: cybergear, esp-idf, espidf-component, xiaomi, xiaomi-cybergear, xiaomi-robot
- Language: C
- Homepage:
- Size: 671 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Xiaomi CyberGear Driver
[](https://components.espressif.com/components/cybergear-robotics/cybergear)
[](https://github.com/cybergear-robotics/cybergear/actions/workflows/build_example.yml)
[](https://opensource.org/licenses/MIT)
[](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)
[](https://shields.io/)
[](https://shields.io/)
This driver uses Espressif's TWAI (Two-Wire Automotive Interface) in
order to communicate with Xiamoi CyberGear motors. It bases on the library
[Xiaomi_CyberGear_Arduino](https://github.com/DanielKalicki/Xiaomi_CyberGear_Arduino)
and is ported for ESP-IDF.
## Safety
This library does not use error logs/prints, but instead every internal error is
passed through. Therefore each relevant function returns `esp_err_t`, which should
be handled. During development `ESP_ERROR_CHECK(...)` helps, but due to the strength
of these motors, an error should be resolved or the motors should be stopped by an
external emergency mechanism.
Pay attention: The motor provides a list of faults. These are not tested yet and the code is beta.
Following lists the faults and whether a fault was already correctly tested:
* [ ] `overload`
* [ ] `uncalibrated`
* [ ] `over_current_phase_a`
* [ ] `over_current_phase_b`
* [ ] `over_current_phase_c`
* [ ] `over_voltage`
* [ ] `under_voltage`
* [ ] `driver_chip`
* [ ] `over_temperature`
* [ ] `magnetic_code_failure`
* [ ] `hall_coded_faults`
## Using component
```bash
idf.py add-dependency "cybergear-robotics/cybergear"
```
## Example
1. create example project
```bash
idf.py create-project-from-example "cybergear-robotics/cybergear:position_test"
```
2. Go to to example directory (for example `position_test`)
`cd position_test`
3. Set ESP chip
`idf.py set-target esp32`
4. Configure CAN TX/RX in menu `CyberGear Example`.
`idf.py menuconfig`
5. Build, flash
`idf.py build flash monitor`
## Related projects
* [Xiaomi_CyberGear_Arduino](https://github.com/DanielKalicki/Xiaomi_CyberGear_Arduino)
* [cybergear_m5](https://github.com/project-sternbergia/cybergear_m5)