Xiaomi Cyber dog geared motor ~$60

Hello, I will check theremino, but one question is of general interest I think:
Does it support various kinematics, like 4- or 5 axis (palletized) robot arms or is it a solution for one motor?

Hi,
actually we have an unconventional approach that aims at low cost and low level of expertise for fairly simple automations.
Referring to the control of the movement of multiple motors, in theory we have no limits, better to say, we have the limit related to the number of motors and the speed and complexity of the protocol.
So far we have used compatible Dynamixel (https://www.dynamixel.com/) smart motors, produced in China to make prototypes of small robotic arms.
We use the -try, fail and learn- methodology for -pick and place- applications exactly as kids learn to mall claw machine.
Where no type of knowledge is needed to manage a Cartesian robot.
To get a real idea of ​​what we are talking about go here:

www.youtube.com/@TWinGo_arm

We want to make a leap in quality by using CyberGear.
If you think this explanation is not enough, just ask and I will be happy to provide you with more details on the Theremino system.

Ciao

Leonardo

Hello friends,
the CyberGear is arrived, I prepare the mechanical support and now begin to play.

Someone know if all the documentation is stiil in Chinese or there are an official version in English?

Leo

Good luck! An English translation was posed earlier in the thread here. The rest of his GitHub repository has some useful links and information as well.

Dear friends,

I have write some software using Theremino Automationd and I have published on YouTube the tests:

Any comment, suggestion, criticism or questions are welcome.

Leo

1 Like

Hi,

I carried out repeatability measurements and as you can see in the video, they are not exactly optimal.
I measured it in a somewhat empirical way, which on the 200 mm long arm is just under 1.5 mm.
https://youtu.be/1IwWmNGTGVg
I believe that the cause is to be found in the backlash that exists between the reduction gears.

Leo

Nice work! What library are you using to handle the communication with the motor?

Please excuse my delayed response; I’m currently moving and planning an international trip.

Our team at the THEREMINO SYSTEM takes a different approach to automation, specifically targeting users who aren’t professional programmers but want to solve practical problems. We’ve found that using Arduino and standard C++ cannot be challenging for many persons.

Consider this scenario:

Imagine someone wants to:
Turn on a fan when the temperature reaches a certain threshold.
Turn off the fan when the temperature drops below that threshold.
Log these events, including date, time, and temperature, to a text file on their PC.
Implementing this with Arduino and standard libraries can be quite complex or ā€œmission impossibleā€ for non professional programmers.

Our Solution: THEREMINO AUTOMATION
We’ve developed an interpreted language called THEREMINO AUTOMATION under Visual Studio and OPEN SOURCE.

It simplifies interaction with sensors and actuators using a PIC microcontroller (Microchip) as a Master.

Also we rewrite how to communicate in ultrafast way over USB in HID mode to the Master.
This allows users with basic programming knowledge (like understanding ā€œif-then-elseā€ or ā€œfor-nextā€) to create automation projects easily.

We prioritize accessibility for users familiar with tools like Microsoft Office and basic programming concepts.
Instead of relying on complex libraries, we focus on direct serial communication.
This approach leverages the PC’s processing power.

Example: Controlling a Motor
Here is the way where we control the CyberGear motor:

Label Angle90
TTS Speak ā€œgo to 90 degreesā€ 'use text to speak to inform the user about the actiom done
FrameAngle(90)
Return

Label FrameAngle
Numeric Angle
Numeric Destination = Rad(Angle)
String DestHex
Slot(slot_DestAngle) = Angle
DestHex = ConvertToIEEE754(Destination, True, False)
s1 = ā€œ41 54 90 07 e8 0c 08 16 70 00 00 "
s1 = s1 + DestHex
s1 = s1 + " 0d 0aā€
SendCommand
Return

Label SendCommand
COM WriteStringHEX s1
'Print ā€œTx=ā€ + s1 + CRLF
Return

String Port = 5
Numeric Bauds = 921600
Essentially, we send hexadecimal strings over the serial port to control devices.
We aim to provide a straightforward automation solution for individuals who may not have extensive programming expertise.

Thanks for your time.

I’ve just published a comprehensive Python library to control the motor and a complimentary desktop GUI app similar to theirs.

I work on a mac and haven’t been able to get their Windows program to work on my system, so I built my own cross-platform desktop app. I hope it’s useful to someone. It’s not as feature-rich as theirs yet, but I hope to build it out more.

The CyberGear CAN interface is pretty good, but it would be even better if SimpleFOC could be installed on this board. I know some people are working on it. Good luck!

2 Likes

Hi, I currently have exactly the same problem as you, concerning this zero position which is lost each time the power supply is cut. Have you been able to find a solution?

The documentation (section 4.1.6 ) states that the custom zero position is lost after power down.

I’m not sure how other people deal with this, but I assume the solution would be to have a secondary absolute encoder on the output shaft or limit switches to zero the motor on power-up.

Depending on your application, saving the zero position using the motor’s internal encoder isn’t practical. The encoder tracks the absolute position of one full rotation of the motor before the planetary gearbox. This means it tracks ~8 rotations per output shaft rotation. So if you turn the power off and move the shaft manually, it won’t know how to return to the absolute position it was at when the power was on.

You can see this yourself by turning the motor on and instructing it to move to the default zero position. Then, turn the motor off and manually turn the shaft a quarter turn. Now, turn the motor back on and instruct it to move to the default zero position. You’ll see that it doesn’t move it back to the position it was at on power down.

1 Like

Thank you very much for your reply. It’s really annoying, I thought that on such recent motors, adapted for robotics, this problem was integrated. How do they do this for their mass-produced robot dogs, they also use additional sensors? I’ve also heard that it might be possible to describe a specific can frame to force this zero position into the motor’s memory, has anyone ever used this method or perhaps something else? But if the encoder follows the logic you describe, it might not be much use either. For information, I use an ESP32 and the Arduino library.

Great work! I wrote my own python library but had trouble getting velocity to work in Operation Control and Position modes. Trying out both your libraries now.

Let me know if it works for you. I’m still finding a few bugs here and there and am trying to clean them up as I go.

Hi everyone,
I’m using the arduino library with the esp32 XIAO, I’m desperately trying to assign a new zero position as soon as the program starts. I’ve tried with the CMD_SET_MECH_POSITION_TO_ZERO function. But all my attempts have failed. Do any of you have an example of code to do this? Thank you !

Hi David.

In theory, CMD_SET_MECH_POSITION_TO_ZERO should work as long as you set the first byte of data as 1. Check section 4.1.6 of the documentation.

Without seeing your code, it’s hard to provide much guidance. Can you show us that part of the code?

Here’s how I set it in python: python-cybergear/src/CyberGearDriver/motor_controller.py at main Ā· jgillick/python-cybergear Ā· GitHub

So, if I were to convert it to C, it would probably look something like this

#define CMD_SET_MECH_POSITION_TO_ZERO 0x6

...

// CAN IDs
uint8_t can_id = 127; // This should be your motor CAN ID
uint8_t master_can_id = 0;

// Encode message ID
uint8_t cmd = CMD_SET_MECH_POSITION_TO_ZERO
uint32_t id = (cmd << 24) | (master_can_id << 8) | can_id

// Data
uint8_t data[8] = {0x00};
data[0] = 1;

// Create CAN message
twai_message_t message;
message.extd = 1; 
message.identifier = id;
message.data_length_code = 8;
for (int i = 0; i < 8; i++) {
  message.data[i] = data[i];
}

// Send message here...

If you’re using the Xiaomi_CyberGear_Arduino library, you would probably do it like this:

// CAN IDs
uint8_t motor_can_id = 127; // This should be your motor CAN ID
uint8_t master_can_id = 0;

// Set data
uint8_t data[8] = {0x00};
data[0] = 1;

// Set zero position
cybergear._send_can_package(motor_can_id, CMD_SET_MECH_POSITION_TO_ZERO, master_can_id, 8, data);

Hi Jgillick,

Thanks a lot for your codes! In the meantime I’ve finally created this function to send the can frame for set to zero. I’m sure it could be done better, but it works fine now.

void set_mechanical_position_to_zero(uint8_t motor_id, uint8_t master_id) {
    check_and_reset_can_bus();

    twai_message_t message;
    message.extd = 1;
    message.identifier = (6UL << 24) | ((uint32_t)master_id << 8) | motor_id;  // 0x600FD7F
    message.data_length_code = 8;
    message.data[0] = 1;
    for (uint8_t i = 1; i < 8; i++) {
        message.data[i] = 0;
    }

    esp_err_t ret = twai_transmit(&message, pdMS_TO_TICKS(1000));
    if (ret == ESP_OK) {
        Serial.println("Commande CMD_SET_MECH_POSITION_TO_ZERO envoyƩe.");
    } else {
        Serial.print("Erreur lors de l’envoi de CMD_SET_MECH_POSITION_TO_ZERO : ");
        Serial.println(esp_err_to_name(ret));
    }
}

To help me, I observed the CAN frames exchanged between the Xiaomi software and the motor with CanAnalyser software, it helped me a lot to understand how it works. There are still a lot of very interesting functions in the documentation, so I’ll have to take a closer look!

Thank you again for your help.

For production robots, like their robot dog, they probably have either an additional absolute position sensor placed on the output shaft (a common addition). If not, the other common option is to put a pair of limit switches at the min and max joint angles and the motors would run a homing sequence at each startup.

Overall, I’ve been unimpressed with the CyberGear motor. For the price I’ve found it severely lacking. In my testing, I found the Steadywin GIM6010-8 motor much better and a little cheaper. I wrote up a comparison here.

I also just noticed that you can order the GIM6010-8 motor with a built-in second encoder. I’m assuming this would give you the absolute position of the output shaft. I’ve ordered one and should know in the next week or so.

I also ordered a SteadyWin GIM8108-8 motor. It’s a little bigger, but it seems to have a better torque per amp rating (torque constant).

That code looks good. I’m glad it works!

For the xiaomi robot dog, they apparently reset after each power-up, so the motor must surely perform a sequence of movements. I wonder if they don’t use the torque feedback to find out if the motor is in mechanical stop, then it just records a new zero from that position. But I don’t have enough experience of using this motor to know if it’s really feasible? However, for mass production, this way of doing things would limit the use of additional components.

I read your article on the comparison of these two motors, it’s really very informative and enriching, thank you very much for all this information! This GIM6010-8 model is indeed very interesting, for my part I’m looking for a bit more speed and it can go up to 420rpm, so much more than the cybergear and with almost equivalent torque, and especially this additional encoder as a bonus. I hope you’ll let us know about your future tests with this engine!