Anyone tried to make a 3D Printer controller?

What are you developing?
victor_pv
Posts: 1793
Joined: Mon Apr 27, 2015 12:12 pm

Re: Anyone tried to make a 3D Printer controller?

Post by victor_pv » Fri Aug 04, 2017 8:16 pm

Seems like the latest updates on that fork are from 11 months ago or so, so hopefully is not too far behind the official smoothieware.
I have one of hose mks sbase boards, got it really cheap with tft32 in ebay (for the price of the tft32). I dont know if I will try to use, at the moment my efforts are going to Marlin, which has recently started getting officially ported to multiple 32 bit architectures, so if we can get stm32 running in the first official 2.0 release, it should be much easier to maintain compatible going forward.

ChrisMicro
Posts: 316
Joined: Fri Mar 24, 2017 4:51 pm
Location: Germany

Re: Anyone tried to make a 3D Printer controller?

Post by ChrisMicro » Tue Aug 22, 2017 2:04 pm

This 3D-printer has a STM32F070.

victor_pv
Posts: 1793
Joined: Mon Apr 27, 2015 12:12 pm

Re: Anyone tried to make a 3D Printer controller?

Post by victor_pv » Tue Aug 22, 2017 2:16 pm

ChrisMicro wrote:
Tue Aug 22, 2017 2:04 pm
This 3D-printer has a STM32F070.
There is a few boards now with STM32, but all closed source. I think monoprice has another one with an F103, and then there is the MKS ROBIN. But they won't even release the schematic :(
I'm starting to design my own with to plug to one of the mini F4 boards.

ag123
Posts: 827
Joined: Thu Jul 21, 2016 4:24 pm

Re: Anyone tried to make a 3D Printer controller?

Post by ag123 » Tue Aug 22, 2017 4:05 pm

my guess it seemed that some 'low end' 3d printer controllers are basically 'dumb' controllers that takes g-codes as inputs and simply execute them
http://reprap.org/wiki/G-code
https://www.simplify3d.com/support/arti ... -tutorial/

however, firmware like marlin is evolving and is getting pretty sophisticated
https://github.com/ErikZalm/Marlin
Look-ahead:

Marlin has look-ahead. While sprinter has to break and re-accelerate at each corner, lookahead will only decelerate and accelerate to a velocity, so that the change in vectorial velocity magnitude is less than the xy_jerk_velocity. This is only possible, if some future moves are already processed, hence the name. It leads to less over-deposition at corners, especially at flat angles.

Arc support:

Slic3r can find curves that, although broken into segments, were ment to describe an arc. Marlin is able to print those arcs. The advantage is the firmware can choose the resolution, and can perform the arc with nearly constant velocity, resulting in a nice finish. Also, less serial communication is needed.
Temperature Oversampling:

To reduce noise and make the PID-differential term more useful, 16 ADC conversion results are averaged.
AutoTemp:

If your gcode contains a wide spread of extruder velocities, or you realtime change the building speed, the temperature should be changed accordingly. Usually, higher speed requires higher temperature. This can now be performed by the AutoTemp function By calling M109 S B F you enter the autotemp mode.

You can leave it by calling M109 without any F. If active, the maximal extruder stepper rate of all buffered moves will be calculated, and named "maxerate" [steps/sec]. The wanted temperature then will be set to t=tempmin+factor*maxerate, while being limited between tempmin and tempmax. If the target temperature is set manually or by gcode to a value less then tempmin, it will be kept without change. Ideally, your gcode can be completely free of temperature controls, apart from a M109 S T F in the start.gcode, and a M109 S0 in the end.gcode.
https://github.com/MarlinFirmware/Marlin
http://www.stm32duino.com/viewtopic.php?f=19&t=2262

some of the sophistication may involve more elaborate features and algorithms such as look ahead, 'auto temp' (i.e. varies with feedrate) pid temp control etc. my guess is for the more 'sram constrained' and possibly 'slower' mcus, it may be necessary to 'give up' on some of the elaborate algorithms, e.g. look ahead + auto temp may consume precious sram and for what is worth for some of the calcs floating point maths may actually help with 'smoother' prints, not to mention popular feature creep such as an LCD gui , printing direct from SD card files and maybe even ethernet + web server status / control page) could possibly consume a lot of *ram*.

thoughts then are that given the rather 'high' demands (in particular on memory), using a 'larger' and faster mcus e.g. stm32f407 with 196k srram and runs at 168mhz with 2x single precision fpu would perhaps allow room to build marlin firmware with more of those memory and cpu hungry sophisticated algorithms to be enabled for the build, this could potentially result in a much better 3d printer control vs one that is 'dumb' due to memory constraints or speed limitations such as no fpu

just 2 cents

on a side note, it also seemed that some of commercial stm32 based controllers are basically ported or derived from marlin and as it seemed they did not release the source despite deriving it from marlin firmware
https://www.geeetech.com/forum/viewtopi ... 02fd036f73
http://www.geeetech.com/forum/viewtopic.php?t=17173

ag123
Posts: 827
Joined: Thu Jul 21, 2016 4:24 pm

Re: Anyone tried to make a 3D Printer controller?

Post by ag123 » Wed Aug 23, 2017 12:57 pm

victor_pv wrote:
Tue Aug 22, 2017 2:16 pm
ChrisMicro wrote:
Tue Aug 22, 2017 2:04 pm
This 3D-printer has a STM32F070.
There is a few boards now with STM32, but all closed source. I think monoprice has another one with an F103, and then there is the MKS ROBIN. But they won't even release the schematic :(
I'm starting to design my own with to plug to one of the mini F4 boards.
on the other hand i'd think using things like RAMPS
https://www.ebay.com/sch/i.html?_from=R ... nt&_sop=12
http://www.ebay.com/itm/3D-Printer-Cont ... 0699832639
http://reprap.org/wiki/RAMPS_1.4
is still pretty feasible, just that for the 5v RAMPS some hacks may be needed e.g. additional transistors to drive the MOSFETs etc

then there is the rather expensive RAMPS-FD which uses 3.3v FETS but is perhaps easier to interface with stm32
https://www.ebay.com/sch/i.html?_odkw=r ... t&_sacat=0

the good thing about the RAMPS approach is those RAMPS boards are somewhat cost effective and that you could mix and match different stm32 boards, the interfacing connectors can always be hooked up via 'dupont' wires

alce
Posts: 6
Joined: Sun Jul 30, 2017 8:30 am

Re: Anyone tried to make a 3D Printer controller?

Post by alce » Fri Aug 25, 2017 8:20 pm

Ok, short update on my stm32f446re plan.
I got the ramps 1.4 board and it turned out the arduino connector on nucleo board does not populate all the necessary pins so I ended up having to add about 20 dupont cables.
The wiring I did turned out pretty neat so not much of a deal breaker for me. I got all motors working, 3 endstops, fet. I ended up grouping all the motor en pins together just to make my life little bit easier.
I switched SD card to 1 bit SDIO mode which boosted write speed to ~1mb/s from 200kb/s SPI. Smoothieware uses some uip lib to do tcp/ip in software and since W5500 does it in hw it occurred to me
that it would be faster for me just to boot the whole network module and do a very simple telnet and sftp myself. Which I did and it takes about 80 seconds to transfer 4MB gcode file which I suppose is not bad but I think switching W5500 to SPI DMA should at least triple transfer speed.
I dont think I'll bother with any kind of web ui since it seems like a quite a bit of work. The way I would probably go about it though would be to export gcode interface to javascript(something like ajax) and then do all the interactive stuff in js.
BTW, if marlin folks need a basis for network code you could use this one. It is about 1K of code for both sftp and telnet using the wiznet libs. I think the telnet could also be used as an display replacement. Think github.com/hanzi/telnetris

Now unfortunately my nucleo board started acting weird(rebooting when transferring files via sftp) yesterday and today it stopped working altogether so I did not get to print tests quite yet. Suspecting ESD damage...
Fortunately arrow.com sells NUCLEO-F446RE for about 15 usd w/ free DHL shipping so I should get to it next week.

ag123
Posts: 827
Joined: Thu Jul 21, 2016 4:24 pm

Re: Anyone tried to make a 3D Printer controller?

Post by ag123 » Sat Aug 26, 2017 2:05 am

+1 :)
have been caught up with 'real life' recently, having no time to play with these things. But 1 of those things i'd like to do is to pair up one of those stm32f407 boards (e.g. stm32f407 black) with a RAMPS or RAMPS-FD board and have Marlin running on it. it'd probably seem like an overkill given that arduino mega has a mere 8k of sram 128k flash
https://www.arduino.cc/en/Main/arduinoBoardMega
while stm32f407 has a whopping 196k sram and 512k - 1m flash
but that'd pave the way towards programming more functionality into the controller e.g. turning on more optimizations like those mentioned above turning on fpu and use floating point calcs etc, in addition, we can even build in the host software in which a popular one is octoprint (we can literally build in a 'tiny octoprint)
we could even enhance say slic3r to use more of the feature sets that's made available on an stm32f4* based board

i'd think one of the fastest way to get into 3d printing is to get one of those 'cheap' 3d printer kits on ebay, aliexpress, from china etc which are basically clones of prusa i3 or some delta 3d printers. they seem to run in the range of usd $200-300 for the 'basic' ones (there are even some that goes for below usd $200). that'd allow one to first have a 3d printer use them with the original controller and later swap that controller for a stm32 based controller

in principle it is possible for one to build a 3d printer from scratch, as after all reprap is intended to be a 3d printer that 'prints itself', it seemed these days, you could buy just about every part for those prusa i3 clones & delta 3d printers on ebay/aliexpress, some of them can be sourced locally if you have local manufacturers who stock hardware like rods, aluminium rails, linear bearings, belts, pulleys etc. however, i actually found that the 'sum of the parts' by buying them on ebay actually cost more than if you simply buy a kit. in addition, to make all parts to those exact precision of lengths etc is no simple task. hence the point of starting with a cost effective kit and later swap the controller

but for those who are determined enough to build a 3d printer from scratch, in addition to the conventional 'prusa i3' or delta 3d designs, you could build one from the core-xy design.
http://corexy.com/theory.html
http://corexy.com/implementation.html < look at that very good pcb milling video
https://www.youtube.com/watch?v=FP2ciUBT6nY
you could use nylon fishing lines to run the core xy, the only thing u'd need to build or get in addition is the z-axis if you simply have just a planer core xy

xebbmw
Posts: 15
Joined: Tue Aug 02, 2016 3:34 am

Re: Anyone tried to make a 3D Printer controller?

Post by xebbmw » Thu Aug 31, 2017 4:02 pm

alce wrote:
Fri Aug 25, 2017 8:20 pm
Ok, short update on my stm32f446re plan.
I got the ramps 1.4 board and it turned out the arduino connector on nucleo board does not populate all the necessary pins so I ended up having to add about 20 dupont cables.
The wiring I did turned out pretty neat so not much of a deal breaker for me. I got all motors working, 3 endstops, fet. I ended up grouping all the motor en pins together just to make my life little bit easier.
I switched SD card to 1 bit SDIO mode which boosted write speed to ~1mb/s from 200kb/s SPI. Smoothieware uses some uip lib to do tcp/ip in software and since W5500 does it in hw it occurred to me
that it would be faster for me just to boot the whole network module and do a very simple telnet and sftp myself. Which I did and it takes about 80 seconds to transfer 4MB gcode file which I suppose is not bad but I think switching W5500 to SPI DMA should at least triple transfer speed.
I dont think I'll bother with any kind of web ui since it seems like a quite a bit of work. The way I would probably go about it though would be to export gcode interface to javascript(something like ajax) and then do all the interactive stuff in js.
BTW, if marlin folks need a basis for network code you could use this one. It is about 1K of code for both sftp and telnet using the wiznet libs. I think the telnet could also be used as an display replacement. Think github.com/hanzi/telnetris

Now unfortunately my nucleo board started acting weird(rebooting when transferring files via sftp) yesterday and today it stopped working altogether so I did not get to print tests quite yet. Suspecting ESD damage...
Fortunately arrow.com sells NUCLEO-F446RE for about 15 usd w/ free DHL shipping so I should get to it next week.
Did you publish somewhere your changes? It becomes interesting ...
On Smoothieware forum it seems the developers are working more on new Smothieware 2 (at least this is my conclusion from http://forum.smoothieware.org/forum/t-2 ... 32-support)

xebbmw
Posts: 15
Joined: Tue Aug 02, 2016 3:34 am

Re: Anyone tried to make a 3D Printer controller?

Post by xebbmw » Fri Sep 08, 2017 4:27 pm

There is also another implementation of smoothieware for STM32F4 MCU at https://github.com/wolfmanjm/wolf3dware. This is using an RTOS (FreeRTOS) but I am not sure at what stage is it and how it works.

And according to the author there is no benefit on having a MCU with FPU for Smoothieware: https://plus.google.com/+StephanieS3D/posts/8WXjn82rq2X

Scientist
Posts: 2
Joined: Sat Sep 09, 2017 8:33 pm

Re: Anyone tried to make a 3D Printer controller?

Post by Scientist » Sat Sep 09, 2017 11:35 pm

This earlier Post <http://www.stm32duino.com/viewtopic.php ... 926#p17926> mentioned already the 32bit-Teacup-Port <https://github.com/Traumflug/Teacup_Fir ... /stm32f4xx> (F411, LPC1114). While there is already a Blue Pill running grbl <https://github.com/MoonCactus/grbl-STM32F103> and hints from teacup-autor for migration "...tag arm-port-starts-here in the repository; the following commits show how to port to an ARM platform step by step." i am wondering, if its worth, joining code-snippets to get a firmware-codebase without much overhead or adapting the slim Teacup for the F103C8T6 (BluePill).

Post Reply