MachineKit on Snickerdoodle?

471 views
Skip to first unread message

Cameron McQuinn

unread,
Apr 15, 2017, 5:32:31 PM4/15/17
to snickerdoodle forum

Hi all,

I am interested in building a 3d printer controlled by a Snickerdoodle running MachineKit (machinekit.io). I have been doing lots of google searching to try and find any information about running MachineKit on this sort of hardware and have discovered that MachineKit has code for supporting Zynq-based platforms (https://github.com/machinekit/mksocfpga) and that others have successfully gotten MachineKit running on Z-turn boards. Has anyone here been able to get MachineKit running on a Snickerdoodle? It may be I bit early in the game to be asking, because the Snickerdoodle is such a new board, but I figured there's no harm in asking.

Thanks,
Cameron

magni...@gmail.com

unread,
Apr 17, 2017, 9:26:10 AM4/17/17
to snickerdoodle forum
Hey Cameron,

i can tell you that i successfully installed machinekit on the snickerdoodle, including the stock ubuntu (upgraded to 16.04 if im not wrong) and prempt-rt enabled kernel (custom compiled with patches). 
Then i build machinekit and that was quite smooth, problems encountered later, as i only run a breaky board i have no graphics and ran with a vnc server for graphics, so all the guis are not running without the 3d extensions. 
On the FPGA side i tried the soc hostmot from machinekit, but the build process was not nearly intuitive and i aborted it after like 2 days of tinkering.

Im not saying its not working, but you probably wanne use a pismasher or soley use the network based guis from machinekit for the controlling side.
On the FPGA side, if someone manages to port the hostmot stuff over to snickerdoodle that may help alot.

What im doing right now?
im currently still using my spartan3 coupled with SPI to an Pi2 running Machinekit (controlled over vnc) to run my 3d printer. 

Whats next?
Best would be a custom baseboard with motor drivers (i like the trinamic tmc5130a alot) and some gpio/pwm/power stuff, but im not sure if i got the money and the time free to realize it, if someone is interested im happy to assist.

Chris Rodriguez

unread,
Jun 5, 2017, 10:13:53 AM6/5/17
to snickerdoodle forum, magni...@gmail.com
Just saw this post.

I was actually interested in the same thing myself.

I actually helped a little with troubleshooting with the guy who made most of the changes for the hostmot2 to run on the Altera Nano Soc board. I also built my own version of steppers and encoders components(not full hostmot2) to run on another Zynq board. But there were quite a few architectural changes to the Soc drivers for machinekit after the Nano Soc board got running to the point now I am not sure how it all goes together now myself. Last time I worked with it, the build process was much more complicated with the changes. They have a very specific way they want it all designed, and I can understand the reasoning, just more than I wanted to deal with.

I still have it on my list to revisit when I get time.

My plan was to eventually get rid of most, if not all, of the real-time kernel portion and move all the time critical portions over to fpga(PID, etc) and move trajectory planner to a separate CPU using an OpenAMP config on 2nd CPU.

Would be open to working with folks on it if there is interest.

Thanks,
Chris

Cameron McQuinn

unread,
Jul 4, 2017, 3:57:37 PM7/4/17
to snickerdoodle forum, magni...@gmail.com, ad...@cnrconsultingllc.com
Chris and Magnifikus, thanks for the replys. I have been trying to get the Hostmot2 code from the mksocfpga repo integrated into a Vivado project for the Snickerdoodle board. So far, I am just using MesaNet's SVST4_8 configuration (see http://mesanet.com/pdf/parallel/5i24man.pdf for details) just to see if I can get something working in Vivado. I created config files for the Snickerdoodle adapted from the existing ones for the zturn board with all the "jd2_mad_logic" components removed (essentially stripping it down to just the hostmot2 stuff and the mksoc wrapper). I tried running the make_bitfile script, and it does generate a Vivado project as well as a bitstream, but opening the Vivado project reveals that all the stepgen components have been removed (along with lots of other things) due to it supposedly never being used. I'm not sure how to fix this, but at least that's a start. I can post my code if you want to have a look.

Eventually, once I figure out how to create custom Hostmot2 firmware, I want to create a configuration with 5 stepgens, and some other supporting stuff to run a 3d printer.

I have also thought about things that might be nice to have on a custom baseboard. Aside from stepper motor drivers, I think it would be nice to have MOSFETs for PWM control of the extruder and a heated bed, as well as PWM fan controllers. I realize that designing a baseboard from scratch would be a very challenging and time consuming task, so one option might be to base the design on Krtkl's BreakyBreaky board, if we can get the design files for that. As many GPIO pins as are needed would be rerouted to connect o stepper motor drivers and other circuitry, and unused pins could remain connected to the 0.1" headers.

I am only just starting to learn about how all these things work, but would love to contribute what I can to make this happen.

Thanks,
Cameron

Cousins

unread,
Jul 5, 2017, 1:17:17 PM7/5/17
to snickerdoodle forum, magni...@gmail.com, ad...@cnrconsultingllc.com
Awesome... Sounds like another project for us to 'spotlight' on the new site!

For reference, here's the breakyBreaky R4 layout: https://github.com/krtkl/open-source-layout/tree/master/breakyBreaky

-Ryan

Cameron McQuinn

unread,
Jul 8, 2017, 4:59:25 PM7/8/17
to snickerdoodle forum, magni...@gmail.com, ad...@cnrconsultingllc.com
Thanks for the link, Ryan. Would it be possible for you to post the design files in a format that can be imported into Eagle or KiCAD?

For all those interested, I posted my Snickerdoodle configuration files for mksocfpga at https://github.com/cmcquinn/mksocfpga. I edited the TCL script to work with Vivado 2017.1.

- Cameron

Cousins

unread,
Jul 8, 2017, 5:14:56 PM7/8/17
to snickerdoodle forum, magni...@gmail.com, ad...@cnrconsultingllc.com
To date all our designs have been produced using a combination of OrCAD and PADS. You can check out this other thread with some people working on the conversion from PADS V5 to Eagle/KiCAD: https://groups.google.com/d/topic/krtkl-snickerdoodle/4mL1R_Rdqao/discussion

Hope that helps...

-Ryan

magni...@gmail.com

unread,
Jul 9, 2017, 11:21:03 AM7/9/17
to snickerdoodle forum
Hello again,

so i started with hardware on this project yet again :)

1st im doing a head module for 3d printers controlled via i2c that has some mosfets and 2 pt100 sensor interfaces.
2nd im getting started again on a baseboard for stepper drivers that should be compatible to the breakyBoard. Main functionality here is power routing and isolation to protect, aswell as some io stuff. For stepper drivers i will stay with my custom trinamic tmc5130a based modules that are doing a great job on 2 machines already. 

If someone is interested in this stuff i can post it to github, its based on kicad (except my driver boards, they are done in Target3000).



Am Samstag, 15. April 2017 23:32:31 UTC+2 schrieb Cameron McQuinn:

Cameron McQuinn

unread,
Aug 1, 2017, 9:14:47 PM8/1/17
to snickerdoodle forum, magni...@gmail.com
The baseboard you are designing sounds very promising! Let me know if I can help you in any with the development.

Status update:

I finally got mksocfpga to build in a snickerdoodle-based configuration using Vivado 2015.4, although the generated project has lots of warnings that need to be resolved. All changes are available on my github (https://github.com/cmcquinn/mksocfpga).

Cameron
Message has been deleted

magni...@gmail.com

unread,
Sep 20, 2017, 4:06:00 PM9/20/17
to snickerdoodle forum
Little update:

The stepper drivers are pretty much done, specs are 1,6A RMS with 256µS and alot of extra features (Trinamic TMC5130A).
The Board is 18x45mm (you can get 8pc from an 100x100 china pcb) big and has a single bottom plane for cooling (only GND on back) and is connected with 1 and 1.27mm pitch headers to a baseboard. Configuration is done via SPI and control is done via STEP/DIR, the whole thing is designed to work at 48V.


Next up is the 5 Axis Baseboard (still searching for nice and cheap connectors for motors and io on the edge of the pcb, i wanne go away from DSUB9) aswell as an Snickerdoodle Interfaceboard.

Also whats the reason you are creating the mksocfpga project with an old version of vivado?

weath...@krtkl.com

unread,
Sep 20, 2017, 4:41:58 PM9/20/17
to snickerdoodle forum
For mixed power & I/O on a motor controller board I'd recommend MicroFit 3.0 http://www.molex.com/molex/products/family?key=microfit_30&channel=products&pageTitle=Introduction from prior design work we've done in this domain.

-Jamil

weath...@krtkl.com

unread,
Sep 20, 2017, 4:44:57 PM9/20/17
to snickerdoodle forum
For pure I/O on a motor controller board if you don't like our Samtec 0.050" Tiger Eye connectors (which is what I'd personally use) I'd recommend Molex C-Grid with the locking housings as a more traditional 0.1" pitch alternative:

https://www.digikey.com/en/product-highlight/m/molex/c-grid-iii-interconnection-system


-Jamil


On Saturday, April 15, 2017 at 2:32:31 PM UTC-7, Cameron McQuinn wrote:

magni...@gmail.com

unread,
Sep 23, 2017, 4:35:23 PM9/23/17
to snickerdoodle forum
still thinking about how to connect the snickerdoodle, either i put it straigth onto the "baseboard" or connect to the breaky board. The 2nd version would allow other controllers like a pi with an fpga also (what i use until now and that is not thaaaat bad). 

For the motor connectors the molex microfit look quite good, but for all the io im still looking for a dense and cost effective solution (they should go on the edge so you can put the thing in a case later on).

Michael Brown

unread,
Sep 27, 2017, 8:45:50 AM9/27/17
to krtkl-sni...@googlegroups.com
I have been watching this thread for some time and would like to step in with this request for your consideration:

Dear all on this thread.

I am that guy who was able to manifest the mksocfpga project and who still is very grateful for all them who mannaged to be there and step in at the exact right moments, and
facilitate, my later off handing of this new baby....   No help was to small :-)

I would like to link to something from early in the development process close to original initial thoughts to give an perspective of what the "vision" was about..


 and quote / highlight a sentence:

"It is hoped to gain traction for adding a Zync based platform simmalar to the DE0 Nano Soc, by a person with such a board and experience with the Xilinx tool's."
...
I guess this is my way of saying I am looking forward to see the snickerdoodle / snickerdoodle black Vivado based projects "land" as commits to the mksocfpga repo :-)
...
I have had a working mksocfpga 3-d printer setup that uses the (my prefered) Machinekit client and Machineface from here:


custumized configs here:
...
Recently I have been able to do the catch up thingy again and commit what is intended to be an universal ADC hm2_socfpga driver and usertemp component, that needs some improvement and also a way of figuring out a generic Intelfpga / Xilinx implementation:

Top place holder for these issues here:

...
I have had a Snickerdoodle for some time however I am not so much for wireless lan so I have been holding out for my Snickerdoodle black which hopefully will arrive soon.

However I can only build / program in Systemverilog and have allmost zero experience in figuring out the Vivado way of things.... 

What also seems to be happening is that the Machinekit arm Stretch package building is coming online...

So I recommend creating some hooks into Machinekit / mksocfpga for the krtkl.com boards starting with these considerations:

REquesting a 1 thread place for resolving adding new HM2 Mesa Soc FPGA functionality issues #1272

REquesting a 1 thread place for resolving adding new HM2 Mesa Soc FPGA functionality issues #89

Missing Z-Turn Project #20

Todo list #5

Reading current/torque from Mesa motion cards

Trinamic tmc2130 How Cool ?

Zynq HOWTO?
Bedst wishes
Michael Brown

Cameron McQuinn

unread,
Sep 28, 2017, 5:16:19 PM9/28/17
to snickerdoodle forum
Michael, it is good to hear from you. Thanks for everything you have done to get the mksocfpga project to its current state!

I also have been researching the ADC, and from what I understand, after instantiating the XADC IP in the block diagram, and connecting the appropriate VAUX ports, the XADC values can be read with a python script (this thread has an example). If I understand correctly, than getting the ADC working should be as simple as modifying the existing python scripts that exist for reading the ADCs on the BBB. The documentation for the XADC recommends that the temperature sensor (a thermistor in our case) be part of a wheatstone bridge, the outputs of which are connected to the appropriate VAUX_N and VAUX_P pins on the Zynq.

I realize that you are more familiar with the Quartus side of things, but do you know how are the hex values that populate the "BOARD_NAME_HIGH_HEX" and "BOARD_NAME_LOW_HEX" fields in the zynq configuration files are generated? I've been trying to figure this out for some time now and haven't been able to come up with anything.

On the subject of Vivado, I finally figured out how to get the Zynq projects to build in the latest version of Vivado, and modified the build scripts for the snickerdoodle project to reflect this. The build scripts for the other boards are still on Vivado 2015.4, but I will update them when I find some time. The changes are on my fork of the mksocfpga repo (https://github.com/cmcquinn/mksocfpga).

On a related note, I'm still waiting for my snickerdoodle black to come, so if someone who actually has a snickerdoodle could build the project in Vivado and then test it on some real hardware to make sure that everything works the way it should using the 2017.2 vivado toolchain, that would be great.

Looking forward to future collaboration,
Cameron

am...@automatasystems.com

unread,
Nov 1, 2017, 11:39:28 AM11/1/17
to snickerdoodle forum
hi,

I got the mksoc fpga project for Zturn to build on Vivado 2017.2. I have also ported the project for Zedboard. I did this by peaking and poking at the 2015.4 Vivado projects made by JD2 (Many thanks to the-snowwhite and jd2).

Though not being familiar with Xilinx tools or tcl, I dont know how to generate the tcl project build scripts. I would like to try to get then done with some guidance. My question is is there any plan to account for the various versions of Vivado in the mksocfpga repository? For each Vivado version, do we require a new script to generate the IP wrappers and other files?

I compiled the mksocfpga bitfile and loaded it on the Zturn and Zed boards with a bare metal application and was able to write to the various GPIO, LEDs, and hm2_uarts using the memory map in the regmap. Need to try the encoder and SPI components still. 

I am stuck at the linux part. I compiled preempt RT version of the petalinux kernel supplied by Xilinx. I have put up the instructions for that here ( https://pastebin.com/Pk04f5At  )

Using the instruction here ( https://medium.com/developments-and-implementations-on-zynq-7000-ap/install-ubuntu-16-04-lts-on-zynq-zc702-using-petalinux-2016-4-e1da902eaff7 ) I created an Ubuntu root file system image. The only change to the instructions I made was which particular root file system to use and how to generate the bit file. I used an Ubuntu 16.04.3 rootfs by rcn from here https://rcn-ee.com/rootfs/2017-10-12/elinux/ubuntu-16.04.3-console-armhf-2017-10-12.tar.xz which includes a C compiler. 

However, in this process I lost the ethernet connection on the Zturn board. It works during uboot and u boot can get a dhcp IP. But after the linux kernel boots it does not provide a wired networking interface. My most likely guess is the device tree is not setup correctly.  I have been reading about how to use device tree and get the ethernet port working on the above system.

Anyways, Using the C compiler, I compiled a dumb C application that can write directly to the AXI memory mapped registers for the HM2  offsets in regmap. Instructions on writing the C application here 

From the hardware side, I have been able to use a logic analyser to test the output signals.  I have also routed the Uart Rx to Uart Tx and read back the data sent.  So I think hm2 fpga i.e.,  mksocfpga is working.

Further I want to fall inline with the machinekit way of doing things. i.e., use the mainline kernel and debian jessie or stretch filesystems and U-boot-spl instead of Xilinx fsbl for the first stage boot loader. But no I dont have a clue on how to go about this. 

Any help and pointers are appreciated.

Regards,

-automata
Reply all
Reply to author
Forward
0 new messages