Getting dual axis self square gantry working

priority
Posts: 19
Joined: Sat Feb 22, 2020 8:01 pm

Getting dual axis self square gantry working

Post by priority » Tue Apr 28, 2020 4:08 pm

edit: Sept 6, 2020 to add picture for proper solder bridging on "clone config".

Took the plunge and managed to get self square (auto square) working on the gantry for my Workbee with dual Y stepper motors. It took a while to get it working as the information was scattered in different locations, so here's a consolidated list of what I found worked for my machine.

The limit switches should be set for NC operation. The default was NO when I initially built up my machine, but $5=1 will invert the grbl switch settings to NC.

My kit only came with 3 limit switches, so I had to purchase an additional limit switch.

Since there are only 3 axis limit switch circuits, in order to auto-square, connect the Z-axis limit switch in series with the A-axis (second Y-axis) limit switch. This will allow grbl to sense the Y and A limit switch engagements separately when homing since the Z-axis is homed separately from X & Y.

Update the firmware on the Protoneer's Arduino to grbl 1.1h. Make sure to get the firmware from the github repository. Do NOT use the archive on the grbl release notes page as there are a couple of typos can prevent the code from compiling for version 1.1h. Instructions for installing and compiling the grbl library are at https://github.com/gnea/grbl/wiki/Compiling-Grbl.

After installing the grbl repository as a library in Arduino, modify the following lines in config.h file in the grbl library folder.
#define ENABLE_DUAL_AXIS
#define DUAL_AXIS_SELECT Y_AXIS
#define DUAL_AXIS_CONFIG_PROTONEER_V3_51

The cpu_map.h pin mappings for a dual axis motors do not match the silkscreen on the back of Protoneer v2.60 board. If you are using external drivers, you can just swap the wires for STEP and DIR. I have not tested internal drivers, but I assume you will have to swap the pin assignments in cpu_map.h to get internal drivers to work ( #define DUAL_STEP_BIT and #define DUAL_DIRECTION_BIT are the lines to search for in cpu_map.h).

I used the Arduino program on the Raspberry Pi to upload code to the Protoneer board. Programming was finicky for me for a while, but seemed to work properly after a reboot.

Place solder bridges on the clone config A3/A4 clone config and make sure no other solder bridges are present.
Image

It took a bit of fiddling with location of the Y-axis and A-axis limit switches, but I was able to an out-of-square gantry to auto-square repeatably with only a modicum of effort.
Last edited by priority on Sun Sep 06, 2020 10:37 am, edited 1 time in total.

Bertus Kruger
Site Admin
Posts: 1773
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: Getting dual axis self square gantry working

Post by Bertus Kruger » Tue May 12, 2020 11:34 pm

Wow.... Well done.

maxcom
Posts: 1
Joined: Sat May 16, 2020 5:35 pm

Re: Getting dual axis self square gantry working

Post by maxcom » Sat May 16, 2020 5:43 pm

thank you priority! I decided this morning I would do the same thing and you saved me a ton of time!

You mentioned you're using external drivers - did you have to buy/use a 4th driver? X Y1 Y2 Z ?

I am using the external driver output boards - https://wiki.protoneer.co.nz/File:ExternalDriver.png

Do is the Step and Dir correct on these or do I need to swap them still?


Thanks in advance!

priority
Posts: 19
Joined: Sat Feb 22, 2020 8:01 pm

Re: Getting dual axis self square gantry working

Post by priority » Mon May 18, 2020 11:50 pm

@maxcom,
Glad to know someone out in the ether found this info to be useful!

One external driver is needed for each stepper motor--so, I have 4 external drivers.

I don't know about your driver boards wrt the labeling issue. Mine look different than yours. Unfortunately, I am several hours away from my machine at the moment and can't give you a definitive order. However, you can do what I did to determine the pin order: I used an ohmmeter to find the Ground pin; in theory, you can determine the other pins if you have the patience with an ohmmeter.

I was lazy, so to determine Step and Dir, I hooked Ground (known) and Step/Dir (randomly with remaining 3 pins) and started bCNC. Using the jog function, I checked the voltage at the inputs of the external drivers. The Step signal will pulse when bCNC is telling the stepper motor to move but will otherwise be low. The Dir pin will be much more "stable" and only changes between low and high when you jog the respective axis in bCNC. I did have my stepper motors mechanically disconnected from my Workbee during this "highly scientific investigation".

There is no need to connect Enable for TB6600s and DM542s (and probably others). If you do want them connected, I think you will need to dig through the GRBL source and switch the signal to be active high instead of active low.

Hope this helps!

Mochanic
Posts: 48
Joined: Mon Nov 12, 2018 10:41 pm

Re: Getting dual axis self square gantry working

Post by Mochanic » Fri May 29, 2020 12:53 am

Well at least someone on here knows how all this stuff works!
I'm pretty much lost right now, so reading everything I can to hopefully get my custom Laser machine to at least move or do something!
Thanks for posting this info, there is little to no help out there for the Protoneer hats!

ryan
Posts: 7
Joined: Thu Jul 23, 2020 6:04 pm

Re: Getting dual axis self square gantry working

Post by ryan » Sat Aug 08, 2020 8:27 pm

For my setup, I do not have external drivers, and this almost works. However, the Y direction (my setup is dual Y motors) seems to only go in one direction on a jog. G0 Y-1 for example spins the stepper in the same direction as G0 Y1. However, the A channel/driver/stepper seems to be working correctly.

I haven't connected the limit switches yet either... but I have the belts off and wanted to make sure the steppers are working in tandem, which I am glad to have checked first. ;)

Any suggestions on how to fix this would be appreciated.

priority
Posts: 19
Joined: Sat Feb 22, 2020 8:01 pm

Re: Getting dual axis self square gantry working

Post by priority » Sun Aug 09, 2020 11:29 pm

Since the Y isn't changing direction, first step is to isolate if the issue is with the the stepper driver or the control signal.

Put a voltmeter on the DIR pin of the stepper driver and see if it changes from 0v to 5v or vice versa when you jog in a different direction. If it stays a constant voltage the problem is on the arduino side. If the DIR signal changes, but the stepper is only moving one direction, that would indicate a bad driver. At this point, swapping the A & Y drivers would further confirm the diagnosis.

If the DIR signal is changing when you change jog direction, I would first double check the code your are loading into the arduino to ensure there are no unintended changes to the pin sending the DIR signal to the driver. If not, double check the traces and make sure you have no unintended solder bridges on the jumpers on the back of the Protoneer board. It is possible to kill the output buffer on a pin on an arduino, but I have found them to be pretty robust to my "accidental stress-testing" in other projects.

You don't state what the type of machine and stepper motors you are using. If the stepper motors are anything other NEMA17, I would strongly encourage you to move to external drivers. Over the course of several months, every DRV8825 I used with Bulkman "regular torque" NEMA 23 steppers failed--some slowly with missed steps & others with more flair when I was "inadvertently stress-testing" my Workbee CNC. I eventually moved to TB6600s and then was finally satisfied with DM542s.

ryan
Posts: 7
Joined: Thu Jul 23, 2020 6:04 pm

Re: Getting dual axis self square gantry working

Post by ryan » Tue Aug 11, 2020 11:41 pm

Since the Y isn't changing direction, first step is to isolate if the issue is with the the stepper driver or the control signal.
I am fairly confident at this point that my RPi CNC failed. I discovered that the X axis was not working either after swapping the X and Y drivers in tandem with their connections, which demonstrated the X to moving in one direction (on the Y axis of the controller) while the Y did nothing. I also had an extra stepper driver, so I used tried that out to rule out the drivers themselves being the issue.

I also know what killed it... human error of course. :oops: When setting up the controller I had plugged the PSU for the steppers and the RPi into a UPS. I turned switched off the UPS to remove the drivers and change the microstepper jumpers thinking the power button on the UPS turned off both the battery backed and the surge protected outlets. As it turns out, the power switch on the UPS only turned off the batter backed outlets, and NOT the surge protected outlets. I let out the magic smoke from two drivers, killed the RPi, and it appears I also damaged the CNC shield for the driver channels which were connected at the time. :( This was an expensive lesson to say the least.

I don't want to spend more time replacing components on the shield itself, so I ordered a new one which is coming in the mail on Friday.
You don't state what the type of machine and stepper motors you are using. If the stepper motors are anything other NEMA17, I would strongly encourage you to move to external drivers. Over the course of several months, every DRV8825 I used with Bulkman "regular torque" NEMA 23 steppers failed--some slowly with missed steps & others with more flair when I was "inadvertently stress-testing" my Workbee CNC. I eventually moved to TB6600s and then was finally satisfied with DM542s.
This is a good tip. I wish I had ordered my replacement CNC hat with the external drivers having seen this. As for the machine, It's a Rascal CNC, which is a belt driven design based mostly on NEMA23 steppers for the X, Y, and Y/A axis. The Z axis uses a 2.0A NEMA17, but I don't intend to cut hard materials so don't expect to need much more torque than I will already have on this axis right now. I am using DRV8825s for purchased directly from Pololu. The NEMA23s I am using are rated for 1.5A/phase (23HS22-1504S), and I have added aluminum heat sinks and active cooling to the drivers. I am not super happy with the thermal tape on the heat sinks, so I may change that out to a proper thermal adhesive to improve the performance of the heat sinks.

ryan
Posts: 7
Joined: Thu Jul 23, 2020 6:04 pm

Re: Getting dual axis self square gantry working

Post by ryan » Sat Aug 15, 2020 4:02 am

Replacing the CNC Hat indeed fixed almost every issue. The only issues which I need to sort out now are:

1) The A and Y steppers now move in opposite directions. I am guessing I just need to desolder the A4 (dir?) pin.
2) The steppers don't seem to energize to hold the stepper positions. I haven't wired up the limit switches yet, so it may simply be that they need to be setup and the machine homed before it will let me send the `!` feed hold command.
3) The hat seems to be less responsive than the previous one -- sometimes it doesn't return from a command right away, and also I now see `client>` prompts which I hadn't seen before.

Getting closer though!

EDIT:
1) I realized all I needed to do was change the wiring to correct the direction on the stepper. This works and seems to be the best solution. My X stepper was going in the wrong direction too, so I just changed that one as well.
2) Work in progress...
3) Seems fine now. Did a `make clean` and and `make` and updated the version string in `grbl/grbl.h` so I could make sure the grbl version on the hat was correct. Once that was uploaded it seemed to be working well.

PropellerHat
Posts: 11
Joined: Fri Jun 19, 2020 11:09 am

Re: Getting dual axis self square gantry working

Post by PropellerHat » Fri Sep 04, 2020 1:11 pm

The most valued info right here, thanks! Going to try this on 2 machines this weekend.

Just one question: The bridging of the clone drive thingies... the way it is done in the second pic of the theme in https://wiki.protoneer.co.nz/Raspberry_Pi_CNC
right? (4th socket cloning Y axis) There are a couple of different pics in the web how to connect these dots and frankly the system could be more intuitive.

Thanks again mate!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest