Hello Guest it is April 25, 2024, 06:59:48 PM

Author Topic: Mach4 2803, ESS, and homing slaved motors  (Read 6224 times)

0 Members and 1 Guest are viewing this topic.

Mach4 2803, ESS, and homing slaved motors
« on: February 16, 2016, 12:20:38 PM »
I'm running into an issue with setting up homing on this machine, which has dual motors on the Y axis. If I configure a single home switch (motor 1) on the axis it works as expected, stopping when the switch is activated. If I go so far as to configure but not enable the second switch (motor 2) in Mach's config, it blows past the previously working home switch (motor 1) and I have to stop the machine manually before it crashes. The same thing also happens if I enable the second switch. This seems to me like a bug in Mach...

My end goal is to set this axis up to self-align the gantry the two motors are on. I've searched around and found lots of "it doesn't work in Mach4 yet" and a couple mentions of "there's a workaround". Does anyone here know what's going on and how to get this to work, or what this supposed workaround might be?

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Mach4 2803, ESS, and homing slaved motors
« Reply #1 on: February 16, 2016, 02:55:02 PM »
Take another look in the ess config within the homing section and the mach config within the inputs section as you only have motor1 setup for homing

DazThGas
New For 2022 - Instagram: dazthegas
Re: Mach4 2803, ESS, and homing slaved motors
« Reply #2 on: February 16, 2016, 03:49:39 PM »
That's my functioning setup as mentioned, with only one configured. I won't be able to post the broken configuration until this evening.

Is your updated homing offset script the solution/workaround to this situation?

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Mach4 2803, ESS, and homing slaved motors
« Reply #3 on: February 16, 2016, 03:56:01 PM »
The homing script is purely to add offsets only.

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Mach4 2803, ESS, and homing slaved motors
« Reply #4 on: February 16, 2016, 11:50:21 PM »
I made some progress. Turns out I had some double or triple negatives going on in all the active high/low settings making it drive the homing backwards when both motors were setup.

Now the problem is it hits the switches, reverses, and never stops backing off. It does seem to be aligning the motors correctly at least, but it also never goes green on the axis reference indicator.

Re: Mach4 2803, ESS, and homing slaved motors
« Reply #5 on: February 18, 2016, 03:24:05 PM »
Does anyone have an idea of what's causing this non-stop backoff motion and failure to indicate homed?

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Mach4 2803, ESS, and homing slaved motors
« Reply #6 on: February 19, 2016, 02:57:15 AM »
Had a quick look but will get a proper look later today, there is a conflict with motor 2, you have set to home in the ess config yet is set to home in position within the mach config, also all are set to home in the pos direction, if you are aligning an axis that is slaved then surely one should be in the neg direction.

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Mach4 2803, ESS, and homing slaved motors
« Reply #7 on: February 19, 2016, 12:04:31 PM »
You might be onto something about the homing config but I'm not seeing what you are. Where are you seeing that line for home in place for motor2 in the config?

Axis0 is my X axis, Axis2 is the Z, and so far I've only wired up homing switches on Axis1 which is the slaved Y motors. The directions should be correct. This is a lead screw axis so both motors turn the same direction, unlike belt/chain drive or rack and pinion. The machine is operational, I'm just finally getting around to this as I'm tired of manually squaring it up.
Re: Mach4 2803, ESS, and homing slaved motors
« Reply #8 on: February 19, 2016, 12:38:40 PM »
More info in case it matters, limit switches are wired NC on dedicated inputs pulling to ground so are active high. Mach does detect the switches independently, stops each motor appropriately and backs off. It just doesn't stop backing off nor does it set the axis as homed.

I tried to trim the noise out of the INI file as my brain can't dig through all the extra stuff, so hopefully this below is everything pertinent to the specific issue. Are there any other sections or settings that would affect this?


[ESS]
Port1-Pin4_ActiveLow=0
Port1-Pin5_Enabled=1
Port1-Pin5_ActiveLow=0
Port1-Pin6_Enabled=1
Port1-Pin6_ActiveLow=0
Port1-Pin7_Enabled=1
Port1-Pin7_ActiveLow=0
Port1-Pin11_Enabled=1
Port1-Pin11_ActiveLow=0
Port1-Pin12_Enabled=1
Port1-Pin12_ActiveLow=0
Motor_1_ApproachVelocity=5.0
Motor_1_BackoffVelocity=5.0
Motor_1_SlaveMisalignment=0.000000
Motor_1_MaxMasterSlaveDelta=0.000000
Motor_2_ApproachVelocity=5.0
Motor_2_BackoffVelocity=5.0
Motor_2_SlaveMisalignment=0.000000
Motor_2_MaxMasterSlaveDelta=0.000000
Port1-Pin4_StandardName=Motor 1 Step
Port1-Pin5_StandardName=Motor 1 Dir
Port1-Pin6_StandardName=Motor 2 Step
Port1-Pin7_StandardName=Motor 2 Dir
Port1-Pin11_StandardName=Motor 1 Home
Port1-Pin12_StandardName=Motor 2 Home
Motor_1_EncoderSwitchName=Motor 1 Home
Motor_2_EncoderSwitchName=Motor 2 Home

[Axis1]
OutOfBandAxis=0
SpindleAxis=0
Enabled=1
JogWithBuffer=1
HomeOrder=3
HomeDir=1
HomeOffset=0.000000
HomeSpeedPercent=100.000000
SoftLimitUsed=0
HomeInPlace=0
OverrideAxis1=-1
OverrideAxis2=-1
OverrideAxis3=-1
OverrideAxis4=-1
ChildMotor0=Motor1
ChildMotor1=Motor2

[Motor1]
Enabled=1
Reverse=1
CanHome=1
CountsPerUnit=12800.000000
MaxVelocity=106666.666667
MaxAccel=320000.000000
BacklashAmount=0.000000
SoftMaxLimit=0.000000
SoftMinLimit=0.000000
EnableDelay=0

[Motor2]
Enabled=1
Reverse=1
CanHome=1
CountsPerUnit=12800.000000
MaxVelocity=106666.666667
MaxAccel=320000.000000
BacklashAmount=0.000000
SoftMaxLimit=0.000000
SoftMinLimit=0.000000
EnableDelay=0

[Axis1]
OutOfBandAxis=0
SpindleAxis=0
Enabled=1
JogWithBuffer=1
HomeOrder=3
HomeDir=1
HomeOffset=0.000000
HomeSpeedPercent=100.000000
SoftLimitUsed=0
HomeInPlace=0
OverrideAxis1=-1
OverrideAxis2=-1
OverrideAxis3=-1
OverrideAxis4=-1
ChildMotor0=Motor1
ChildMotor1=Motor2

[Signal66]
ID=66
Type=Input
Desc=Motor 1 Home
Enabled=1
Negated=0
Mapping=ESS/Motor 1 Home

[Signal67]
ID=67
Type=Input
Desc=Motor 2 Home
Enabled=1
Negated=0
Mapping=ESS/Motor 2 Home

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Mach4 2803, ESS, and homing slaved motors
« Reply #9 on: February 19, 2016, 02:05:42 PM »
Can i make a small suggestion before you go any further, you have got your Y Axis using motors 1 and 2 personally myself i would rearrange your wiring to the drivers for motors and swap 2 and 3 around so it gives you

Motor 0 = X
Motor 1 = Y
Motor 2 = Z
Motor 3 = Y Slave

This will make things a lot more simpler in the long run as its how most machines are set-up.

With your current config if you look into the mach config panel under homing/softlimits and the axis mapping you will see that you are getting confused with the motor number and axis in the left hand column.
Your homing sequence is set as follows.

Z(2) Home first and in place, this is motor 2 (Not your Z) that you have declared as one of the Y Axis
X(0) Is second to home and in place
Y(1) Is next to home in the pos direction - if homing an axis and a slave then one should be negative
A(3) Is last to home and in place

If you go to the documents section at http://warp9td.com/index.php/documentation/doc-mach-four-setup and follow the videos to set these up you will then have a good setup, it will be easier in the long run when using any code in mach4 to reference axis etc.

DazTheGas
New For 2022 - Instagram: dazthegas