Jump to content
OMRON Forums

twathit

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by twathit

  1. For example,in a triangle,the real move is a straight line x,the pole is L,so there will be a angle θ,x=L*sinθ,when I make the x move in straight line, I want the angular velocity of θ is constant,how could I code this?

    Anyone can help?

     

    Option 1)

    This is exactly why PMAC has kinematic axis definitions available.

    Look in the User Manual for the section dealing with forward and inverse kinematics. As you already understand (by asking the question), the relationship is not linear and will depend on the actual position of the mechanism at any given point in time.

    So the task is to develop a non-linear relationship that will define the actuator position as a function of the desired axis position. This allows you to program desired axis motion and allow PMAC to transform into actuator motion.

    Equally important is a relationship that will define the axis in terms of known actuator position. This allows PMAC to properly initialize the axis by reading the actuator position.

    For a single axis as you describe, this should be fairly easy.

     

    Option 2)

    If this is a simple, single axis task you could use a linearization table (cam function) to 'correct' for the geometry changes through the range of motion. Not as good as #1 in my opinion, but with cubic interpolation turned on will do the job smoothly.

     

    Option 3)

    Again, if the application is simple.... You could even program your motion into a loop that solves the trig relationship each iteration. The 'While Loop' would need to execute fairly often. This is essentially a crude & limited way of doing #1, and not very good. Option #1 allows you to utilize all of PMAC's built in capabilities. With #3 method, your motion program will become more complex, and there will be greater error.

     

    I have some program idea about option #3,in every loop calculate the next position.But I not sure how to program option #1 and #2,could you give me some example?Thanks.

  2. For example,in a triangle,the real move is a straight line x,the pole is L,so there will be a angle θ,x=L*sinθ,when I make the x move in straight line, I want the angular velocity of θ is constant,how could I code this?

    Anyone can help?

     

    Option 1)

    This is exactly why PMAC has kinematic axis definitions available.

    Look in the User Manual for the section dealing with forward and inverse kinematics. As you already understand (by asking the question), the relationship is not linear and will depend on the actual position of the mechanism at any given point in time.

    So the task is to develop a non-linear relationship that will define the actuator position as a function of the desired axis position. This allows you to program desired axis motion and allow PMAC to transform into actuator motion.

    Equally important is a relationship that will define the axis in terms of known actuator position. This allows PMAC to properly initialize the axis by reading the actuator position.

    For a single axis as you describe, this should be fairly easy.

     

    Option 2)

    If this is a simple, single axis task you could use a linearization table (cam function) to 'correct' for the geometry changes through the range of motion. Not as good as #1 in my opinion, but with cubic interpolation turned on will do the job smoothly.

     

    Option 3)

    Again, if the application is simple.... You could even program your motion into a loop that solves the trig relationship each iteration. The 'While Loop' would need to execute fairly often. This is essentially a crude & limited way of doing #1, and not very good. Option #1 allows you to utilize all of PMAC's built in capabilities. With #3 method, your motion program will become more complex, and there will be greater error.

     

    I have some program idea about option #3,in every loop calculate the next position.But I not sure how to program option #1 and #2,could you give me some example?Thanks.

  3. Hi,

    I attached my setup and motion program below.I am using position compare function, the motion is very simple, just a straight line from one point to another point, but need it move slow, and the position compare woks fine,but I found the move isn’t smooth, I mean, because the motor moves very slow, I can see it moves a little, then stop, then moves a little, then stop…till it reach the position, like it was joggling. When I use rapid move,it move smoothly, but the speed is too fast.I don’t know if I need more setup about linear move.

    Here is my setup:

    Motor[1].ServoCtrl=1

    Motor[2].ServoCtrl=1

    Motor[3].ServoCtrl=1

    Motor[4].ServoCtrl=1

     

    // Disable overtravel limit inputs when set to 0

    // May be needed if there are no physical switches present

    //Motor[1].pLimits=Gate1[6].Chan[0].Status.a

    //Motor[2].pLimits=Gate1[6].Chan[1].Status.a

    //Motor[3].pLimits=Gate1[6].Chan[2].Status.a

    //Motor[4].pLimits=Gate1[6].Chan[3].Status.a

     

    // Disable amplifier enable output

    // May be needed if channel is also connected to real amplifier

    Motor[1].pAmpEnable=0

    Motor[2].pAmpEnable=0

    Motor[3].pAmpEnable=0

    Motor[4].pAmpEnable=0

     

    // Disable amplifier fault input

    // May be needed if channel is also connected to real amplifier

    Motor[1].pAmpFault=0

    Motor[2].pAmpFault=0

    Motor[3].pAmpFault=0

    Motor[4].pAmpFault=0

     

    // Set derivative gain term in servo loop to zero

    // This is a Type 1 servo (single integration); does not need Kvfb

    Motor[1].Servo.Kvfb=0

    Motor[2].Servo.Kvfb=0

    Motor[3].Servo.Kvfb=0

    Motor[4].Servo.Kvfb=0

     

    // Lower proportional gain term from default

    Motor[1].Servo.Kp=40

    Motor[2].Servo.Kp=40

    Motor[3].Servo.Kp=40

    Motor[4].Servo.Kp=40

     

    // Add Kvff and Ki

    Motor[1].Servo.Kvff=40

    Motor[2].Servo.Kvff=40

    Motor[3].Servo.Kvff=40

    Motor[4].Servo.Kvff=40

     

    Motor[1].Servo.Ki=0.001

    Motor[2].Servo.Ki=0.001

    Motor[3].Servo.Ki=0.001

    Motor[4].Servo.Ki=0.001

     

    // Deactivate commutation for all motors

    Motor[0].PhaseCtrl=0 // No phase commutation active

    Motor[2].PhaseCtrl=0 // No phase commutation active

    Motor[3].PhaseCtrl=0 // No phase commutation active

    Motor[4].PhaseCtrl=0 // No phase commutation active

     

    Gate1[6].Chan[0].OutputMode=3 //CH1A and CH1B ouputs will be DAC and CH1C output will be PFM

    Gate1[6].Chan[1].OutputMode=3 //CH2A and CH2B ouputs will be DAC and CH2C output will be PFM

    Gate1[6].Chan[2].OutputMode=3 //CH3A and CH3B ouputs will be DAC and CH3C output will be PFM

    Gate1[6].Chan[3].OutputMode=3 //CH4A and CH4B ouputs will be DAC and CH4C output will be PFM

     

    Gate1[6].Chan[0].EncCtrl = 8 //Simulated feedback for channel 1

    Gate1[6].Chan[1].EncCtrl = 8 //Simulated feedback for channel 2

    Gate1[6].Chan[2].EncCtrl = 8 //Simulated feedback for channel 3

    Gate1[6].Chan[3].EncCtrl = 8 //Simulated feedback for channel 4

     

    // Create encoder conversion table entries for all motors

    EncTable[1].Type=3

    EncTable[1].pEnc=Gate1[6].Chan[2].ServoCapt.a

    EncTable[1].pEnc1=Gate1[6].Chan[2].TimeBetweenCts.a

    EncTable[1].index1=0

    EncTable[1].index2=0

    EncTable[1].index3=0

    EncTable[1].index4=0

    EncTable[1].MaxDelta=0

    EncTable[1].ScaleFactor=1/512

     

    EncTable[2].Type=3

    EncTable[2].pEnc=Gate1[6].Chan[2].ServoCapt.a

    EncTable[2].pEnc1=Gate1[6].Chan[2].TimeBetweenCts.a

    EncTable[2].index1=0

    EncTable[2].index2=0

    EncTable[2].index3=0

    EncTable[2].index4=0

    EncTable[2].MaxDelta=0

    EncTable[2].ScaleFactor=1/512

     

    EncTable[3].Type=3

    EncTable[3].pEnc=Gate1[6].Chan[2].ServoCapt.a

    EncTable[3].pEnc1=Gate1[6].Chan[2].TimeBetweenCts.a

    EncTable[3].index1=0

    EncTable[3].index2=0

    EncTable[3].index3=0

    EncTable[3].index4=0

    EncTable[3].MaxDelta=0

    EncTable[3].ScaleFactor=1/512

     

    EncTable[4].Type=3

    EncTable[4].pEnc=Gate1[6].Chan[2].ServoCapt.a

    EncTable[4].pEnc1=Gate1[6].Chan[2].TimeBetweenCts.a

    EncTable[4].index1=0

    EncTable[4].index2=0

    EncTable[4].index3=0

    EncTable[4].index4=0

    EncTable[4].MaxDelta=0

    EncTable[4].ScaleFactor=1/512

     

    // Point motors to encoder conversion table entries

    Motor[1].pEnc=EncTable[1].a

    Motor[2].pEnc=EncTable[2].a

    Motor[3].pEnc=EncTable[3].a

    Motor[4].pEnc=EncTable[4].a

     

    Motor[1].pEnc2=EncTable[1].a

    Motor[2].pEnc2=EncTable[2].a

    Motor[3].pEnc2=EncTable[3].a

    Motor[4].pEnc2=EncTable[4].a

     

    Motor[1].pDac=Acc24E2S[6].Chan[0].Pwm[2].a //Command output to CH1A address (default address + 2) for Stepper

    Motor[2].pDac=Acc24E2S[6].Chan[1].Pwm[2].a //Command output to CH2A address (default address + 2) for Stepper

    Motor[3].pDac=Acc24E2S[6].Chan[2].Pwm[2].a //Command output to CH3C address (default address + 2) for Stepper

    Motor[4].pDac=Acc24E2S[6].Chan[3].Pwm[2].a //Command output to CH4C address (default address + 2) for Stepper

     

    Motor[1].JogSpeed=5

    Motor[2].JogSpeed=5

    Motor[3].JogSpeed=5

    Motor[4].JogSpeed=5

     

    //Gate1[6].Chan[0].Pfm=5000

    //Gate1[6].Chan[1].Pfm=5000

    //Gate1[6].Chan[2].Pfm=5000

    //Gate1[6].Chan[3].Pfm=5000

     

    Gate1[6].Chan[0].CompA=400

    Gate1[6].Chan[1].CompA=400

    Gate1[6].Chan[2].CompA=1

    Gate1[6].Chan[3].CompA=400

     

    Gate1[6].Chan[0].CompB=-400

    Gate1[6].Chan[1].CompB=-400

    Gate1[6].Chan[2].CompB=-1

    Gate1[6].Chan[3].CompB=-400

     

    Gate1[6].Chan[0].CompAdd=1600

    Gate1[6].Chan[1].CompAdd=1600

    Gate1[6].Chan[2].CompAdd=4

    Gate1[6].Chan[3].CompAdd=1600

     

    Gate1[6].Chan[0].EquWrite=3

    Gate1[6].Chan[1].EquWrite=3

    Gate1[6].Chan[2].EquWrite=3

    Gate1[6].Chan[3].EquWrite=3

     

    The motion program is:

    open prog 1 // Open buffer for entry

    linear; // Linear interpolation move mode

    abs; // Absolute move mode

    ta500; // 1/2-second accel/decel time

    ts0; // No S-curve accel/decel time

    f5; // Speed of 500 axis units per time unit

    X500; // Move X-axis to position of 900 units

    dwell2000;

    close // Close buffer, end program entry

  4. The "3" in the motor status word tells you that it thinks it is into both minus and plus hardware limits, so refuses to move in either direction. I presume this is a simulated system, so the easiest solution is to disable the HW limit function for each motor by setting Motor[x].pLimits to 0.

     

    (This is a Power PMAC question that you posted in the Turbo PMAC list. It may get moved to the proper list soon.)

     

    I am curious about why the initial value of motor[x].status[0] is 30004000, why the motor reach the minus and plus hardware limits before it run? Since I don't use encoder, so I need the minus and plus limit to be the reference position. By set Motor[x].pLimits to 0, I can run motion program, but can't monitor the motor[x].pluslimit or motor[x].minuslimit change, is there any other way?

    Thanks.

  5. I’m using 24E2S to output PFM signal to control stepper motor, and I don’t use encoder, so I set Gate1[6].Chan[j].EncCtrl to 8. I know I need to “bracket” my starting position. So I setup Gate1[6].Chan[0].CompA=400,Gate1[6].Chan[0].CompB=-400,Gate1[6].Chan[0].CompAdd=1600, and it work fine. I can see the Gate1[6].Chan[0].Equ toggled. Now I want the starting position isn’t 0, so I think I should change the element in the motion program, here is a simple program,

    open prog 2 // Open buffer for entry

    linear; // Linear interpolation move mode

    abs; // Absolute move mode

    ta500; // 1/2-second accel/decel time

    ts0; // No S-curve accel/decel time

    f100; // Speed of 500 axis units per time unit

    X10000; // Move X-axis to position of 10 units

    if(Gate1[6].Chan[0].PhaseCapt==1000){

    Gate1[6].Chan[0].CompA=800;

    Gate1[6].Chan[0].CompB=1200;

    Gate1[6].Chan[0].CompAdd=800;

    }

    dwell2000; // Sit here for 1/2-second

    X0; // Move X-axis to position of 0 units

    dwell2000; // Sit here for 1/2-second

    close

     

    but the three element doesn’t change, if I use them right?

     

    Thanks

  6. I’m using 24E2S to output PFM signal to control stepper motor,I don't need encoder, so I connected the controller to driver then the step motor.I attach my setup below. Now I can only make the motor run use open loop mode. But the question is I want to run some motion program,so it should be run under close loop mode,I tried #n J+, #n J/,#n J=100,I monitor motor[x].status[0],It change from $30004000 to $30007800,but there are no PFM signal output(I monitor it from oscilloscope).Do I need more setup?I have been stuck in this for quite a long time, hopefully I can get some answer.

     

     

     

     

    Motor[1].ServoCtrl=1

    Motor[2].ServoCtrl=1

    Motor[3].ServoCtrl=1

    Motor[4].ServoCtrl=1

     

    Motor[1].pAmpEnable=0

    Motor[2].pAmpEnable=0

    Motor[3].pAmpEnable=0

    Motor[4].pAmpEnable=0

     

    Motor[1].pAmpFault=0

    Motor[2].pAmpFault=0

    Motor[3].pAmpFault=0

    Motor[4].pAmpFault=0

     

    Motor[1].Servo.Kvfb=0

    Motor[2].Servo.Kvfb=0

    Motor[3].Servo.Kvfb=0

    Motor[4].Servo.Kvfb=0

     

    Motor[1].Servo.Kp=40

    Motor[2].Servo.Kp=40

    Motor[3].Servo.Kp=40

    Motor[4].Servo.Kp=40

     

    Motor[1].Servo.Kvff=40

    Motor[2].Servo.Kvff=40

    Motor[3].Servo.Kvff=40

    Motor[4].Servo.Kvff=40

     

    Motor[1].Servo.Ki=0.001

    Motor[2].Servo.Ki=0.001

    Motor[3].Servo.Ki=0.001

    Motor[4].Servo.Ki=0.001

     

    Motor[0].PhaseCtrl=0 // No phase commutation active

    Motor[2].PhaseCtrl=0 // No phase commutation active

    Motor[3].PhaseCtrl=0 // No phase commutation active

    Motor[4].PhaseCtrl=0 // No phase commutation active

     

    Gate1[6].Chan[0].OutputMode=3 //CH1A and CH1B ouputs will be DAC and CH1C output will be PFM

    Gate1[6].Chan[1].OutputMode=3 //CH2A and CH2B ouputs will be DAC and CH2C output will be PFM

    Gate1[6].Chan[2].OutputMode=3 //CH3A and CH3B ouputs will be DAC and CH3C output will be PFM

    Gate1[6].Chan[3].OutputMode=3 //CH4A and CH4B ouputs will be DAC and CH4C output will be PFM

     

    Gate1[6].Chan[0].EncCtrl = 8 //Simulated feedback for channel 1

    Gate1[6].Chan[1].EncCtrl = 8 //Simulated feedback for channel 2

    Gate1[6].Chan[2].EncCtrl = 8 //Simulated feedback for channel 3

    Gate1[6].Chan[3].EncCtrl = 8 //Simulated feedback for channel 4

     

    // Create encoder conversion table entries for all motors

    EncTable[1].Type=3

    EncTable[1].pEnc=Gate1[6].Chan[2].ServoCapt.a

    EncTable[1].pEnc1=Gate1[6].Chan[2].TimeBetweenCts.a

    EncTable[1].index1=0

    EncTable[1].index2=0

    EncTable[1].index3=0

    EncTable[1].index4=0

    EncTable[1].MaxDelta=0

    EncTable[1].ScaleFactor=1/512

     

    EncTable[2].Type=3

    EncTable[2].pEnc=Gate1[6].Chan[2].ServoCapt.a

    EncTable[2].pEnc1=Gate1[6].Chan[2].TimeBetweenCts.a

    EncTable[2].index1=0

    EncTable[2].index2=0

    EncTable[2].index3=0

    EncTable[2].index4=0

    EncTable[2].MaxDelta=0

    EncTable[2].ScaleFactor=1/512

     

    EncTable[3].Type=3

    EncTable[3].pEnc=Gate1[6].Chan[2].ServoCapt.a

    EncTable[3].pEnc1=Gate1[6].Chan[2].TimeBetweenCts.a

    EncTable[3].index1=0

    EncTable[3].index2=0

    EncTable[3].index3=0

    EncTable[3].index4=0

    EncTable[3].MaxDelta=0

    EncTable[3].ScaleFactor=1/512

     

    EncTable[4].Type=3

    EncTable[4].pEnc=Gate1[6].Chan[2].ServoCapt.a

    EncTable[4].pEnc1=Gate1[6].Chan[2].TimeBetweenCts.a

    EncTable[4].index1=0

    EncTable[4].index2=0

    EncTable[4].index3=0

    EncTable[4].index4=0

    EncTable[4].MaxDelta=0

    EncTable[4].ScaleFactor=1/512

     

    // Point motors to encoder conversion table entries

    Motor[1].pEnc=EncTable[1].a

    Motor[2].pEnc=EncTable[2].a

    Motor[3].pEnc=EncTable[3].a

    Motor[4].pEnc=EncTable[4].a

     

    Motor[1].pEnc2=EncTable[1].a

    Motor[2].pEnc2=EncTable[2].a

    Motor[3].pEnc2=EncTable[3].a

    Motor[4].pEnc2=EncTable[4].a

     

    Motor[1].pDac=Acc24E2S[6].Chan[0].Pwm[2].a //Command output to CH1A address (default address + 2) for Stepper

    Motor[2].pDac=Acc24E2S[6].Chan[1].Pwm[2].a //Command output to CH2A address (default address + 2) for Stepper

    Motor[3].pDac=Acc24E2S[6].Chan[2].Pwm[2].a //Command output to CH3C address (default address + 2) for Stepper

    Motor[4].pDac=Acc24E2S[6].Chan[3].Pwm[2].a //Command output to CH4C address (default address + 2) for Stepper

  7. I am using POWER UMAC to control stepper motor,i just learn this controller for not too long.Based on the file,i use PFM signal,here is my configure:

     

    Gate1[6].Chan[0].OutputMode=3 //CH1A and CH1B ouputs will be DAC and CH1C output will be PFM

    Gate1[6].Chan[1].OutputMode=3 //CH2A and CH2B ouputs will be DAC and CH2C output will be PFM

    Gate1[6].Chan[2].OutputMode=3 //CH3A and CH3B ouputs will be DAC and CH3C output will be PFM

    Gate1[6].Chan[3].OutputMode=3 //CH4A and CH4B ouputs will be DAC and CH4C output will be PFM

     

    Gate1[6].Chan[0].EncCtrl = 8 //Simulated feedback for channel 1

    Gate1[6].Chan[1].EncCtrl = 8 //Simulated feedback for channel 2

    Gate1[6].Chan[2].EncCtrl = 8 //Simulated feedback for channel 3

    Gate1[6].Chan[3].EncCtrl = 8 //Simulated feedback for channel 4

     

    Motor[1].pDac=Acc24E2S[6].Chan[0].Pwm[2].a //Command output to CH1A address (default address + 2) for Stepper

    Motor[2].pDac=Acc24E2S[6].Chan[1].Pwm[2].a //Command output to CH2A address (default address + 2) for Stepper

    Motor[3].pDac=Acc24E2S[6].Chan[2].Pwm[2].a //Command output to CH3C address (default address + 2) for Stepper

    Motor[4].pDac=Acc24E2S[6].Chan[3].Pwm[2].a //Command output to CH4C address (default address + 2) for Stepper

     

    By this configuration, the controller can output PFM signal,I just need the controller to finish an easy move,so I didn't use encoder,so i put .EncCtrl = 8.Now before i run the motion program,should i must use encoder and close the loop?or i still don't need to use encoder and just close the loop is fine.Sorry about my poor english, i am just a begginer,so my question maybe stupid,but i still looking for some help,thanks

×
×
  • Create New...