01-24-2021, 05:06 PM
After configuring the motor, write the parameters of ppsave.cfg into global definitions.pmh.
After running home.plc, (Enter "enable plc home" in the terminal ) I found that homeoffset always has problems. Powerpmac is powered on and started. Home.plc is executed for the first time.After returning to zero, the zero position from the reference point is not the offset value I set .
The value of Motor[1].HomeOffset in the monitoring window of the IDE is indeed my setting. I am sure that Motor[1].HomeOffset has not changed when the plc is running.
When I enter $$$ in the terminal to search for home again, the zero position from the reference point is correct.
Does the global definitions.pmh setting parameter (the parameter in pp_save.cfg) affect the homeoffset?
The following is my home.plc
open plc home
p11=0
p12=0
p13=0
Motor[1].CaptureMode=0
Gate3[0].Chan[0].CaptFlagSel=0
Gate3[0].Chan[0].CaptCtrl=1
Motor[1].HomeVel=-327680
Motor[1].HomeOffset=-32768000
Motor[1].CaptPosLeftShift=4
while(Gate3[0].Chan[0].HomeFlag==0)
{
Motor[1].JogSpeed=327680;
Motor[1].JogTa=-9.8999997e-05
Motor[1].JogTs=-0.090000004
if(Gate3[0].Chan[0].HomeFlag==0&&p11==0)
{
p11=1
cmd "#1jog+"
}
}
if(Gate3[0].Chan[0].HomeFlag==1&&p12==0)
{
p12=1
cmd "#1home"
}
disable plc home
close
After running home.plc, (Enter "enable plc home" in the terminal ) I found that homeoffset always has problems. Powerpmac is powered on and started. Home.plc is executed for the first time.After returning to zero, the zero position from the reference point is not the offset value I set .
The value of Motor[1].HomeOffset in the monitoring window of the IDE is indeed my setting. I am sure that Motor[1].HomeOffset has not changed when the plc is running.
When I enter $$$ in the terminal to search for home again, the zero position from the reference point is correct.
Does the global definitions.pmh setting parameter (the parameter in pp_save.cfg) affect the homeoffset?
The following is my home.plc
open plc home
p11=0
p12=0
p13=0
Motor[1].CaptureMode=0
Gate3[0].Chan[0].CaptFlagSel=0
Gate3[0].Chan[0].CaptCtrl=1
Motor[1].HomeVel=-327680
Motor[1].HomeOffset=-32768000
Motor[1].CaptPosLeftShift=4
while(Gate3[0].Chan[0].HomeFlag==0)
{
Motor[1].JogSpeed=327680;
Motor[1].JogTa=-9.8999997e-05
Motor[1].JogTs=-0.090000004
if(Gate3[0].Chan[0].HomeFlag==0&&p11==0)
{
p11=1
cmd "#1jog+"
}
}
if(Gate3[0].Chan[0].HomeFlag==1&&p12==0)
{
p12=1
cmd "#1home"
}
disable plc home
close