Anyone tried to make a 3D Printer controller?

What are you developing?
xebbmw
Posts: 15
Joined: Tue Aug 02, 2016 3:34 am

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

Post by xebbmw » Wed Sep 27, 2017 3:15 pm

ag123 wrote:
Wed Sep 27, 2017 1:57 pm
the other thing would be that TMC2130 seemed to be designed towards a 5v system
https://www.trinamic.com/fileadmin/asse ... asheet.pdf
while L6470 it seemed would be easier to interface with 3.3v logic as it seemed to have been designed for it
http://www.st.com/en/motor-drivers/l6470.html

oh and someone has actually tried it
https://github.com/hendorog/Marlin_L6470

and found a big list of motor drivers here
http://reprap.org/wiki/Stepper_motor_driver
:)
I do not checked exactly the datasheet for TMC2130, I now see that power supply should be 5V. But I do not see this a problem, on the shield you just build a 5V power supply that you provide to TMC2130 (5V is needed to drive an LCD). Anyway level 1 logic is 3.3V so I do not think would be a problem to connect the stepper drivers SPI entries to STM32 micro controller.

I read somewhere that L6470 chip driver does not have signals as STEP and DIR which are used currently by Marlin so I think driving them would require some logic change inside the firmware. Could be that I am wrong.

I am in the process of designing a shield for Arduino Due based on https://github.com/dvjcodec/Due3dom-Mini. It will have 5 stepper drivers, 3 fans, 2 Mosfets for hotend and 1 Mosfet for heat bed.

@victor_pv: do you think it would be possible to have a bluepill board driving TMC2130 SPI stepper drivers? Is it possible from the hardware point of view?

User avatar
spon!
Posts: 3
Joined: Fri Sep 02, 2016 7:00 pm

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

Post by spon! » Wed Sep 27, 2017 3:52 pm

ag123 wrote:
Wed Sep 27, 2017 1:09 pm
...then we can probably run a 3d printer with 3 motors (X, Y, Z) and 2 extruders (i.e. 2 colors filaments simultaneously) on just a blue pill or maple mini
:lol:
Hi there! That's what I'm doing! :lol:
I've been reading this thread and thinking that maybe we can use a low cost board holding a blue pill for the most common 3d printers (mendel 90, prusa i3, kossel delta, etc), so I made a little board with 4 stepper drivers, 3 mosfets and 2 thermistors, based on the SinapTec board (http://reprap.org/wiki/SinapTec). The goal for the board is to be DIY-able and very low cost. You can see it here: https://github.com/pscrespo/Morpheus-STM32 .
What are your thoughts about it?

(non-native english speaker, I apologize in advance for any writing mistakes)
Attachments
board.png
board.png (86.83 KiB) Viewed 238 times
morpheus.png
morpheus.png (29.35 KiB) Viewed 238 times

User avatar
RogerClark
Posts: 7448
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Post by RogerClark » Wed Sep 27, 2017 9:17 pm

@spon!

Very nice board..

I am using the Blue Pill in my PCB designed in a similar way, but not for 3d printing.

One thing I noticed about your PCB design. You do not use the top copper very much, i.e. only a few red colour tracks

AFIK, if you are using a 2 layer board, it is normal to use the bottom layer for ground, and top layer for signals and supply voltages.
( some parts of the ground layer also have to carry signals or power in some places, but the majority is often GND)

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

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

Post by ag123 » Wed Sep 27, 2017 10:14 pm

@spon!
wow, it is a good project/board :D
i guess stm32duino is really 'going places' , we once thought making a $10 o-scope is pretty ambitious
viewtopic.php?t=107
now blue pill or maple mini runs 3d printers, and all that in 20k sram 128k flash :lol:

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

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

Post by victor_pv » Thu Sep 28, 2017 3:42 am

Spon I just submitted the first running version of stm32duino HAL for Marlin to the official 2.0 bugfix branch. You can check it out if you want to start testing code in that board.
There is a board defined as STMF1R, with pins set for an RET MCU. You can change it to use your pins, it's in a folder within the config examples folder.

I noticed you don't have any connector for a display or an SDcard. SDCard should work already in the HAL (although I haven't had time to test it yet).
The LCD is not tested at all.
Thermistors and bed/extruder i/o not tested yet.

Do you plan on having LCD and/or SD?

I am testing steppers at the moment, it outputs the pulses, but not sure if at the right frequency, I need to compare to a working board.
Other than what Roger suggested looks like a nice board.

User avatar
RogerClark
Posts: 7448
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Post by RogerClark » Thu Sep 28, 2017 4:00 am

Victor can you post a link to your submission

Re: SD Card holder.

I wonder if that should be one of those modules you can get on eBay / AliExpress

e.g something like

http://www.ebay.com/itm/SD-Reader-Modul ... 2888618388

or

http://www.ebay.com/itm/Micro-SD-Card-M ... 1710341617

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

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

Post by victor_pv » Thu Sep 28, 2017 4:02 am

xebbmw wrote:
Wed Sep 27, 2017 3:15 pm

@victor_pv: do you think it would be possible to have a bluepill board driving TMC2130 SPI stepper drivers? Is it possible from the hardware point of view?
It should be completely possible. Is there a driver out for them for arduino spi? (without direct hw register acces like I have seen in some Trinamic drivers).
EDIT: It seems that the TMC2130 still needs step/dir pins even with using SPI though. The TMC5130 or the L6470 seem more advanced in that they can be just sent a target position via SPI and they will take care of moving the motor the needed steps, with the acceleration/deceleration profile programmed. So a few bytes in SPI in a row can replace hundreds of timed steps in the step pin. That seems like a major CPU offload.

About the L6470 if I remember right they do have step, dir and en pins, but can also be driven completely with SPI.
But even the STM 3d printer board uses step and dir pins to drive them.
What I believe they lack is the current adjustment Vref, and that has to be adjusted with SPI.
Check the datasheet to confirm.

I have Marlin mostly working in an RET board. Can run print jobs from start to end, but haven't plugged to a printer. In the meanwhile I am testing different things with the debugger and logic analyzer.
I plan to connect thermistors, heater and steppers thru a RAMPs board whenever I had time.
My libmaple HAL just got merged to Marlin 2.0bugfix branch so other people can use or collaborate with the HAL development.

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

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

Post by victor_pv » Thu Sep 28, 2017 4:10 am

Roger I just merged in the Marlin official 2.0 bugfix branch, where all the 32bits development is going on:
https://github.com/MarlinFirmware/Marli ... gfix-2.0.x

I keep a fork, but my plan is to submit back to that branch as soon as I make changes that I confirm work fine.
For the marlin SDCard I use SPI1 (could be changed in the HAL though), so any SDCard adapter should work, even the ones without all the DAT lines.
The LCDs are a pain in the ass since some of them use software SPI, due to a LCD chip HW bug that causes them to corrupt even with CS is high for the display if the spi port is used for something else. But since the F1 has at least 2 SPI ports, should be possible to rewrite those drivers to use SPI2 instead.

There is some effort going on in Marlin to abstract all that out to the HALs, so eventually the software SPI should go out of the display driver files, but it's there at the moment.

User avatar
RogerClark
Posts: 7448
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Post by RogerClark » Thu Sep 28, 2017 5:48 am

@Victor

Thanks.

Is your version for F4 or F1 (or agnostic ?) I noticed the official repo mentions F401

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

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

Post by xebbmw » Thu Sep 28, 2017 10:38 am

victor_pv wrote:
Thu Sep 28, 2017 4:02 am
It should be completely possible. Is there a driver out for them for arduino spi? (without direct hw register acces like I have seen in some Trinamic drivers).
EDIT: It seems that the TMC2130 still needs step/dir pins even with using SPI though. The TMC5130 or the L6470 seem more advanced in that they can be just sent a target position via SPI and they will take care of moving the motor the needed steps, with the acceleration/deceleration profile programmed. So a few bytes in SPI in a row can replace hundreds of timed steps in the step pin. That seems like a major CPU offload.
I mentioned already in a previous post another Marlin fork that was enhanced for TMC2130. I repost the link https://github.com/teemuatlut/Marlin

Post Reply