Jump to content
Ultimaker Community of 3D Printing Experts

Recommended Posts

As some of you may know, I'm working on a big step forward in 3D printer electronics. Today I'm releasing the first piece of the cake: The printhead controller!

https://www.youmagine.com/designs/printhead-controller

Note that this design is not finished yet, but it is at a state where I want to go public and get you guys involved.

So... What does it do, and why?

Simply put - I'm outsourcing the printhead functions (temperature, heater and fan control) directly into the printhead, where they belong. The electronics mainboard will only have to send commands to the printhead like "put the nozzle temperature to 210°C, and set fan speed to 50%", instead of having to compute and control these functions by itself. The mainboard can then concentrate on other tasks, and leave the printhead to itself.

This becomes especially interesting when you want to control 5 printheads, or if you have a modular printer which may have even more than 5 different toolheads.

As another goodie - the amount of wiring between mainboard and printhead is reduced to 5 wires (or even 4 if you use a 12V heater cartridge). And, more importantly, the noise on this wiring is reduced. There is no more sensitive temperature signal going all the way in parallel to the motor and fan wiring, reducing signal noise and increasing temperature sensing accuracy.

-- have to get back to work, will continue this soon --

/edit: Accidentally deleted the topic o.O

  • Like 4

Share this post


Link to post
Share on other sites

Update:

Added some wiring options (Wiring.pdf in the document sections).

Some more info about how to use this printhead controller:

It is an I2C slave device, meaning that any microcontroller (e.g. a RepRap electronics platform) that can act as an I2C master device - and has the SCL and SDA pins available - can connect and use it.

Thanks to the I2C architecture, multiple printhead controllers can be connected using only these two pins.

I will publish the full list of available I2C commands once it's ready.

As I said, I'm not planning on writing any code for Marlin platforms. Why? I don't know Marlin (and Arduino, if that matters) and the MCU behind it well-enough to be able to do that without a significant effort.

Let's talk about a few more details on the controller itself:

The key concept is to keep the physical size, functionality, and cost to a minimum. This is why I don't want to add more PWM channels, or support lots of different temperature sensor types.

I'm using industry standard PT1000 RTD sensors. These are more expensive (around 2$) than the 100k NTCs we all know, but are much more reliable, accurate, and have a higher temperature range.

Reading a PT1000 is a bit more difficult than an NTC. The necessary circuit is built-in on the printhead controller. It provides a precise 1 mA current source. This current flows through the PT1000, which has a resistance of 1k Ohms at 25°C. 1 mA over 1 k Ohms equals 1 V, which is measured by the A/D converter and interpreted as "25°C". The resistance - and therefore the voltage and the A/D reading - changes with temperature.

The printhead controller has basically nothing to do other than react to the I2C commands, set up a PWM module for fan speed (which will then run by itself in the background), and control the heater. That means a much better heater regulation which is a welcome improvement.

If the heater control is located inside the printhead, it means that three important weak spots of current RepRap printers are eliminated:

- long temperature sensor wiring

- long, EMI-heavy heater and fan PWM wiring

- heater failures due to locked up mainboards, interference on the sensor wire or broken wiring

Of course, the temperature information needs to be forwarded to the mainboard. The mainboard can read any information, such as target temperature, current temperature, fan PWM speed and so on from the I2C interface at any time.

So..... One more thing. You may wonder what the "Switch" in the schematics is for. It's basically the same circuit as the heater output, except a weaker mosfet is used. The function can be used to switch low-power components, such as a printhead LED, another fan, or an electromagnet (related to a feature of the upcoming Nemesis 3D printer).

Edited by Guest

Share this post


Link to post
Share on other sites

Hi Jonny, it's been a long time!

This is a very cool idea. Couple comments/suggestions....

- I know you are short on pins but it would be awesome to have the one fan output switchable so if you have something like the E3D type, you can turn off the head fan.

- I was working on a Z probe, this would require two more pins, one for the servo PWM and the other for the probe.

You mentioned Marlin, I would think this could be integrated into it assuming that the I2C pins are available and I2C can run concurrently with Marlin's primary interrupt routine. Two things I'm not sure about!

Share this post


Link to post
Share on other sites

Hi anon, nice to hear from you, too!

Actually I have some pins left, because the three address pins won't be needed, instead I'll solve the address problem in software.

The actual problem is the space needed for wire connections. As it usually happens with my first prototypes - the pads / holes for mounting wires are MUCH too small, especially the power input pads. I really want to keep this thing as small as possible, which is why I need to keep the features at a minimum, too.

If you don't need the Switch output for anything else, you can connect a fan there and manually switch it on and off.

The Switch output can be used with 24V or 12V - by simply using one or the other V+ pad. This is not clear in the schematics yet, but I'm writing the complete User's Guide these days.

The Printhead Controller must be reflow-soldered. There's some really small components, such as the QFN-16 PIC microcontroller and the power mosfet (Q20).

On top of that, the user will have to do some manual solderwork connecting all the wires. Connectors take up a lot of space, and you have to get the connectors on the wires as well which can be much more troublesome than simply soldering them onto the PCB directly.

Once the project is ready for it, I'll ask around if there's some reprap distributor who wants to produce these. I'm pretty sure someone's going to be interested ;)

I'm going to make a few myself, but have no plans on selling them in larger quantities.

I do actually want to integrate some more features. The most important one would be a means to measure filament flow. This could be either a simple switch that tells you whether or not there is filament in the extruder, or an actual quadrature encoder input. Most probably the latter, with the option to use a simple button on the same connection instead. I'm not sure if the MCU has enough processing power (and memory) for that, but that's what I have the prototype for.

By the way - not much progress on the prototypes so far. I have a lot of work at the moment and just don't get anywhere..

I'll have a two weeks holiday soon. I'll get it done then.

Share this post


Link to post
Share on other sites

Well, I just don't get anywhere these days...

I am working on the mechanical protype:

20160121234736.thumb.jpg.62964d1aa588699668a1a2c5f728d0fa.jpg

And I've redone the electronics like 1000 times, but actually completing them will take at least another half year. For now, I will be using a smoothieboard to power my new printer. I will first need to build a CNC router in order to be able to manufacture good parts for the next prototype, and THEN I can think about multi-head and custom electronics to make it into reality...

You can get pretty much any PT1000 sensor (or PT100, if you prefer, and make your measurement circuit accordingly...)

I'm currently working with the mouser P/N 956-32207704. Thinking about glueing them to the surface and sealing them with silicone. But that is not an ideal solution just yet... Encapsulated sensors are of course better, but they cost 10 times as much as that small one :(

20160121234736.thumb.jpg.62964d1aa588699668a1a2c5f728d0fa.jpg

Edited by Guest

Share this post


Link to post
Share on other sites

Well, I just don't get anywhere these days...

I am working on the mechanical protype:

20160121234736.thumb.jpg.62964d1aa588699668a1a2c5f728d0fa.jpg

And I've redone the electronics like 1000 times, but actually completing them will take at least another half year. For now, I will be using a smoothieboard to power my new printer. I will first need to build a CNC router in order to be able to manufacture good parts for the next prototype, and THEN I can think about multi-head and custom electronics to make it into reality...

You can get pretty much any PT1000 sensor (or PT100, if you prefer, and make your measurement circuit accordingly...)

I'm currently working with the mouser P/N 956-32207704. Thinking about glueing them to the surface and sealing them with silicone. But that is not an ideal solution just yet... Encapsulated sensors are of course better, but they cost 10 times as much as that small one :(

 

Oh, OK... you are looking at the thin film type. I was searching for one encased like the UM1 thermocouple. Haven't found one of the right size. And yeah, they are like 30-40USD.

I was eyeing the thin film ones too. I'm thinking about either using a brass strip with screws tapped into the heater block to hold it or slitting the block and then have a single tapped hole that can squeeze enough to hold the sensor. Sort of like the way E3D holds the heater.

The nice thing about the thin film ones is they have almost no thermal mass so the response time is much better.

I'm also considering something like this:

https://datasheets.maximintegrated.com/en/ds/MAX31865.pdf

Accuracy is very high. The chip itself is like 0.5C (0.05% of Full Scale) so it would be reasonable to say the whole thing should be accurate to +- 1C.

A little expensive at $4 USD plus a precision resistor but I don't have your electronics experience to build a decent constant current source. So a single chip+resistor is less for me to screw up.

I saw your metal frame version of a printer in another thread. Dude, your prototype is a tank! Do you think you need to go to that level for better printing or are you going to do something else with it like milling and/or PCBs?

Share this post


Link to post
Share on other sites

...

I'm also considering something like this:

https://datasheets.maximintegrated.com/en/ds/MAX31865.pdf

Accuracy is very high.   The chip itself is like 0.5C (0.05% of Full Scale) so it would be reasonable to say the whole thing should be accurate to +- 1C.

...

 

LOL, guess what:

screen.thumb.jpg.6e7bc6c2978c76b299d5fb0ec29baaf8.jpg

I've developed the printhead controller a lot further from what I've shown initially. It now has a TMC2100 and that RTD converter and a Cortex M0 onboard, so it can basically control the whole printhead (wow, it does what the name suggests...).

I'm not done with the design yet, and it keeps evolving on paper so I wanna let more ideas go into it before finishing the design.

 

...

I saw your metal frame version of a printer in another thread.   Dude, your prototype is a tank!   Do you think you need to go to that level for better printing or are you going to do something else with it like milling and/or PCBs?

 

Well, what can I say... I just like tanks :D

It will be a pure 3D printer, and I want it to be sturdy as a tank so that it swallows up any vibrations or rattling. The current prototype is not ideal though because aluminum just sucks for building machines. It makes the moving parts so much more noisy than they already are because of it's resonance properties.

I'll build a CNC router and make some better frame parts from HPL / Trespa. Then we can talk about tanks again :D

screen.thumb.jpg.6e7bc6c2978c76b299d5fb0ec29baaf8.jpg

Edited by Guest

Share this post


Link to post
Share on other sites

LOL, well at least my research was good enough to arrive at the same conclusion you did.

Cortex M0 is a lot of power for controlling the printhead...

Two questions:

(Edit: please ignore the first question! Misread the datasheet!) Why a 4.02K instead of 1K per the datasheet?

What is the purpose of the 470 ohm resistor on the analog supply?

Edited by Guest

Share this post


Link to post
Share on other sites

This is a ferrite bead, not a resistor. For the DC supply, it has a very low resistance (around 0.01 Ohms iirc), but it filters out any AC noise that might be on the supply line. 470 Ohms is the impedance at 100kHz.

The M0 has some advantages over some 8bit MCU. First of all, it's not really more expensive than an 8bit MCU. But it has better programming support (code libraries from suppliers, and better IDE) and it supports multiple communications interfaces, which is usually not found on the smaller 8bit MCUs. 8bit is dead...

Share this post


Link to post
Share on other sites

Ahhh, that makes perfect sense with what I have been reading about mixed digital and analog supplies.

The SAMD21 Cortex M0 isn't that expensive and seems to be a pretty good MCU. But I have to bother you with more stupid questions...

Most of the eval boards and the Arduino Zero are using a 32.768khz crystal so I figure I will do the same.

 

I'm having difficult understanding the datasheet and the various ways of calculating the load capacitance.

 

The datasheet:

http://www.atmel.com/images/atmel-42181-sam-d21_datasheet.pdf

page 1093 states these characteristics:

Cl - 12.5 pf max

Cshunt - 0.1pf typ.

Cxin32 parasitic load - 3.1 pf typ

Cxout32 parasitic load - 3.2 pf typ

Crystal ESR (Cl - 12.5pf) - 141kohm max

 

On page 1089, the datasheet gives the method to calculate the external load cap (Clext)

Clext = 2(Cl - Cstray - CShunt)

where based on the figure on page 1092, Cshunt is the crystal's internal shunt capacitance and Cstray is the cap between the Xin and Xout pins.

 

Seems simple enough but here are my questions:

 

Why does the datasheet show a Cshunt typical value if it is a function of the crystal? Is this the recommended value to target when selecting the crystal? Or is this an internal shunt value that isn't represented in the formula because it's so small?

 

What are the value of the Cxin32/Cxout32 parasitic load cap used for? Are they the internal cap (to ground) of the pins? Should they figure into the calculation of Clext?

Or is there some rule of thumb people use to determine the value of the load caps like if the crystal requires X load, use two Y caps and they ignore the various other capacitance?

I did find this which is the Arduino Zero that was apparently designed by ATMEL.

https://www.adafruit.com/images/product-files/2843/Arduino-Zero-schematic.pdf

They derived the values as :

Calculation of crystal load capacitors:

Cext = 2x ( Ccrystal - Cpara - Cpcb )

Ccrystal = 7.0pF (from crystal datasheet)

Cpara = 3.15pF (from MCU datasheet)

Cpcb = 0.5pF (estimate)

Cext = 2x(7.0pF - 3.15pF - 0.5pF) = 6.7pF

But I can't find Cpara on the datasheet unless they took the average of Cxin32 and Cxout32 parasitic capacitance.

Maybe these values aren't super critical?

Share this post


Link to post
Share on other sites

I'm not using Atmel chips - they're expensive and I have some kind of personal aversion against them :p

The 32.768 kHz crystal (commonly referred to as the "real time clock crystal" or "tuning fork") is very useful if you need any kind of precise timing. 32768 is 2^15, so you can make a timer that counts seconds very precisely.

Many MCUs have an internal "low frequency oscillator" which can be used for that purpose, but their accuracy is very low. Usually good enough for timings like "wait for the LCD to be initialised", but definitely not useful for counting time.

About the capacitances:

I don't know why Atmel bothered making a difference between Cxin32 and Cxout32. That makes no sense because no one will use two different caps there. Manufacturing costs...

These oscillator driving circuits usually work the same for most MCUs. You have a "rather" high frequency signal, so circuit impedance is important. You have to match your crystal's impedance to the input impedance of the driver, in order to get them to work together reliably.

If you don't, it will either not work at all, or at a shifted frequency, or it might stop or stutter at times. Or it might run fine, but draw more power than it should.

I said "rather", because 32kHz isn't really a high frequency. These clocks usually work without problems, but you need to match the impedance closely if you want the timing to be precise.

Either way, the MCU's datasheet should tell you how to connect it (Some do that better than others). The most common external circuit is a crystal with a capacitor to GND on both pins (I'm not using the correct terms like "shunt", "parallel" or so because I always mess them up.. o.O).

You got the correct formula for deriving these capacitors. Cpara is the MCU driver's parasitic capacitance. They used the average value from Cxin32 and Cxout32, which makes sense.

Cshunt is a property of the crystal, but many parts don't specify Cshunt (I don't know why, and I only buy the ones that are fully specified...). This is probably why Atmel gives you a typical value.

I suggest looking for a crystal that has Cshunt specified, and use that value.

Cpara (Cxin32 and Cxout32) are the parasitic capacitances of the pins. As I mentioned above, you want to match the circuits' impedances. The (parasitic) capacitances are part of the impedance calculation. There's also parasitic resistances and inductances, but by keeping trace lengths very short you can ignore these.

CLext (external load capacitors) are the actual components, derived from all the capacitances in the circuit that you'll be using to match the impedances. "Every" parameter ultimately figures into this CLext, because these are the only components that you'll be using to match your selected crystal to the driver.

There may be rules of thumb, but the calculation is really not that difficult once you dig through all the names and can connect the crystal's and MCU's datasheets together.

I wouldn't generally say that the values aren't critical. It depends on the crystal, it's frequency, and most of all, the driver. Usually, 32kHz crystals are quite uncritical, unless you really get the load caps way off. But with high frequency oscillators this can become critical really fast.

Ultimately, the most important thing is to select a crystal that goes well with your MCU.

I preferrably use one of these:

Abracon ABS07-32.768KHZ-7-T (very small package)

Abracon AB26TRQ-32.768kHz-T (This is Abracon's derivative of the "popular standard" Micro Crystal MS3V-T1R)

Mouser typically has these in stock.

Share this post


Link to post
Share on other sites

Jonny,

Thanks for taking the time to reply with such great information. I'll have to read it a couple times until I understand it!

I'm looking at the ATMEL part just because it is the same part in the Arduino Zero so I have a reference for both the electronics as well as the bootloader.

It's less then $2 USD so for one offs, it's reasonable.

I really wish I had stayed with the hardware/electronics side of my schooling. So much more interesting than software.

Thanks again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • Our picks

    • Architect Design Contest | Vehicles.
      We're open for entries! - Design and submit your 3D designs of architectural entourage - vehicles - for a chance to win a large filament pack. Presenting an idea, an architectural design or something as big as an urban project isn't easy. A scaled model can really help to get your idea across.
        • Like
      • 24 replies
    • What The DfAM?
      I'm Steve Cox, an experienced engineer familiar with 3D printing. I wanted to share some DfAM guidelines with this community to help and make stronger parts.
      I'm also an Autodesk Certified Instructor for Fusion 360, so many of the images in ...
        • Thanks
        • Like
      • 23 replies
×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!