8 BIt or 32 Bit Processors?

8 Bit or 32 Bit for 3D Printing?


I'd like to add my 2 cents to this discussion.

It is no secret that I prefer 32 bit over 8 and 16 bit. Way back in 1983, I opted for a Mottorola 68K development board over the then popular 8 bit Apple, CPM and other personal machines.

I am a software developer by profession, and worked on mainframes at that time.

I worked for one of the biggest commercial and industrial corporations in this country, and will always remember the advice given me by the IBM salesman when I, as a junior was dealing with a difficult problem.

His advice - "Use the most powerful features of the compiler and machinery at your disposal to solve your problem. Once you have a working solution, you have reached your goal and can optimise for performance. The cost of more powerful machinery is rapidly decreasing, you will not need to do the cost saving as the newer machinery is cheaper".

Five years later, our national power utility gave away their old mainframe. The cost of electricity to run just the air conditioners was greater than the total cost of ownership (TCO) of the replacement.

Business will always yield to lower TCO.

1. COST 

32 bit processors are cheaper than 8 bit processors since there are huge volumes in production for cellphones and other electronics. they also use much smaller die sizes than the dated 8 bit designs.

Lets look at single quantity devices from a single manufacturer with 50 IO lines, 128Kb flash and 16Kb Ram. i.e. all roughly equivalent to ATMEGA2560

Digikey gives the price of Atmel 2560-16CU as $6.28 (April 1 2019). I have a choice of about 30 devices in this range.

STM32F ARM devices (all 32 bit) there are 363 devices that fit our requirement   
            Starting at $2.74 we can get STM32F070RBT6TR an entry level device
                          at $6,23 we can get STM32F401RDT6

This latter device runs at 84MHz,  has 96Kb Ram and 384Kb flash.

Clearly bigger bang for the buck.

There are many other manufacturers of compatible devices.

There are also newer variants such as the ARM M0 family, which are 32 bit , hardware and software compatible and cost as little as $1.30 in single quantities. This opens up further options for architecture of the mechanics, hardware, software and firmware.

2. PERIPHERALS

The 32 bit ARM processors being used contain a number of peripherals that make it easier to control multiple parallel operations at high speed.

2.1 Timers can be used to synchronise and calculate 10-20 steppers at the same time to microsecond precision. These timers can be set up that the CPU sets up a list of moves and lets the DMA and timers get on with the high precision timing with very little intervention by the CPU.

2.2 DMA DMA controllers enable programmers to set up lists of instructions and have the peripherals execute the instructions without CPU intervention.

For example, acceleration and deceleration curves can be set up and run, the timing of step pulses being adjusted each step. This frees the CPU up to do other tasks more efficiently

2.3 ADC ARM ADC are 12 bits (1:4096) and can resolve 0.05mm in a 200mm axis. This enables software to run the steppers as digital servos and automatically detect and correct for missed steps.

This problem accounts for 70% of my failed prints (and probably also those on the forum posts I see).

The problem is preventable.

2.4 SECURITY
With more and more printers being attached to the Internet (IOT), secure communications will be mandatory.

Intellectual property rights are a concern as the G-CODE we all run is in some ways better than stealing the design.

2.5 CONNECTIVITY
Ethernet, WiFi, Bluetooth, IR, NFC and other wireless communication channels are available, sometimes built in.

Nearly all manufacturers offer such devices.

In the near future we will see 3DP with connecting cables for power only.

This simplifies design and reduces some safety issues.

2.6 FPU
Floating Point unit built into many devices simplifies software and speeds it up greatly. Better algorithms can be recalculated more often to provide better solutions and control of the 3DP.


3. SOFTWARE

There were also a of die-hards from my generation that wanted to prove that everything could be done with an 8 bit processor. Yes, they have done amazing things, but have slowed down the overall progress of 3DP.

ARM and other 32 bit processors are HUGE in terms of functionality and it has taken software engineers some time to learn their features and how they can be leveraged.

There is a huge learning curve as ARM manuals are 1500 to 2000 pages each and there may be multiple manuals per processor. Compare this to then 20-30 pages for a PIC processor perhaps extending to a few hundred pages.

Many of the professional development tools either expensive ($3000 per seat) or immature and out of reach of experimenters and hobbyists. Open source tools are more usable now than they were a few years ago.

Software is easier to develop due to advanced features such as hardware floating point.

Software is also portable across the entire spectrum of devices, regardless of manufacturer.

Unfortunately the libraries to bring this type of programming to the masses has taken time to develop. Larger users (e.g. cell phone companies) develop their own libraries and do not publish them.

Marlin, and other firmware has been developed with ATMEGA in mind, such processor binding is normal for firmware. Marlin 2 is restructuring the code to make it easier to port to different platforms.

Klipper has takes a different approach - unbundle the generic G Code interpreter and communicate to controller(s) using a lighter protocol. Smoothie did this years ago with their 'Blocks' list, but never went the next step and unbundled a 'blocks' processor from a 'Gcode' processor.

With the unbundling offered by Klipper and Klipper like schemes comes the ability to utilise the advances in graphic processing that we have seen in the computer games market over the past decades.

 Whilst a 3DP  may never run more than a few hundred thousand 'steps' per second, the ability to measure, predict and control those 'steps' each cycle is central to producing reliable and correct results. 3DP is still in its infancy in this regard.

I see this as a major development in  open source printing. 

4. ADVANCED FACILITIES

Time critical tasks can be handled by more flexible interrupts and DMA. Freeig up the CPU to calculate. This is essentially what Klipper is doing with a Raspberry. Smoothie did it years ago with the 'Blocks' intermediate protocol. This needs to mature.

5. RESOURCES

Everywhere I look in the 8bit world, I see the authors (programmers) complaining that they are simply 'running out of steam' with 8 bit controllers - CPU, RAM, ROM, IO.

GRBL, Marlin and other firmware all have 'tricks' and features removed with comments like "We can only calculate this once every 20 steps" or "Insufficient ROM to improve this".

Worse still, error reporting is poor or non existent.  My RAMPS machine started a print, heated to temperature and then aborted without message last week. After 3 tries and nearly an hour, I discovered that the NTC was faulty and disconnected when the machine moved.

Another printer I was building simply did nothing till temperature sensors were attached to all temperature inputs. There was no diagnostic entry in the log.

All thsi most likely due to their being insufficient resources to trap and report on errors correctly.

The requirement has increased over the past 10 years to the point that 8 bit will simply not cut it any more.

6. MICRO CONTROLLER DEVELOPMENT

8 bit processors reached end of life about 10 years ago, and very little development has taken place compared to what has been invested in 32 bit processors. Today they are simply 'Cash Cows' being milked for whatever can be recouped. Arduino has extended the life of ATMEGA.

Witness the change of direction and ownership of the companies that operated in this space 3-5 years ago - Atmel, Microchip and others.

In electronics today, the cost of a device is more dependant on area than complexity. You pay about the same price for a 7400 NAND Gate ($1.17) as a ARM M0 chip ($1.32).

7. 3DP DEVELOPMENT

We are seeing more interest in extending the capabilities of 3DP now than perhaps a year ago.

The past 10 years has largely dealt with getting a workable product that can more or less reliably print a small object.

The honeymoon is now over and people want to see more and more features in 3DP till it can rival and oust conventional plastic and metal production.

The primary factors delaying adoption are time to print, multiple materials, quality and yield.

In order to speed up printing, we need faster machines which implies better control.

In order to print multiple materials (colour, support, specialist plastics) we need fast change tool heads or machines capable of utilising multiple tools simultaneously.

We can also go the multiple head route (multibot).

The simplest multibot will require the co-ordination of many motors. The simplest case - 2 gantries with 2 gondolas each yields about 11 motors that need to be co-ordinated simultaneously. Add multiple tools and we are soon in excess of 20 motors.

Quality and yield can be improved by feedback control that will eliminate up to 95% of current failure points.

Little if any of this can be achieved with 8 bit processors. Multiple 32 bit processors are better suited to the task and cheaper.

8. USABILITY

A lot of development  that may be required has simply not taken place because the software we are using is almost all based on the original 'proof of concept' code from the Reprap days.

Poor error reporting, open loop control systems, coded messages are all things that belong in a previous millenium.


We are only now getting to the point where we understand what is limiting the development of our printers in terms of speed and parallelism.

We require much more sophisticated control mechanisms in order to achieve better throughput and higher productivity that will open up new field of applicability.

Servo control, 'Volcano' high throughput hotends, geared extruders, multibots, mixing heads, tool changers, 4th and 5th axes are just a few of the advances we are currently seeing as people push the boundaries.

We can expect improvements in speed, quality and reduction in support material as a result of better control of everything that moves in our printers - metal and molten plastic.

The cheaper and more effective control that can be achieved by 32 bit processors is certain to replace the 8 bit processors we are currently using.

The newer firmware in Klipper and Marlin will surely lead the way to better development platforms able to cater for new needs that evolve as the 3DP enters a new phase of innovation.


Comments

  1. Great thanks for this paper. I saved it as PDF too. Blogger is th right place to host such content in my opinion.

    ReplyDelete
    Replies
    1. Thanks @Shauki, writing this firmed up a few ideas in my head and gives me more calrity on what my expectations are and where to spend effort.

      Delete

Post a Comment

Popular posts from this blog

My Multibot - Initial development