Page 1 of 1

Erratic movement when homing

PostPosted: Wed Apr 03, 2019 5:54 pm
by Jeffsg605
I overrode the "Home Y" (original button number 108) with the following script.

MessageBox.Show("Start home Y");
exec.Code(G1 F1000);
exec.Code(G28 Y0);
MessageBox.Show("End home Y");

I know the script is working because I see the message box pop up. But sometimes the Z axis homes but the wrong direction. Sometimes the X axis homes. Sometimes the Y axis moves one direction and then back the other. Why doesn't this script simply home the Y axis only?

I'm using UC300ETH controller. Thanks in advance.

Edit: Just tried the following code and it instead homes the Z axis.
MessageBox.Show("Start home Y");
exec.Code(G1 F1000);
exec.Code(G28.1 Y);
MessageBox.Show("End home Y");

Re: Erratic movement when homing

PostPosted: Wed Apr 03, 2019 8:04 pm
by dezsoe
This code is not OK.

Code: Select all
MessageBox.Show("Start home Y");
exec.Code("G1 F1000"); // This line makes nothing. The homing speed is set on the axis config page
exec.Code("G28.1 Y"); // You have to set a coord after the Y
MessageBox.Show("End home Y");


Try this:
Code: Select all
MessageBox.Show("Start home Y");
double currY = exec.GetYpos();
exec.Code("G28.1 Y" + currY.ToString("F6")); // Home the Y with the current coord
MessageBox.Show("End home Y");

Re: Erratic movement when homing

PostPosted: Fri Apr 05, 2019 6:41 pm
by Jeffsg605
Got it, that works thank you!