chipKIT® Development Platform

Inspired by Arduino™

First successful trial of GRBL on chipkit Max32

Created Wed, 02 Mar 2016 20:30:18 +0000 by george4657


george4657

Wed, 02 Mar 2016 20:30:18 +0000

I have spent the last several months converting Grbl from a mega256 to a chipkit Max32 and today I made my first successful run on an actual machine.

Test machine: Home made with 3 steppers fed with drv8825 drivers, one stepper on X and two steppers on Y (stepper motors from old floppy drives) Maximum speed limited by steppers not PIC32 to 6000 mm/min Drivers and LCD fed with output of 3.3 volts with no problem, no level shifting was done.

Code Changes: Interrupts had to be completely changed. I used same method as Grbl but all new code. I added code to toggle for 2 steppers on same axis. A simple change as I toggle all axis at once as they are all on the same port.
I added code for real time display of position on an LCD as this was a function I missed with Grbl. A lot of try to compile, find errors avr specific,rewrite that code. Had to account for faster processor. Not 100% yet but close.

Problems: Grbl is written in C not C++ so I can not use libraries such as lcd one so I had to rewrite my own in C. Had to find ports with at least 8 bits output for direction bits,step bits and LCD bits Documentation on grbl code is poor so I had to do a lot of trying to figure out what code was trying to do. There is a lot of defines for several different options so this complicated the code even more. When I went to try code for the first time I tried using Grbl Controller but that program looks first for response from board that it is running Grbl. The problem is chipkit boot process is so slow it times out first. I wasted a lot of time trying to get it to work thinking I had a problem in my code. There are three solutions,change bootloader,change Grbl Controller or write my own terminal program. I can only do the third one so I had to write my own terminal program to run gcode commands or load and run gcode file.

There is nothing like the feeling of seeing a machine running with your design and your code running it for the first time.

George


mikes

Mon, 07 Mar 2016 16:22:41 +0000

That is very cool. 8-)


Jacob Christ

Mon, 07 Mar 2016 16:35:49 +0000

This is awesome! You made headway where I just banged my head. Couple of thoughts, have you looked at Smoothie? Its a port of GRBL for ARM that can handle 5 axis motion. Also, I think they did a lot of work to abstract out the microcontroller used.

Also, do you have the code posted somewhere so we can try it?

Jacob


reineruhry

Tue, 02 May 2017 16:19:17 +0000

Hi George,

I would like to try my Uno32 with GRBL, is it possible to you to share the code?

Best Regards, Reiner


lstandage

Tue, 02 May 2017 22:02:36 +0000

There is a group of us here at Microchip that are working on a PIC32MZ EF-based controller board for 3D Printing and CNC applications. I have a couple of guys looking at the GRBL code, so they would like to see what you have done.

The first step is a shield for the Wi-Fire, then the actual board. We have a model Kossel-mini based 3D Printer design that is our platform for testing it. If you're interested in those files, we have a private GitHub repo set up for it.