08-31-2010 01:28 PM
@arthur51189 wrote:
But how come after the track moves, it goes back to the original home position
I can't understand your question. Your code tells it to find the home position. It does some initialization, sends motion commands in a loop (the nested for loops) and at the end it runs HOM, which causes it to search for the home sensor. Homing runs in the negative direction until either it reaches the home sensor, or it reaches the end of travel and runs in the reverse direction until it finds the home sensor (or the other end of travel limit). Once it finds the home sensor it stops. If you run the code again without doing anything, of course you are starting from the home position, so it will find that same home position again. However, it doesn't know that that's the home position. If you simply want to go back to the starting location at the end of the program, you should use an absolute move to get back to that position instead of using HOM.
08-31-2010 01:34 PM
Is absolute move MA?
08-31-2010 01:40 PM
MA 1 sets the mode to absolute moves (assuming continuous movement, MC, is off). You can set the starting position as 0 by using "PSET 0" and then return to that location by setting MA 1 and then D 0. If you do it this way, it will always attempt to return to the starting position. If a move gets interrupted or doesn't complete and it never makes it back to the starting location, then you will need to home it to return to the original location.
What did you expect the HOM command to do?
08-31-2010 01:48 PM
I thought the HOME postion was basically where the movement started and its where it was going to end thats what i thought it was for
08-31-2010 01:49 PM
So on my last block where i have "Back to HOME" i should do the absolute move?
08-31-2010 01:54 PM
@arthur51189 wrote:
So on my last block where i have "Back to HOME" i should do the absolute move?
Yes. Also, at the beginning, before you start any moves, you should establish the reference position - either set it using PSET, or retrieve it and store it in a variable.
08-31-2010 02:03 PM
So before i get into my outer loop i set PSET 0, and then after my loop is completed i have: MA 11 D 0,0 GO 11? Does that look like it should work?
08-31-2010 02:04 PM
Try it out! It's faster than waiting for a forum reply.
Make sure you PSET 0,0 so that you get both axes.
08-31-2010 03:09 PM
I gave it a try and for some reason one of the tracks doesn't go back to the original starting point
08-31-2010 07:16 PM
@arthur51189 wrote:
I gave it a try and for some reason one of the tracks doesn't go back to the original starting point
Sorry, but that's not enough information for me to provide a helpful suggestion. You might try running the same series of commands directly through the Motion Wizard and see if it's returning an error or other useful information about why the moved failed. Alternatively you could read from the serial port occasionally and display the result, which would provide the same information.