Loesch Posted May 17, 2011 Share Posted May 17, 2011 Hi, I would like to set the motor x home offset, but I couldn't not quite figure out how. Can someone please help me with that? According to the the "PMAC Software Reference Manual", setting the motor x home offset is done by setting the variable Ix26. However homing motor x after setting Ix26 to something different then zero still moves motor x to position zero. So I found another thread on this forum (http://forums.deltatau.com/showthread.php?tid=291&pid=728&mode=threaded) saying that I must set the variables I7022 and I7023, too. However, looking them up in the manual, I got confused. So here's what I want to do: I want to make the current position of the motor the home position. So I'm retrieving the current position of motor x (command #xP) and set Ix26 to this value * 16. Now I move motor x to a different position. Afterwards I home motor x (command #xHM). To which values would I have to set I7022 and I7023 so motor x moves to the home offset position instead of zero and why? According to the TYPE command, I'm using a PMAC Turbo2. PEWIN gives me that: TYPE Turbo2, X8 Thank you for your help! Link to comment Share on other sites More sharing options...
Omron Forums Support Posted May 17, 2011 Share Posted May 17, 2011 The procedure for setting Ixx26 is as such: Home the motor without any offset.Store the home position (Mxx62/(Ixx08*32)) in a P-Variable.Position the motor (either by hand or with jog commands) to the location to which you want the motor to return after homing.Store this position in a P-Variable (Mxx62/(Ixx08*32)).Set Ixx26 equal to that position multiplied by 16. Below is a PLC I wrote that will do this for motors 1-4 for you. It will home motors 1-4, then kill motors 1-4 and wait for the user to position the motors as desired. Then, the user sets P1004=1 and the PLC will set the home offsets to that location and then home the motors again: //******* Setup and Definitions *******// M133->X:$0000B0,13,1 ; #1 Desired-velocity-zero bit M140->Y:$0000C0,0,1 ; #1 Background in-position bit M145->Y:$0000C0,10,1 ; #1 Home-complete bit M162->D:$00008B ; #1 Actual position (1/[ixx08*32] cts) M233->X:$000130,13,1 ; #2 Desired-velocity-zero bit M240->Y:$000140,0,1 ; #2 Background in-position bit M245->Y:$000140,10,1 ; #2 Home-complete bit M262->D:$00010B ; #2 Actual position (1/[ixx08*32] cts) M333->X:$0001B0,13,1 ; #3 Desired-velocity-zero bit M340->Y:$0001C0,0,1 ; #3 Background in-position bit M345->Y:$0001C0,10,1 ; #3 Home-complete bit M362->D:$00018B ; #3 Actual position (1/[ixx08*32] cts) M433->X:$000230,13,1 ; #4 Desired-velocity-zero bit M440->Y:$000240,0,1 ; #4 Background in-position bit M445->Y:$000240,10,1 ; #4 Home-complete bit M462->D:$00020B ; #4 Actual position (1/[ixx08*32] cts) #define Mtr1HomePos P1000 #define Mtr2HomePos P1001 #define Mtr3HomePos P1002 #define Mtr4HomePos P1003 #define DesiredMotorPositionFlag P1004 #define PLC_12_Running P1005 #define Mtr1HomeOffset I126 #define Mtr2HomeOffset I226 #define Mtr3HomeOffset I326 #define Mtr4HomeOffset I426 //******* Program *******// Open PLC 12 Clear PLC_12_Running = 1 DesiredMotorPositionFlag = 0 ; Initialize the flag to 0 // Home motors 1 - 4 CMD"#1HM#2HM#3HM#4HM" I5111 = 2 While(I5111 > 0) EndWhile ; Force the command to execute // Wait for all 4 motors to home While(M133 = 0 or M140 = 0 or M145 = 0 or M233 = 0 or M240 = 0 or M245 = 0 or M333 = 0 or M340 = 0 or M345 = 0 or M433 = 0 or M440 = 0 or M445 = 0) EndWhile I5112=500*8388608/I10 While (I5112>0) EndW ; 1/2 second delay // Record home positions Mtr1HomePos = M162/(I108*32) Mtr2HomePos = M262/(I208*32) Mtr3HomePos = M362/(I308*32) Mtr4HomePos = M462/(I408*32) // Kill motors 1 - 4 CMD"#1K#2K#3K#4K" I5111 = 2 While(I5111 > 0) EndWhile ; Force the command to execute // Wait for user to position the motors as desired // User must set DesiredMotorPositionFlag = 1 to continue the PLC While(DesiredMotorPositionFlag = 0)EndWhile // Set home offsets Mtr1HomeOffset = M162/(I108*32)*16 Mtr2HomeOffset = M262/(I208*32)*16 Mtr3HomeOffset = M362/(I308*32)*16 Mtr4HomeOffset = M462/(I408*32)*16 // Home motors 1 - 4 CMD"#1HM#2HM#3HM#4HM" I5111 = 2 While(I5111 > 0) EndWhile ; Force the command to execute PLC_12_Running = 0 Disable PLC 12 Close Link to comment Share on other sites More sharing options...
steve.milici Posted May 17, 2011 Share Posted May 17, 2011 Also note that the "HMZ" command will make the current position the home position. Using this you could move to the position you wish to make the home position and then execute the "HMZ" command. Link to comment Share on other sites More sharing options...
steve.milici Posted May 17, 2011 Share Posted May 17, 2011 It ia also important to note that any "home" command will set the motor position register to zero. Link to comment Share on other sites More sharing options...
Loesch Posted May 26, 2011 Author Share Posted May 26, 2011 Thank you very much for your help! Link to comment Share on other sites More sharing options...
Recommended Posts