Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: sparkyengle on September 17, 2012, 10:54:36 AM

Title: X axis/ dual motor, home reference
Post by: sparkyengle on September 17, 2012, 10:54:36 AM
Hello. I am in the process of building a router that uses two stepper motors to drive the X axis. I have a motor on each side of the table to drive the X axis. I would like to be able to hit the "Ref All Home" button, and have a switch on both lead screws of the X axis to stop the motors. This way I will be able to "tweak" one of the lead screws to reset the gantry angle back to 90 degrees. Currently I am using only the X axis signal to drive both motors, and if for some reason one of the motors stalls, it really screws up the position of my gantry. I'm not sure how to set up a slave signal to drive the extra motor, but am especially confused on how tie in two switches for one axis. Any ideas would be GREAT. Thank you.
Title: Re: X axis/ dual motor, home reference
Post by: Hood on September 17, 2012, 01:17:53 PM
If you are using one axis signal to drive two motors then Mach does not know you have two motors on that axis so it wont be able to do slaved homing.
You will need to set up the second motor as a slaved axis in Mach, that will mean it needs its own drive, assuming you dont have one already.
Hood
Title: Re: X axis/ dual motor, home reference
Post by: sparkyengle on September 17, 2012, 01:21:57 PM
I do have seperate drives for each motor and I plan to use a X master, and a B slave signal to drive my X axis. I just don't know how to go about it.
Title: Re: X axis/ dual motor, home reference
Post by: Hood on September 17, 2012, 02:35:14 PM
Ok so if you connect the axis up to your breakout board and configure it in Ports and Pins, Motor Setup in a similar way as you did the other axis. Once you have done that you need to go to Config menu then Slave Axis and tell Mach B is slaved to X.
Hood
Title: Re: X axis/ dual motor, home reference
Post by: ger21 on September 17, 2012, 07:30:55 PM
Go into ports and pins and setup the B axis. Then go to motor tuning and give it the same velocity and acceleration as the X axis. Go to Config >Slaving and slave B to X. Set up separate home switches for both the X and B axis, wired to different input pins. Go to Config > General Config and make sure "Home Slave with Master" is NOT checked.
That's it. When you home, the X and B should home to their own switches.
Title: Re: X axis/ dual motor, home reference
Post by: sparkyengle on September 20, 2012, 06:25:20 AM
Thanks Hood and Ger for the responce. I configured everything as instructed, and got some crazy results. My B axis would home itself first, hit the limit switch, and continue until it bottomed out on my leadscrew stop. The other axis (X) did nothing because the slave axis never saw the HOME signal from the B side. I looked for a simular problem in the forum, and found someone else that had the same issue. For some reason I, and the other gentleman had to flip flop the input signals to get it to work correctly. It now homes both the master and slave axis's as requested, However, is there a way I can do this without having my gantry <1"
Title: Re: X axis/ dual motor, home reference
Post by: ger21 on September 20, 2012, 06:37:12 AM
Are you using a Smoothstepper, or the parallel port?

Some people find that they need to modify their REF ALL script to use the RefCombination() command to home the slaved axis.
Title: Re: X axis/ dual motor, home reference
Post by: Hood on September 20, 2012, 07:08:26 AM
Also make sure you dont have the B set as angular on General Config page.
Hood
Title: Re: X axis/ dual motor, home reference
Post by: sparkyengle on September 20, 2012, 07:37:14 AM
I am using a parallel port, and I have B set to linear. I don't suppose I could get a crash coarse somewhere on how to modify the REF ALL script button to what you are talking about?
Title: Re: X axis/ dual motor, home reference
Post by: Hood on September 20, 2012, 07:43:34 AM
Attach your xml and I or someone else will look and see if there is a problem with your config.
Hood
Title: Re: X axis/ dual motor, home reference
Post by: ger21 on September 20, 2012, 07:48:42 AM
In the back of the manual for my screenset, there's some info on modifying the homing script.
http://home.comcast.net/~cncwoodworker/downloads/mach3/2010%20Manual.pdf
Page 16 &17
Title: Re: X axis/ dual motor, home reference
Post by: sparkyengle on September 20, 2012, 08:29:16 AM
I'm not sure what I am doing wrong, but my xml's all have a .xb** extension and will not post. I am going to do some reading on this and will let you know if I run into any more snags. Thanks you guys for the help. Andy.
Title: Re: X axis/ dual motor, home reference
Post by: Hood on September 20, 2012, 10:46:46 AM
That is the backup xmls, what you want is the actual xml and it is in the Mach3 folder itself rather than in the backup folder.
Hood
Title: Re: X axis/ dual motor, home reference
Post by: sparkyengle on September 20, 2012, 03:49:34 PM
Read up a little and came up with this:

RefCombination(17)
DoButton(24)

 Works like a charm. Thanks Fellas!