Xiaomi Cyber dog geared motor ~$60

That is great news, I think you said that you’d probably stick with stock, if that did what you needed. Is that your plan? Is the control over canbus good/flexible?
Have you got any photos or schematics of the gearing arrangement? Cycloidal/planetary?

It’s planetary geared. The first post shows a nice exploded view, just scroll back to square #1

@Candas1 - I’ve ordered a few of those WeAct Blue Pills. The bluepills GD32F303CCT6 are very similar to the cyberdog GD32F303RET6 but will be much easier to experiment with, might try to pair it with simplefoc mini board. Also interested if I can make progress on getting canbus working. I’ve got can working on stm f1, f4, g4 so fingers crossed it is similar.
@nanoparticle - are you still looking into the pin outs? I might try to draw out what you’ve done in easyeda. It’s going to be a few weeks before I get the bluepill or cybergear shipped.

1 Like

Yes, the canbus control seems to be very flexible. There are current, speed and position controls with a ton of adjustable settings.

@Owen_Williams If you are working on porting SimpleFOC, I am willing to help out any way I can.

It seems like you would need pin assignments for:

  • MCU to gate driver chip
  • MCU to CAN transciever
  • MCU to rotary encoder

I didn’t realize that the geared motor is also closed loop!
That’s really great. Did you find what encoder is used?

It’s imaged in the album of pictures, it’s the AS5047

https://ams.com/as5047p

1 Like

The next thing I wanted to do with this project was port the SPI driver for the mosfet driver chip to Arduino, since I think I got all the super important pins already. However, for certain reasons I am currently fully occupied with trying to create an online portfolio of my projects so that will have to wait. Feel free to draw the schematics if you’d like, as that would definitely improve comprehensibility over a spreadsheet.

Maybe we should make a github repo for this project, with schematics, sample code, etc?
There is quite a lot of information in this thread, and it’s easy to lose links to the easyeda projects IMO

2 Likes

I’ve made a start on the schematic. I haven’t actually got a cyberdog yet so this is from @nanoparticle pinout + pictures + datasheets. I haven’t been able to identify a few of the components (buck, can, oscillator) but they seem to have standard pins:

I think the gd32f303 being closer to stm32f10x vs stm32f30x needs a bit more investigation. e.g. SPI pins look like they match stm32f303

2 Likes

I think this might have been about peripheral structure (register locations) than physical pinout, since people were successfully building with F1 libs.



Macro shot of crystal + CAN transceiver, and the only buck regulator is the one integrated in the FET driver IC. Looks like the crystal is some generic 16MHz (no I’m not salty that I can’t find it, definitely not), and the CAN IC is a Novosense NCA1051

1 Like

Anyone want to give this QR code a shot? :smile:

2 Likes

That looks like a standard 4 pin crystal oscillator. Wouldn’t be easier to use an oscilloscope or logic analyzer to check the frequency? Looks like a 16MHz one, which would make sense for that processor

1 Like

Unless anyone else has started, I’m going to write spi driver code for the infineon 6EDL7141. I plan to use @runger’s DRV8316 as a template swapping out registers / enums as per 6EDL7141 datasheet. I don’t plan to use infineon’s example code as it’s license is proprietary.

2 Likes

@Owen_Williams Nice one, that would be great! It does look like this chip has a large number of registers, seems to be a very capable driver…

I’ve created the SPI driver but it’ll be a few weeks before I can test it.

@runger - yes lots of registers 7 status and 16 control registers!

It’ll be interesting to print out the registers on cyberdog - they may have burned the OTP which would (probably) be good as the register bitfields will be configured for the cyberdog hardware.

This device use 24bit word (compared to 16bit for drv8316). I think it is SPI Mode 1. There is no parity. First to try it might have to tweak some of the init(), readSPI(), writeSPI() - I’ve changed them to what seems sensible to me. Cyberdog has separate SPI bus for gate driver and sensor. I think the pins for the driver don’t match what arduino expects for stm32f103 (but do match stm32f303) - getting the peripheral configured might be fun.

There is an arduino platform for giga device, it should support the gd32f303, but the project is not very active, we should be prepared to find bugs if we use it.

So it would be easier if stm32duino/stm32f1 or stm32f3 works, but if it doesn’t, they won’t support us because it’s a gd32 chip.

I’m sure you could hop on alibaba and find something, or at least the planetary gearbox, probably for $5. Pair it with a gimbal motor for $15 bucks (5 on aliexpress, but those are random motors, however they are similar enough…

First off these are not gimbal motors. These are low-resistance drone-like motors that you can blasj with 20+ amps of current (for some milliseconds). They are quite powerfull. The legs can generate enough force into the ground to propell the robot possible 1/3rd of a meter off the floor. So the ring gear are not cheap either, even in China because they need to withstand the force.

At $60 per assembly, these actuators are cheaper then you can make youself.

The design is not new. These were invented for the MIT Mini Cheetah and were explained is detail in a ground-breaking paper A Low Cost Modular Actuator for Dynamic Robots by Benjamin G. Katz If you have not read the paper, you should. You can buy many versions of this from $500 to (now) $60. and you can even 3D a version of it, except for the stator and magnets.

If you have not seen these actuators in use, here is the video https://youtu.be/xNeZWP5Mx9s?si=U8XIuRgMxRcfwOxD

Sense then people have been figuring out how to simplify the design and make it for less money. It looks like they have reached the bottom.

1 Like

Santa’s little elves must have run out of insulated copper cable. My two cybergear motors weren’t in my stockings, but there was a note saying they’d made it through uk customs. :santa:

6 Likes

A bit of an update, I’m making slow but steady progress on getting cybergear working with open source (simplefoc) firmware.
Progress so far includes:

  • using gd32 (not stm32) arduino core. gd32 CAN is different enough to need the real deal.
  • small updates to the gd32 core e.g. for clock config
  • added cybergear as a gd32 variant so it can be used easily in platformio including tricky peripheral pins / names
  • canbus is working (using my simplcan crossplatform lib)
  • spi1 to infineon driver is working - I’ve written a driver for all status/config registers.
  • spi2 to as5047 is working. I can use simplefoc magnetic sensor class to read angle

Still loads to do. i.e. trying it with simplefoc, PWM HAL for gd32, current sensing. Hoping to get a motor moving in the next month or so. :crossed_fingers:

And here is the code for my cybergear_adventures

12 Likes