Xiaomi Cyber dog geared motor ~$60

Wow, that’s really. a deep dive into unknown :slight_smile: I would be glad to add those to my list. You can add an issue with links or give me some time to browse and categorise this myself. Thanks for sharing!

Best regards,
Victor Belov

1 Like

This was motivated by me being too lazy to write a library to control the CyberGear with SocketCAN. In my searching I found libraries for ESP32 (both for the M5 stack, and utilizing the TWAI protocol, which will probably be more generally useful), Arduino and STM32. Ironically just as I gave up and started writing a SocketCAN library I think I just found one (in Chinese, of course). I’ll be testing it shortly but at this point I’m also already writing my own. Once I get all this crap organized I’ll be sending some links your way!

1 Like

I created a python library that controls the motor using python-can and tested successfully on a Jetson Nano using the on-board CAN header via SocketCAN. Python-can supports a bunch of interfaces including PCAN, USB2CAN, SocketCAN and serial, so connectivity options are flexible.

I’m curious how everyone is planning to control these motors. Should I continue building out a python library? Write something in c/cpp? Are most people going to be using an Arduino/ESP32/STM32 instead?

2 Likes

I’m still working on a simplefoc replacement firmware for the cybergear. Will be controlling a couple of cybergears from esp32 or a jetson nano. I can control the motor over can from my linux laptop (using python-can). I’m currently banging my head on getting ADC/DMA working properly for the low side current sense. But as I’m learning loads I don’t mind if it takes me a few weeks/months. Closed loop already works (with on board as5047p).

My CAN interface will be different from xioami firmware, it would be super difficult to make it identical and I think it is a bit ugly/confusing anyway.

I’m pretty novice in this area, but I know is never to late to learn. Could you please share some info on how you used the Jetson to control the motors? I still waiting for my can controller to arrive from Aliexpress to use with arduino.
Thank you

I’m still working on my code for use with a Jetson. If you’re going to be using an Arduino I would check out this library: GitHub - DanielKalicki/Xiaomi_CyberGear_Arduino: Arduino TWAI library for Xiaomi CyberGear

In case this is useful to others. I read out all the registers in the 6EDL7141 driver after loading the stock xiaomi firmware without power-cycling in between.

0090 0000000010010000 FAULT_ST
0040 0000000001000000
0814 0000100000010100
0090 0000000010010000
0000 0000000000000000
0001 0000000000000001
0000 0000000000000000
0006 0000000000000110 DEVICE_ID
0000 0000000000000000 FAULTS_CLR
7008 0111000000001000 SUPPLY_CFG
0000 0000000000000000
0001 0000000000000001
0001 0000000000000001
0000 0000000000000000
0000 0000000000000000
FFFF 1111111111111111
00FD 0000000011111101
3206 0011001000000110
142E 0001010000101110
0101 0000000100000001
0000 0000000000000000
0064 0000000001100100
0800 0000100000000000
0000 0000000000000000 OTP_PROG

Looks like they’ve configured the DT_RISE and DT_FALL to low values (200ns) and the CS_GAIN to 20V/V. One thing I’m confused about is that the FUNC_ST register shows that DVDD is configured to 5V. Am i reading that right? I tested it on two of these motors, and I see the same thing. Does that mean there is some other circuitry to convert the 5V output of the driver IC to 3.3V?

2 Likes

They’ve also set VREF to 1/3 DVDD. When I read the currents with the ADC on the GD32, they are centered at around 2048 which is approx 1.65 V which is what you’d expect 1/3 DVDD to be if DVDD were in fact 5V and not 3.3V. So it looks like the driver is indeed configured to output 5V.

1 Like

@Rajesh_Poddar - this is useful for me. I still haven’t managed to get current sense working and it may have something to do with how the 6EDL7141 configured or me setting up adc/dma. At the moment I’m reading noise from the adc of one of the current sense pins, slightly higher than 2048.


I haven’t got the readings aligned with the PWM peaks yet so it might be that too.

I’ve set the vref to 1/3 dvdd and set dead time to 200ns and csgain to 20v/v. I’ve also enabled the two cs amps associated with phase b and c.

2 Likes

It looks like the resolution of the current measurements as per Xiaomi’s debug tools is 0.040283 A which, if I’m doing the math right, translates to a current sense resistance of 1 milli-ohm.

1 Like

Hi everyone not sure if this is the right place to post but I am quite lost. I’m very new to all this and I have been trying to connect my Cybergear motor to Arduino for a project.

My current setup includes:
Cybergear Actuator (Powered by (Li-Poly) Tattu 22.2 V 1550mAh battery) → I2C CAN-BUS Module based on MCP2551 and MCP2515 → SparkFun Thing Plus - ESP32.

I have been trying out the code from the github pages but they return errors or are beyond my comprehension.
I appreciate any help!
Thanks,
Bryan

Hi @i3ryanz , welcome to SimpleFOC!

Unfortunately I don’t think anyone will be able to help you based on this question, other than to commiserate in general terms…

If you’d like advice you’ll have to tell us a little more specifically aboit the issues you’re facing…

1 Like

I’m assuming your physical setup looks like this?

Can you let us know what GitHub project you’re using? Also any information on the errors you’re getting would be helpful.

Apologies for the delayed response!

I am trying to use Daniel Kalicki’s TWAI library to connect to my actuators. Where i will then implement IMU and EMG data to estimate human gait and locomotion, with the actuators providing the plantarflexion and dorsiflexion in the ankle and knee.

Following the data sheet RX and TX are connected to pins 16 and 17, and i haven’t touched the actuator can-id. ESP32-S2 Thing Plus Hookup Guide - SparkFun Learn

Running the code and opening the serial moniter leads to this message:

Failed to queue message for transmission
Alert: TWAI controller has become error passive.
Alert: A (Bit, Stuff, CRC, Form, ACK) error has occurred on the bus.
Bus error count: 15
Alert: The Transmission failed.
TX buffered: 0 TX error: 128 TX failed: 6
POS:0.000000 V:0.000000 T:0.000000 temp:0
Failed to queue message for transmission
This is followed with the last two lines of the message repeating indefinetly.

My thoughts were maybe my microcontroller or can-bus unit were incompatible in some way, but as a novice at all this, i really have no clue.

I am sorry, but this is probably the wrong forum for your question since the software you are requesting help for is not related to SimpleFOC. I do have some limited experience with CAN bus on the ESP32 though and from the debug output you posted, I would conclude that there is a hardware problem. The sender is unable to access the bus and transmit its data. This may happen if the wiring is wrong or another device blocks the bus. Anyway, very difficult to say without detailed knowledge, so don’t take my statement for granted!

1 Like

Ciao a tutti, sto iniziando ad utilizzare i Xiaomi Cybergear, chi mi può spiegare la modalità MIT, dovrebbe coincidere con la modalità 0 come da manuale???

was anyone able to determine what the can id and can frame structure of the encoder calibration command through the gui, as its undocumented? looking to run the calibration through code. maybe @hansihe? saw you accidentally ran it?

HI All,
I am new to the topic, i bought the cyber gear motor and also two usb to can connectors , but not able to connect to the motor with the software that is downloaded from xiaomi site.
i have - usb2canfd v1 from we act
and also

Hi, this motor may also be of interest to you. It comes with an ODrive , powerful torque, and only costs $60.

GIM6010-8微型行星减速马达机器人外骨骼机械狗关节驱动控制电机-淘宝网 (taobao.com)

1 Like

Here is a thread started for the Steadywin GIM6010 motor: Steadywin New Cheap Gear Motor

There has also been some discussion on the ODrive Discord and I did a comparison of the CyberGear and Steadywin specs: Discord