Page 1 of 4

grblshield and Z axis

Posted: Sat May 12, 2012 10:20 pm
by Wilafau
I got my shapeoko kit in the mail this week (thanks Edward!) and got it all assembled. I am using a grblshield and cant get the Z axis to behave properly.

The symptom is that that the Z stepper seems to stall at speed. I took the Z stepper off the shapeoko so it was by itself with nothing but a piece of tape on its shaft to eliminate any load on the stepper. Here are the things I tried:

1) When I reduced the acceleration ($8) from 9.8 to 2 it would spin fine as it accelerated up, then it would stall, then spin fine again as it approached the commanded distance (e.g. Z40). This is the trapizoidal acceleration profile used in the grbl code.
2) I played with the seek rate (dropping it all the way down to 5 from 1100) without success. Did the same with feed rate.
3) I also played with the pulse width trying everything from 10-100 to no avail
4) I also varied the current POT as well.

I did may permutations of the above.

I tried a spare stepper (I had ordered 4 of the 60oz 400step steppers from Sparkfun) with the same results.

When I plugged the stepper into the X or Y driver port and set $0 or $1 to 2560 I got the same issue. So it isnt port related.
When I set the steps/mm (e.g. $2=320) to lower numbers (<1000) I got better results.

It appears that with 2560 steps/mm it is just trying to go too fast, despite settings for pulse width or seek rate.

On the grblshield the microstepping on all three drivers, X, Y, Z are tied together and set to 8X mode.

So, anyone using a grblshield with their Shapeoko and 400 step 60oz steppers? If you are, what are your grbl $variable settings?

I really dont want to have to cut the traces and modify the grblshield to set Z for a different microstepping value but I will if that is the only recourse.

Thanks in advance

Re: grblshield and Z axis

Posted: Sat May 12, 2012 11:25 pm
by Enraged
I dropped my Z to 2x micro stepping, as I was having the same issue. The acceleration can be cranked up, but the max speed was too high and it was stalling. I'll be working on a Z axis step down pulley once my Hadron is built.

Re: grblshield and Z axis

Posted: Sun May 13, 2012 12:54 am
by Wilafau
@Enraged - Thanks - good to know I am not crazy!. How did you modify your grblshield? I am handy with a soldering iron & exacto knife so I am prepared to cut & greenwire. Did you cut the trace between Z axis UM1 & R2,R4 and then solder a jumper or resistor from UM1 on the driver chip to ground?

Since the wiki talks about grblshield as an option for driving the Shapeoko, perhaps some notes should be added to the Shapeoko wiki grbl page
http://www.shapeoko.com/wiki/index.php/Grbl in the "Notes on using Grbl with Synthetos Grblshield" with the steps you need to take to use it. I am willing to do that once I get everything working.

Re: grblshield and Z axis

Posted: Sun May 13, 2012 1:47 am
by Burke LaShell
perhaps some notes should be added to the Shapeoko wiki grbl page... I am willing to do that once I get everything working.
Yes, please do. If you have/solve a problem, it's likely someone else will have the same problem when the 400 Inventables kits ship. This forum, plus continuous updates to the wiki will keep the ShapeOko community strong.

Re: grblshield and Z axis

Posted: Sun May 13, 2012 2:36 am
by Enraged
I use a shield of my own design, sorry. I would suggest contacting the manufacturer, they seem to provide pretty good support, maybe they can help.

Re: grblshield and Z axis

Posted: Sun May 13, 2012 4:18 am
by Wilafau
I went ahead and did the mod to my grblshield. I found the trace that leads from the Z axis UM1 on the 8811 chip, cut it and grounded UM1. This enables 2X microstepping on the Z axis. I changed $2=640 steps/mm (full step is 320 steps/mm so 2X is 640). Works like a champ! I was able to get the hello world gcode to print. Had to invert two of my axis using $7 but it worked great after that.

I also ran into some binding on the Z axis. The delin block mounting screws were off just a hair (literally just a very tiny bit) but that was enough to cause some binding against one of fixed vwheels. I reamed out the mounting holes on the mounting plate a tiny bit and this allowed the delrin block to position & slide perfectly. The off-center nuts could not fix this - I tried.

I'll write up my grblshield mod w/ pics in the next day or so.

Re: grblshield and Z axis

Posted: Sun May 13, 2012 4:45 pm
by Burke LaShell
Works like a champ! I was able to get the hello world gcode to print.
Congratulations!

Don't forget to post your Hello World picture to the gallery, too.
http://www.shapeoko.com/wiki/index.php/Hello_World

Re: grblshield and Z axis

Posted: Sat May 19, 2012 9:53 pm
by alpha
Wilafau wrote:I'll write up my grblshield mod w/ pics in the next day or so.
I finished my electronics today and ran into the same problem http://shapeoko.com/forum/viewtopic.php?f=3&t=237 like you. I never cut a trace and I didn't know the term green wire - I think I can do it... but it would be great if you could post a picture so I can just duplicate what works. Thanks you.

PS: If you alrady did post a picture please show me the location because I was not able to find it.

Re: grblshield and Z axis

Posted: Sun May 20, 2012 8:04 pm
by aldenhart
Sorry for not weighing in on this earlier. I was out of town and wanted to be able to test some things before I posted.

*Background* The issue appears to originate with the fact that the grbl max feed-rate ($4) and max seek rate ($5, aka traverse rate or max velocity) are each set with a single value that applies to all axes. So the X and Y are going to be limited in velocity to what Z can support. I know from fiddling around with TinyG (where these values are settable independently for each axis) that I can get about 16,000 mm/min maximum velocity in X and Y and about 1200 or so in Z. That's after I carefully adjusted the Z axis tracks and the delrin nut so it's not binding. It does 1200 at 8x microstepping and might do more. Some of that is due to the S curve acceleration profiles in TinyG, but grbl should be able to come close.

There has been some discussion that grbl cannot support the Z step rate - I don't think this is the case. The published $5 of 1100 mm/min is 18.3333 mm/sec. 8x microstepping makes 1280 steps per mm for Z - and that's 23,433 steps per sec - assuming 1.8 degree motors - well under grbl's max rate of about 30,000. (at 1200 mm/min it's asking for a pulse rate of 25,600 pulses per second)

So I think the Z axis motor just doesn't have enough torque at the higher microstep settings. If you set grbl to the (8x) settings below Z will stall for G0 moves (traverses). These settings are what I'm using for grblshield and the OSM NEMA 17's here: http://www.alltronics.com/cgi-bin/item/ ... pper-Motor
...which are admittedly pretty beefy motors, but not out of the park. They are 1.8 degree (i.,e. 200 step per revolution) motors:

$0 = 43.74 (steps/mm x)
$1 = 43.74 (steps/mm y)
$2 = 1280.00 (steps/mm z)
$3 = 3 (microseconds step pulse)
$4 = 750.00 (mm/min default feed rate)
$5 = 1200.00 (mm/min default seek rate) (this value is too high and needs to be dropped to somewhere between 600 and 800)
$6 = 0.10 (mm/arc segment)
$7 = 28 (step port invert mask. binary = 00011100)
$8 = 50.00 (acceleration in mm/sec^2)
$9 = 0.05 (cornering junction deviation in mm)

Note that I dropped $3 down to 3 microseconds from the default of 30. This is so there is no chance that the pulses will "get in each other's way" at high pulse rates. The TI drivers on grblshield are happy down to a bit less than 1 microsecond per pulse.

At these settings the Z axis will stall out on my machine somewhere between 600 mm/min and 800 mm/min. Try G1 F600 Z10, then try G1 F800 Z0.

If I drop the grblshield to 4 microsteps (all axes) and use these settings:
$0 = 21.87 (steps/mm x)
$1 = 21.87 (steps/mm y)
$2 = 640.00 (steps/mm z)
$3 = 3 (microseconds step pulse)
$4 = 750.00 (mm/min default feed rate)
$5 = 1200.00 (mm/min default seek rate)
$6 = 0.10 (mm/arc segment)
$7 = 28 (step port invert mask. binary = 00011100)
$8 = 50.00 (acceleration in mm/sec^2)
$9 = 0.05 (cornering junction deviation in mm)

I get good operation to 1200 mm/min on all axes. I also set acceleration to $8=100 for a bit better performance. The trade-off is that the minimum X and Y resolution per step goes from 0.0009 at 8x microstepping to 0.0018 at 4x. So the minimum machine resolution just went over one thousandth.

So I also tested the the trace cut trace method mentioned in other posts. This allowed me to keep X and Y ay 8x microstepping, and set Z to 2x. Settings are:
$0 = 43.74 (steps/mm x)
$1 = 43.74 (steps/mm y)
$2 = 320.00 (steps/mm z)
$3 = 3 (microseconds step pulse)
$4 = 750.00 (mm/min default feed rate)
$5 = 1600.00 (mm/min default seek rate)
$6 = 0.10 (mm/arc segment)
$7 = 28 (step port invert mask. binary = 00011100)
$8 = 50.00 (acceleration in mm/sec^2)
$9 = 0.05 (cornering junction deviation in mm)

This worked fine and I was able to get about 1600 mm/min out of the machine.

*Conclusions* Sonny (of the grbl project) says he's got independent settings on the list, but in the mean time here's what works with grblshield:

Option 1: Use grblshield out of the box. Set grbl like the first group of settings, but limit $4 and $5 to whatever you can get from your machine. Probably somewhere between 600 and 800 mm/min

Option 2: Move the microstepping resistor on grblshield to set the board to 4x and use the second group of settings, above. See here: http://www.synthetos.com/wiki/index.php ... rostepping
You will give up some X and Y resolution to do this.

Option 3: Perform the Z trace cut as described above, and use something like the third group of settings.

In any case you will want to fine tune $4 and $5 to eliminate Z stalls. You may also want to adjust acceleration in $8 for more performance. You may also need to adjust the invert mask to get you motor polarity correct. X should move left/right, with positive X moving right, Y moves away and towards the front of the machine, with away being positive, and Z moves positive upwards.

I will take some pictures and post the trace cut method, but I wanted to get this out.

-- Alden

Re: grblshield and Z axis

Posted: Mon May 21, 2012 3:10 am
by Wilafau
Alden, excellent post! I think it should go in the wiki. Would have saved me some of the trial and error I did to figure out what is going on. But of course that process was educational too. I too had the binding delrin block problem which I solved by reaming the mounting plate holes just slightly so the delrin block positioned just right in the track. Runs smooth now. When I get back from the biz trip I am on this week I'll post pics of my z trace cut mod and my hello world pic.

Bill