Hacker News new | ask | show | jobs
by dfasdfasd 2446 days ago
> While it is something Reddit endlessly complains about (despite having no software engineering experience)

While I agree Reddit's obsession with weird technical details is annoying, this is a pretty arrogant position. I've written motion control code for both 8-bit and 32-bit designs, and the difference is bigger than "read a string and pulse an IO a few times". The Atmega has been outdated for the past 10 years, the only reason it picked up in 3D printing was because of the accessibility through Arduino and similar---not for any good, technical reason. They're going to need to switch at some point, may as well be now.

Sure, you don't _need_ a 32 bit processor, but a modern Cortex-M0 or M4 is much more powerful than an Atmega328 for the same cost or less. My Prusa Mk3 takes a non-negligible amount of time to sort files on the SD card, and the screen could really show more information. There is also much more advanced motion planning they could do with a little more power available.

3 comments

Additionally, we don't need to speculate, they explained their reasoning in the article:

> Why did we decide to switch to a 32-bit board? Surprisingly, raw performance is not the main reason. We can now write cleaner and more abstract (reusable) code without assembler hacks like on the 8-bit board. Adding new features becomes much less of a hassle and we don’t have to count every single byte in the flash memory. Unit tests and JTAG debugging sped up the development and we also got the chance to include ethernet and optional Wi-Fi connections.

If you read through the firmware you'll find 1000000x #define's for different features that I'm sure they're eager to get rid of.

> There is also much more advanced motion planning they could do with a little more power available.

But for 3D printing isn't the printer simply reading the instructions in the gcode? It's not doing any motion planning at all, that is all decided by the slicer.

No, on most CNC machines the controller actually handles much of the motion planning.

The slicer will generate a command that says go from point (x1, y1, z1) to point (x2, y2, z2) with speed f, but it doesn't say anything about acceleration, or how to transition into the next move. A very simplistic controller will use a trapezoidal ramp profile where it will ramp up to the programmed feed rate at a fixed acceleration, then stay at the programmed feed, then ramp down in time to reach the end point. However, if the move was a very short line or arc as part of a large surface, the machine doesn't need to reach 0 speed before starting the next move. A smarter controller will 'look ahead' to predict the next few move and plan the motion of the machine to eliminate jerkiness or stopping.

The slicer may tell the machine what acceleration to use, but that's really just setting a parameter in the machine controller, and isn't settable per-move.

This isn't as critical for 3D printers as it is for big, heavy milling machines. Nevertheless, you can do clever things like trying to compensate for vibration, or speeding up or slowing down the extruder motor based on the pressure of the plastic in the nozzle.

This isn't to say Prusa is switching just to do better motion planning, it sounds like that isn't a primary goal, but I'm trying to illustrate there is a lot more room for intelligence than 'just wiggling some IO'.

I see.

I can see some benefit to motion planning on the device if, for example, decisions are being made based on real-time data. For example, if there is a pressure sensor for the nozzle then the board could use this this realtime data to adjust it's motion.

If there's no realtime data being input then everything is simply a deterministic function of the gcode, and all of these aspects related to acceleration and jerk can be precomputed on your powerful multi-core desktop and "rolled into" the gcode.

It can't be "rolled into" the gcode though. Gcode is sadly extremely limited, and while you could build some pretty complex extensions, there is no reason to avoid switching to a (cheaper) more powerful microcontroller to avoid building gcode hacks.

Regardless, I was just pointing out one place where a bit of extra power could help with printing. However, that's not really the point. It's not that the core _needs_ to be 32 bit, it's that most modern microcontrollers are 32 bit. The Atmega is more expensive, has less memory, no JTAG, no DMA, poor debugging support, and mediocre peripherals. The extra power to run more advanced motion control is just a bonus when you switch to a modern Cortex-M.

The real usefulness of power is the possibly to add other features not directly related to printing like built-in ethernet/wifi, or a larger screen (it drives me nuts that I can't see longer file names on my Prusa screen).

Sure, but now they are a small company that has to maintain two separate codebases. Even big companies like Google can't keep their Android and iOS apps at feature parity, so something has to give and it's the early adopters with old hardware that is just not going to get any new features. Or they are going to have twice the software engineering overhead.

I get why you would start from scratch with an M4. I don't get why you would maintain two different codebases commercially, though.

(As for the motion control aspect, at the feedrates of 3D printers, I don't think you get anything from a faster processor. Motion control is not what's limiting print speed or accuracy.)

> Sure, but now they are a small company that has to maintain two separate codebases. Even big companies like Google can't keep their Android and iOS apps at feature parity, so something has to give and it's the early adopters with old hardware that is just not going to get any new features. Or they are going to have twice the software engineering overhead.

I mean sure, it's not going to be a perfectly smooth transition, but I think you're underestimating how bad it was on the Atmega. There is _no_ code space left on those chips, which makes adding features nearly impossible. They'll probably just maintain the old version for as long as they can, while switching new products over to the new one.

The codebase is also probably simpler than you realize. These microcontrollers don't have the code space for programs of any significant size. Porting the peripheral interfaces over to the new controller is not that hard.

> (As for the motion control aspect, at the feedrates of 3D printers, I don't think you get anything from a faster processor. Motion control is not what's limiting print speed or accuracy.)

This is actually a real problem. It's not the basic motion control, but doing things like intelligent look-ahead or vibration compensation.

I think the technology is further ahead than you realize. It's not an Atmega running your microwave we're talking about. Those chips _are_ seriously limited, in material ways, even if you haven't run into it yourself.

I think that they're just using Marlin, a lot of the work is done for them.
> small company

iirc they have well over 200 employees at this point.