Hacker News new | ask | show | jobs
by MichailP 3331 days ago
Can someone more familiar with embedded design explain a bit more on this? Can this really turn cheap motors into industrial level motors suitable for hobbyists?
6 comments

I'm on a cell phone, so I'll be brief, but can add more detail later. I've been doing motor drivers and embedded work (software and electronics) for robotics for a while, and did work on motor driver ICs before that, so this is kind of my wheelhouse! Briefly: I can tell you that the electronics and software are only a few parts of the overall equation here.

Yes, this does look like (from the demo video results), a decent driver design, however quality of the motor DOES matter, and will eventually become a limiting factor if you are lookig for high precision or high power, as you start to run into things like torque digging, motor heating, etc. There are also little things in the driver design that can bite you if you aren't careful, but I'd need to look at the schematics to comment.

I'm not trying to crap on the project or designer. There was clearly some thought and care put into this! I just don't want people to expect magic, or to think that the only difference between an industrial servo and a hobbyist motor is the electronics. That said, you can get VERY far with good electronics and control software!

A hobbyist project will probably do just fine with something like this (or a motor driver reference design from the chip manufacturers), and by the time they run into limits of those designs and hobbyist motors, they'll probably have a pretty good idea of where they need to go as a next step!

I'll take a closer look at this design later, and update if anyone is interested.

Please :-)

Here are the documentation links to get you started:

Hardware: https://github.com/madcowswe/ODriveHardware/

v3.2 schematic: https://github.com/madcowswe/ODriveHardware/blob/master/v3/v...

Firmware: https://github.com/madcowswe/ODriveFirmware

PC config and analysis support: https://github.com/madcowswe/ODrive

FPGA: https://github.com/madcowswe/ODriveFPGA "... the FPGA logic and software that runs on the FPGA based ODrive. This is not currently in development, but may be resumed at some later date."

    ----
The hardware is based on a STM32F405RGT6[1] driving two TI DRV8301 brushless motor controller chips[2] and a bunch of MOSFETs to handle the power switching. I/O is a USB, CAN with driver chip, and SPI unbuffered on headers.

[1] High-performance foundation line, ARM Cortex-M4 core with DSP and FPU, 1 Mbyte Flash, 168 MHz CPU, ART Accelerator http://www.st.com/en/microcontrollers/stm32f405rg.html

[2] DRV8301 Three-Phase Gate Driver With Dual Current Shunt Amplifiers and Buck Regulator http://www.ti.com/lit/ds/symlink/drv8301.pdf

Sorry for being off-topic. I just want to say, "STM32F405RGT6" is possibly the most hardcore product/model name ever. Just beautiful.
It packs a lot of information in. STM32F4 is ST Micro's range of high-performance ARM Cortex-M4 microcontrollers with FPU, STM32F405 is a particular family of devices in that range differing mainly in package and memory size, R specifies that it's the 64-pin variant, G indicates that it's the version with 1024KB of flash, T is the LQFP package, and 6 is for -40 to 85 °C temperature range. Most of this is shared across the entire STM32 range of devices.
There are usually a dozen variants of the same microcontroller design just with different peripherals, amount of memory, packaging..

You could just as well say STM32 or STM32F4 and that is pretty much 99.9% of the information you need to know :)

Historically, hobbyists have chosen stepping motors because they can be controlled with a fairly simplistic controller, and there are lots of solutions out there... check out some of the step motor drive boards at Pololu Electronics. But stepping motors have limitations, namely speed and torque per unit motor size. Note that as a hobbyist, I'm still living in the stepper motor world, so I'm interested in this project.

Brushless servo motors offer the potential for much higher torque and speed in a small package, but require a different form of electronic control, and the gist of this project is that such controls haven't been available for hobbyists. So it's a matter of finding a gap in the existing project / product space, and filling it.

Note that e-bikes use brushless servo motors, so somebody has done the math on what motor technology is most efficient. I also think these motors are in electric cars, and even appliances such as washing machines.

I will be reading with interest. I'll also start keeping an eye out for what kinds of motors are available.

As for "industrial level," I'd say that it's a matter of pushing machine speeds up to a level similar to what you might see in a factory. Often, with stepper motor driven gadgets, you accept the fact that your machine will take a long time to do anything, but who cares, it's a hobby.

On the industrial side, you very quickly run into the situation where your motor is no longer the limiting factor affecting speed and precision, but the design and assembly of the mechanism is.

Stepper speed can be quite impressive with the right driver, still not up to servo levels but much higher than you might think possible, it is all about getting to and past the resonance points in the motor and the whole dynamic assembly. Once you can do that steppers can run quite fast.

As for torque, servos again have the edge, but there are pretty large steppers too (1" shaft...).

If you drive steppers with a standard H-bridge you will never get close to what that stepper can do, driving stepper motors to their potential is a black art where at some point during the operational domain you'll be taking energy out of the motor rather than putting it in in order to get past the resonance point. There are companies that specialize in such high speed drivers (Berger-Lahr and RTA for instance), they're not cheap and by the time you're done making this work you might as well install a servo system.

Pretty much this! People definitely do work some black magic here. (See for a simple example microstepping drivers, where the current profile isn't sinusoidal, but specfically tuned to match the motor profile).

One place where I did see this used frequently is in certain consumer electronics, such as inkjet printers. (Ever wonder why companies like Allegro sell weird combos like a chip for driving 2 steppers, a DC motor and a Buck converter....this is why)...When you are shipping a million printers a year, you save pennies using the cheap actuator and fix it in the controls, but for most projects, yeah totally not worth the hassle!

I do motor design and research for a robotics and automation firm. In my experience, steppers often can provide significantly higher torque than a similarly sized BLDC. Their reputation comes from their use in low cost applications, where they are run open-loop and so the load torque must be kept well below what the motor is actually capable of providing, to avoid missing steps. Close the loop with an encoder and stepper performance is more like a geared BLDC. It was a big surprise to me when I first noticed this, because it didn't align with the reputation that stepper motors had.
ShopBots, the big CNC routers, use big steppers with closed loop control, and get considerable power and speed out of a small motor without missing steps. Tormach CNC mills are stepper-driven without feedback; the motor is powerful enough and geared down enough that missing steps isn't a problem.

Steppers do consume full power when not moving, of course, so they're not favored for battery powered systems.

The Tormach CNC actually uses a special driver that can detect missing step without feedback.
Shopbot has a closed loop stepper on some models [1], but Tormach says they don't.[2] Tormach just has a big enough stepper and enough gear reduction to avoid missed steps by brute force.

[1] http://www.shopbottools.com/mProducts/ShopBotdesign.htm [2] https://www.tormach.com/technical_questions.html

Indeed, and on the hobby side, microstepping has gotten very easy over the last few years. Here's my favorite driver du jour:

https://www.pololu.com/product/2970

I wonder how much these "alternative" driving modes are portable across different sizes and vendors/n. of poles
It's parametric, once you know the math it will transfer. There are (or were, not sure if they are still in use) 5 and 7 phase stepper motors to help combat these resonance problems.
I have compiled a small list of motors that I think are suitable for robotics applications, along with some useful calculations, here: https://docs.google.com/spreadsheets/d/12vzz7XVEK6YNIOqH0jAz...

You can take a copy of the spreadsheet and enter in your own motors that you find. Also do note there is a second tab on the sheet that lets you explore cycle times on trapezoidal trajectories.

Yeah, brushless is definitely the way to go for efficiency, and good smooth motion. Stepper for an e-bike or washing machine (Not a BLDC either, but...) would be nuts, and in general steppers are really for cheap semi-decent control, not for anything where precision is really needed.
My colleague had a motor from a newer washing machine out on his desk, and it did appear to be a BLDC. Alternating magnets with three phases of coils as you'd expect. Driven from rectified 120V AC!
Very cool! So I should perhaps qualify my comment to say that some newer appliances may be moving that way. (I've done work on motor drives for consumer electronics, robots and some industrial devices in the semiconductor world...no appliances, but it's cool to hear some of them are going that way!)
Yes.

There are caveats related to long term durability, but you said "for hobbyists" who I think are less concerned with that aspect. As far as up front performance the answer is yes. Others have explained the details so I'm just adding to the "yes" camp.

Brushless D.C. Motors are the way to go for robotics in many actuation situations for the near to medium term (next decade at least) and the lack of suitable low cost controllers (this is "low cost") has been a major issue, so this product is excellent.

Source: am robotics engineer in Silicon Valley building my own brushless powered robot arm as a hobby and I'm an alpha contributor to the Odrive project. I've also designed my own brushless controllers [1] and built brushless linear motors.

[1] https://youtu.be/vbrzxlRpC0k

Sure, the issue with brushless motors isn't the motor, it's the encoder.

The encoder is what "closes the loop" and allows you to get the accuracy you need. If you have a way to relate the position of the thing being controlled to the motor position, then you can use any motor.

So, it's a nice driver, but it doesn't make the encoder any cheaper.

That's a bit of an over simplification, but for a hobbyist application, sure.

You are absolutely right that the encoder is a BIG part of your system design, but the motor quality will make a difference. If you are doing something like a robotic arm, or slow speed motor control, you don't just care about encoder ticks, you also start caring about things like torque ripple in the motor if you want decent motion quality, regardless of how good your encoder is!

I suspect there's no free lunch here. If they are designed for hobby r/c aircraft, they are designed for shorter runs with lots of free prop-driven fan cooling. Not for sustained runs without a prop cooling it.

So, it would likely work, but have a shorter lifetime. The barrier to using them was having a low voltage / high current controller. This fills that gap.

So, not a bad idea, but there's almost surely a durability tradeoff. And maybe that's fine for a hobbyist cnc application.

Cooling can be an issue if you drive them near their rated power without adequate cooling. And absolutely they won't have the same quality of construction as true industrial devices. However they are sufficiently powerful to be useful and cost effective at continuous duty levels below their max rated power.
One thing to keep in mind is that for many robotics applications, the duty cycle for high torque (i.e. acceleration) is often quite low. So they may still run fairly cool.
Most industrial motors are also 'cheap', but controlling them is expensive.

There are two things that matter: accuracy and repeatability. Most of the time accuracy is not a problem. But repeatability is. For example when you move something heavy a motor can loose a step. When you don't know this the rest of the accurate moves are out of control.

That's why industrial controllers have good feedback systems. They know a step was performed. If not, you can act on it.

So it's more about control than about motors. But cheap motors wear out faster.

> accuracy and repeatability

And reliability. Making driver electronics that will live long term is not that simple, sudden stops and overload conditions are tricky to deal with in an effective way without risk to the attached electronics.

> They know a step was performed. If not, you can act on it.

Servo's don't 'step', current is applied to the motor in a continuously varying manner and the delta between the desired movement and the observed movement determines how that current will change over time.

This leads to all kinds of nasty side effects: overshoot, undershoot, runaway in case of a failing feedback mechanism and so on. Steppers are much simpler to interface to in principle (but to drive them at speed is remarkably hard due to all kinds of resonance issues) but much harder to get performance and reliability out of, almost all larger scale industrial control is done with servo motors tightly coupled to their driver electronics.

"Losing a step" makes me think you are thinking about stepper motors, which can be a problem, but for brushless motors it's a bit more complicated than that, since we don't drive them in the same stepwise fashion.
Yes I simplified. But in a way servos are also step/pulse controlled.

Edit: as other point out 'controlled' is not the best word here. Maybe 'positioned' would have been better.

No, they are not, servos simply do not step, and whatever pulse there is is PWM to control the torque without overheating the driver in an analogue domain.

There is no reference based on a 'step' or a 'pulse', there is only the desired position and the actual position and the difference between the two can be quite large, much larger than with a stepper which can by definition be at most one step ahead or behind or it is game over.

This gets very interesting once you start to combine servos on multiple axis and you want to limit your maximum error compared to some desired trajectory.

I know servos don't step, but doesn't the decoder 'count' steps?

But I totaly agree with you, they are completely different. Maybe in this case it was not very clever to oversimplify the problem.

By the way: you point out what I think is great about this business. So much work has been done to control motors very accurate. It's amazing what CNC machines can do today. And also how software optimized motion paths (gcode). And now this hardware. Great stuff!

Encoders (not decoders) typically contain a glass disc which contains two 90 degree out-of-phase sinusoidal patterns of light/dark, these are digitized to some arbitrary precision to give you a number of 'steps' around one revolution of the encoder axis. The 90 degree out-of-phase signal is used to be able to determine the direction of motion.
So the term "losing a step" is used on stepper motors, which can be mechanically overpowered to lose positioning. Encoders however will typically always measure the position accurately even if you overcome motor torque and disturb the motor. So in that sense "lose a step" simply does not apply here. Steppers can lose positioning by being pushed beyond their holding torque, while brushless servos will not lose their positioning in the same situation.
Hmmm, not sure I follow you there, care to explain?

(Unless you are referring to block commutation of the BLDC phases, which can look sort of similar to step wise control, but I would rebut that in precision servos drives, we would also look at doing non stepwise commutation (sinusoidal, FOC, etc.))