Jump to content
OMRON Forums

khalil-yazji

Members
  • Posts

    29
  • Joined

  • Last visited

Posts posted by khalil-yazji

  1. Hi

     

    I have a setup where I need to drive to motors in leader follower configuration. However, these two motors need to be moving in opposite directions to drive the axis (ie #1j+ #2j- for the axis to move +).

    I had used the GantryXCtrl method before but all the motors where moving in the same direction. I couldn't find any setup variables to command the follower motor to move in opposite direction. Is this possible and if so how to do it?

  2. Thanks for your reply.

     

    When turning the motor by hand I can't feel any difference between the two directions and the motor is just setting on a bench so gravity is not a factor.

    The voltage mode is used because we have a very noisy current feedback that made it very hard to close the current loop, running the motor with normal direct PWM current control is really hard as we can't tune the current loop sufficiently.

  3. Hi

     

    I was testing an AC brushless motor when I noticed that even when driving the motor unloaded one direction requires about 20-30% more current to move at the same speed.

    I'm taking the current readings from IqCmd and IqMeas to compare.

    According to the motor supplier this shouldn't happen, so I'm investigating if this could be caused by some setup elements.

    The motor is driven using Voltage-Mode Direct-PWM Control.

    Here are the motor settings I'm using, these live in a pmh file:

     

    Sys.WpKey = $AAAAAAAA
    Acc24E3[3].Chan[2].AdcOffset[0]=9699328
    Acc24E3[3].Chan[2].AdcOffset[1]=-6225920
    Acc24E3[3].Chan[2].InCtrl=$42043
    Acc24E3[3].Chan[2].OutCtrl=$f200004
    Acc24E3[3].Chan[2].AtanEna=1
    Acc24E3[3].Chan[2].PackInData=0
    Acc24E3[3].Chan[2].EncCtrl=3
    Acc24E3[3].Chan[2].PackOutData=0
    Acc24E3[3].Chan[2].PwmFreqMult=2
    Sys.WpKey = $0
    
    EncTable[19].index2=240
    EncTable[19].pEnc=Acc24E3[3].Chan[2].AtanSumOfSqr.a
    EncTable[19].ScaleFactor=0.0000152587890625
    
    
    Motor[19].Servo.Kp=0.80000001
    Motor[19].Servo.Kvfb=0
    Motor[19].Servo.Kvff=10
    Motor[19].Servo.Ki=8.0000001e-7
    Motor[19].PhasePosSf=9.5367431640625e-7
    Motor[19].ProgJogPos=3.16202013338397788e-322
    Motor[19].IiGain=0
    Motor[19].MotorTa=-2
    Motor[19].MotorTs=5000
    Motor[19].JogTa=0
    Motor[19].JogTs=5000
    Motor[19].MaxSpeed=3000
    Motor[19].JogSpeed=3000
    Motor[19].HomeOffset=5.5284086e9
    Motor[19].FatalFeLimit=10000
    Motor[19].WarnFeLimit=4000
    Motor[19].MaxPos=262144
    Motor[19].MinPos=-5.5190001e9
    Motor[19].InPosBand=2000
    Motor[19].I2tSet=4602.6406
    Motor[19].I2tTrip=7.3581094e8
    Motor[19].MaxDac=13369.574
    Motor[19].pDac=Acc24E3[3].Chan[2].Pwm[0].a
    Motor[19].pAdc=Acc24E3[3].Chan[2].AdcAmp[0].a
    Motor[19].pPhaseEnc=Acc24E3[3].Chan[2].AtanSumOfSqr.a
    Motor[19].pEncStatus=Sys.pushm
    Motor[19].pEncCtrl=Sys.pushm
    Motor[19].EncType=0
    Motor[19].LimitBits=0
    Motor[19].PhaseFindingTime=1
    Motor[19].pAmpEnable=Acc24E3[3].Chan[2].OutCtrl.a
    Motor[19].pAmpFault=Acc24E3[3].Chan[2].Status.a
    Motor[19].pLimits=0
    Motor[19].AbsPhasePosOffset=1191.8199
    Motor[19].AbsPhasePosFormat=$1010
    Motor[19].AbsPhasePosSf=0.0625
    Motor[19].pAbsPhasePos=Acc24E3[3].Chan[2].AtanSumOfSqr.a
    Motor[19].AbsPosFormat=$1002000
    Motor[19].pAbsPos=Sys.pushm+$98
    Motor[19].CaptControl=$13000000
    Motor[19].pCaptFlag=Sys.pushm
    Motor[19].pCaptPos=Sys.pushm
    Motor[19].Control[0]=$14006080
    Motor[19].ServoCtrl=1
    Motor[19].PhaseCtrl=4
    Motor[19].PowerOnMode=6
    Motor[19].PhaseSplineCtrl=0
    Motor[19].PhaseMode=8
    Motor[19].CaptFlagBit=19
    Motor[19].CaptPosRightShift=0
    Motor[19].CaptPosLeftShift=0
    Motor[19].CaptPosRound=0
    Motor[19].pEncLoss = Acc24E3[3].Chan[2].Status.a
    Motor[19].EncLossLevel=1
    Motor[19].EncLossBit=31
    Motor[19].FaultMode=1
    Motor[19].Ctrl = Sys.ServoCtrl
    Motor[19].ExtraMotors = 0
    Motor[19].CmdMotor=0
    
    

     

    Thanks in advance

  4. void DkillCoord (int n): Kills all motors in coordinate system n and then if defined enables the brakes after a delay

     

    How long is the delay between killing the motors and enabling the brakes? Is it the same delay defined in Motor[x].BrakeOnDelay?

  5. I'm looking for a way to check if a motor has moved between shutdown and next power up. At the moment I'm checking visually that nothing has moved then restore saved position using these commands in the terminal

    Motor.PowerOnMode = 6

    Motor.pAbsPos = Sys.Ddata.a

    Motor.HomeOffset = -Sys.Ddata

    Motor.HomePos = 0

    Motor.AbsPosFormat = $01002000

    #i hmz

    where Sys.Ddata contains Motor.ActPos and saved using the custom save function.

     

    I'm planning to implement this in a start up procedure in a plc. What would be the best way to check if the motor hasn't moved and restore the saved position?

  6. The documentation for JogSpeed(n,x) is not great. It will jog motor n indefinitely with Velocity = x * Motor[n].JogSpeed.

    Set x negative to reverse direction.

    Motor[n].MaxSpeed should not matter.

     

    Thanks for the reply, is x here a percentage or a value between 0-1?

  7. I came across the function JogSpeed in the PPMAC C language manual and according to the manual

    int JogSpeed (int n, double x)

     

    Starts a jog move for motor n at velocity x

     

    Parameters:

    n - Motor number

     

    x - jog velocity

     

    I couldn't find any reference to what is the unit of velocity parameter in this function. and while testing it in my app I noticed that the motor ActVel is actually higher than the parameter and in some cases even higher than Motor[x].JogSpeed and Motor[x].MaxSpeed.

     

    How to probably use this function and how does it work (ie. how does it command a motor to jog at a specific speed as there's no equivalent to this in the on-line commands)?

  8. when this happens the global variable doesn't change at all. it feels like the motion program gets stuck at the move line and doesn't continue even though in task manager it's still running and the motors are still enabled.

     

    I tried the synchronous assignment and it doesn't seem to make any difference.

     

    Here's an example of the motion programs created by the C app:

     

    linear
    abs
    ta0
    ts5000
    frax(bb,cc)
    F0.000054
    BB446.704468CC500.401489dwell0P8204++
    dwell5000
    P8212==1dwell0
    P8428==1dwell0
    

     

    most of the motion programs created in this app are similar to this example as they are usually a single move on 1-4 motors.

     

    ps. when the program get stuck even the P8204++ at the end of the move line is not executed.

  9. Does anything in your coordinate system status screen look off when this happens? What value does Coord[x].ErrorStatus have? It sounds like your motor is just saying the motion program died without telling it how to do it's next move.

     

    Thanks for your reply.

    I can't see anything else looking off in the coordinate system and I checked the errorstatus and it's 0.

    one thing I noticed that when this happens Coord[1].Ldata.Status is 112 and when the motion program works fine it's 96.

    by looking at the manuals this is related to single step mode. but I'm not using that.

  10. Hi all

     

    I have a C app that receives a set of target positions from an HMI over UDP connection and make them into a motion program. at the end of the motion program it sets a global variable flag that triggers a response in the rticplc and/or plc to kill all motors.

    Most of the time this method works fine but I noticed sometimes the motion program will finish the move but the motion program will keep running with the motors still enabled but not moving and the global flag doesn't get set to kill the motors, when this happens the BlockRequest bit in the running motors status is true.

    I looked into the manuals and the software reference for information on BlockRequest but couldn't find anything conclusive about it.

    What is the BlockRequest bit and why is it stopping the motion program to terminate and how to prevent this issue from happening in the first place?

     

    Thanks in advance.

  11. Hi

    I was trying to run a motion program in a coordinate system that has ~20 motors, and I set the automatic brakes on these motors.

    To run the motion program all the motors in the CS need to be enabled before issuing the run command. However, this will release the brakes on all the motors even the ones not moving in that motion program.

    Is there a way to only enable motors when they are moving instead of enabling the coordinate system at the beginning?

  12. I'm controlling few motors in a robot using Power PMAC and I want to find a way to detect when the robot is idle and when it is moving, I used Coord[x].InPos in the testing and it seems to be doing what I need but I'm not sure if this is the correct way of detecting idle motors, or is there a better way to do it.
  13. My c program receives a message from an HMI and creates a motion program using the Command() function.

    is there anyway to read the motion program after it was created from the IDE or any other way?

  14. Hi I have a similar case.

    I was using virtual motors to test my program and the Position window was showing me the correct motors positions, after updating from IDE 3 to 4, the position window show the position divided by 69905 and the option to change this number is grayed out.

    when checking the position from the terminal it's the correct number. only the position window shows this number.

     

    the following code is used to setup the virtual motors.

     

    L0=1
    
    
    Ldata.Motor=L0
    //DKILL
    Motor[L0].Ctrl=Sys.PidCtrl    // This can be set to Sys.ServoCtrl for using advanced filters. Sys.PidCtrl adds less CPU load in comparison.
    Motor[L0].ServoCtrl=1	//this value should be larger than 0 for the motor to be activated and used in application.
    Motor[L0].pAmpEnable=0	//If no amplifier-enable flag is used  for the motor, this element should be set to 0, disabling the function for the motor.
    Motor[L0].pAmpFault=0	//If no amplifier-fault flag is used  for the motor, this element should be set to 0, disabling the function for the motor.
    Motor[L0].pLimits=0	//If no hardware overtravel limit flags are used for the motor, this element should be set to 0, disabling the function for the motor.
    Motor[L0].pEnc=EncTable[L0].a	// specifies the address of the register Power PMAC reads for the ongoing outerloop feedback for the motor. The outer loop is virtually always the position loop for the motor.
    Motor[L0].pEnc2=EncTable[L0].a	//specifies the address of the register Power PMAC reads for the ongoing innerloop feedback for the motor. The inner loop is virtually always the velocity loop for the motor.
    Motor[L0].pDac=Sys.Idata[L0].a	//instructs Power PMAC where to place its output command value(s) for Motor by specifying the address of the register. Sys.Idata is a 32-bit signed integer user shared memory buffer.
    EncTable[L0].type=11
    EncTable[L0].pEnc=Motor[L0].IqCmd.a
    EncTable[L0].pEnc1=Sys.pushm
    EncTable[L0].index1=0
    EncTable[L0].index2=0
    EncTable[L0].index3=0
    EncTable[L0].index4=1
    EncTable[L0].index5=255
    EncTable[L0].ScaleFactor=1/(256*(EncTable[L0].index5+1))
    Motor[L0].PosSf=360/(24*exp2(20))
    Motor[L0].Pos2Sf=360/(24*exp2(20))
    //Motor[L0].Pos=10	//power-on servo position
    Motor[L0].AbsPosFormat = $00002000	// have 32-bit signed register for simulated encoder 
    
    Motor[L0].AbsPosSf = 1 // want 1 to 1 in this register 
    Motor[L0].HomeOffset = 0 // no offset 
    
    //Motor[L0].pAbsPos = Sys.UData[100].a 
    
    //Motor[L0].HomePos=150
    Motor[L0].Ctrl=Sys.ServoCtrl
    Motor[L0].FatalFeLimit=10
    Motor[L0].WarnFeLimit=5
    
    // Adjust the following values based upon the application
    
    Motor[L0].MotorTa=10000
    Motor[L0].MotorTs=1000
    Motor[L0].MaxSpeed=0.172
    Motor[L0].JogSpeed=0.005 
    Motor[L0].InvAmax=1/5.471960662E-4 
    Motor[L0].InvJmax=1/5.471960662E-4 
    Motor[L0].InvDmax=1/5.471960662E-4 
    Motor[L0].JogTa=0
    Motor[L0].JogTs=250
    Motor[L0].InPosBand=0.0005
    Motor[L0].InPosTime=9
    
    Motor[L0].Servo.Ke1=0
    Motor[L0].Servo.Ke2=0
    Motor[L0].Servo.Kf1=0
    Motor[L0].Servo.Kf2=0
    Motor[L0].Servo.Ka0=1
    Motor[L0].Servo.Ka1=0
    Motor[L0].Servo.Ka2=0
    Motor[L0].Servo.Ka3=0
    Motor[L0].Servo.Ka4=0
    Motor[L0].Servo.Ka5=0
    Motor[L0].Servo.Ka6=0
    Motor[L0].Servo.Ka7=0
    Motor[L0].Servo.Kb0=1
    Motor[L0].Servo.Kb1=0
    Motor[L0].Servo.Kb2=0
    Motor[L0].Servo.Kb3=0
    Motor[L0].Servo.Kb4=0
    Motor[L0].Servo.Kb5=0
    Motor[L0].Servo.Kb6=0
    Motor[L0].Servo.Kb7=0
    Motor[L0].Servo.Kc1=0
    Motor[L0].Servo.Kc2=0
    Motor[L0].Servo.Kc3=0
    Motor[L0].Servo.Kc4=0
    Motor[L0].Servo.Kc5=0
    Motor[L0].Servo.Kc6=0
    Motor[L0].Servo.Kc7=0
    Motor[L0].Servo.Kd1=0
    Motor[L0].Servo.Kd2=0
    Motor[L0].Servo.Kd3=0
    Motor[L0].Servo.Kd4=0
    Motor[L0].Servo.Kd5=0
    Motor[L0].Servo.Kd6=0
    Motor[L0].Servo.Kd7=0
    Motor[L0].Servo.Kp=8000
    Motor[L0].Servo.Kvifb=0
    Motor[L0].Servo.Kviff=0
    Motor[L0].Servo.Kvfb=0
    Motor[L0].Servo.Kvff=69905.055
    Motor[L0].Servo.Kafb=0
    Motor[L0].Servo.Kaff=69905.055
    Motor[L0].Servo.Ki=9.9999997e-5
    Motor[L0].Servo.Kfff=0
    Motor[L0].Servo.MaxPosErr=10000
    Motor[L0].Servo.MaxInt=28000
    Motor[L0].Servo.BreakPosErr=0
    Motor[L0].Servo.Kbreak=0
    Motor[L0].Servo.OutDbOn=0
    Motor[L0].Servo.OutDbOff=0
    Motor[L0].Servo.OutDbSeed=0
    Motor[L0].Servo.SwPoly7=0
    Motor[L0].Servo.SwFffInt=0
    Motor[L0].Servo.SwZvInt=0
    Motor[L0].Servo.Kxpg=0
    Motor[L0].Servo.Kxvg=0
    Motor[L0].Servo.Kxig=0
    Motor[L0].Servo.EstTime=0
    Motor[L0].Servo.EstMinDac=0
    Motor[L0].Servo.NominalGain=0
    Motor[L0].Servo.MinGainFactor=1
    Motor[L0].Servo.MaxGainFactor=1
    Motor[L0].Servo.MaxW=0
    Motor[L0].Servo.MaxDR=0
    Motor[L0].Servo.MinW=0
    Motor[L0].Servo.MinDR=0
    
    

    Untitled.png.9339776433da072f7793a1d91cd8ba97.png

  15. If you need to have a virtual (simulated or phantom) motor without using any hardware channels, only as a software motor, you can use the following settings. Note that you can have multiple simulated motors with these settings by only changing the L0 value at the beginning of each copy and paste block. The servo tuning should be sufficient for most applications and servo frequencies.

     

    // Virtual Motor Setup for Power PMAC
    
    // Assign the desired motor number to L0
    // If more than one virtual motor is needed, repeat the copy and paste process for the following code
    // and only change the L0 value for each section
    
    //***********************************************************************************//
    
    L0=1
    
    // Copy the following lines without modification
    Ldata.Motor=L0
    DKILL
    Motor[L0].Ctrl=Sys.PidCtrl	// This can be set to Sys.ServoCtrl for using advanced filters. Sys.PidCtrl adds less CPU load in comparison.
    Motor[L0].ServoCtrl=1
    Motor[L0].pAmpEnable=0
    Motor[L0].pAmpFault=0
    Motor[L0].pLimits=0
    Motor[L0].pEnc=EncTable[L0].a
    Motor[L0].pEnc2=EncTable[L0].a
    Motor[L0].pDac=Sys.Idata[L0].a
    EncTable[L0].type=11
    EncTable[L0].pEnc=Motor[L0].IqCmd.a
    EncTable[L0].pEnc1=Sys.pushm
    EncTable[L0].index1=0
    EncTable[L0].index2=0
    EncTable[L0].index3=0
    EncTable[L0].index4=1
    EncTable[L0].index5=255
    EncTable[L0].ScaleFactor=1/(256*(EncTable[L0].index5+1))
    Motor[L0].PosSf=360/(24*exp2(20))
    Motor[L0].Pos2Sf=360/(24*exp2(20))
    Motor[L0].Pos=0
    Motor[L0].HomePos=0
    Motor[L0].Ctrl=Sys.ServoCtrl
    Motor[L0].FatalFeLimit=10
    Motor[L0].WarnFeLimit=5
    
    // Adjust the following values based upon the application
    
    Motor[L0].MotorTa=-1.5E-6
    Motor[L0].MotorTs=-1.5E-6
    Motor[L0].MaxSpeed=0.172
    Motor[L0].JogSpeed=0.005 
    Motor[L0].InvAmax=1/5.471960662E-4 
    Motor[L0].InvJmax=1/5.471960662E-4 
    Motor[L0].InvDmax=1/5.471960662E-4 
    Motor[L0].JogTa=0
    Motor[L0].JogTs=250
    Motor[L0].InPosBand=0.0005
    Motor[L0].InPosTime=9
    
    Motor[L0].Servo.Ke1=0
    Motor[L0].Servo.Ke2=0
    Motor[L0].Servo.Kf1=0
    Motor[L0].Servo.Kf2=0
    Motor[L0].Servo.Ka0=1
    Motor[L0].Servo.Ka1=0
    Motor[L0].Servo.Ka2=0
    Motor[L0].Servo.Ka3=0
    Motor[L0].Servo.Ka4=0
    Motor[L0].Servo.Ka5=0
    Motor[L0].Servo.Ka6=0
    Motor[L0].Servo.Ka7=0
    Motor[L0].Servo.Kb0=1
    Motor[L0].Servo.Kb1=0
    Motor[L0].Servo.Kb2=0
    Motor[L0].Servo.Kb3=0
    Motor[L0].Servo.Kb4=0
    Motor[L0].Servo.Kb5=0
    Motor[L0].Servo.Kb6=0
    Motor[L0].Servo.Kb7=0
    Motor[L0].Servo.Kc1=0
    Motor[L0].Servo.Kc2=0
    Motor[L0].Servo.Kc3=0
    Motor[L0].Servo.Kc4=0
    Motor[L0].Servo.Kc5=0
    Motor[L0].Servo.Kc6=0
    Motor[L0].Servo.Kc7=0
    Motor[L0].Servo.Kd1=0
    Motor[L0].Servo.Kd2=0
    Motor[L0].Servo.Kd3=0
    Motor[L0].Servo.Kd4=0
    Motor[L0].Servo.Kd5=0
    Motor[L0].Servo.Kd6=0
    Motor[L0].Servo.Kd7=0
    Motor[L0].Servo.Kp=8000
    Motor[L0].Servo.Kvifb=0
    Motor[L0].Servo.Kviff=0
    Motor[L0].Servo.Kvfb=0
    Motor[L0].Servo.Kvff=69905.055
    Motor[L0].Servo.Kafb=0
    Motor[L0].Servo.Kaff=69905.055
    Motor[L0].Servo.Ki=9.9999997e-5
    Motor[L0].Servo.Kfff=0
    Motor[L0].Servo.MaxPosErr=10000
    Motor[L0].Servo.MaxInt=28000
    Motor[L0].Servo.BreakPosErr=0
    Motor[L0].Servo.Kbreak=0
    Motor[L0].Servo.OutDbOn=0
    Motor[L0].Servo.OutDbOff=0
    Motor[L0].Servo.OutDbSeed=0
    Motor[L0].Servo.SwPoly7=0
    Motor[L0].Servo.SwFffInt=0
    Motor[L0].Servo.SwZvInt=0
    Motor[L0].Servo.Kxpg=0
    Motor[L0].Servo.Kxvg=0
    Motor[L0].Servo.Kxig=0
    Motor[L0].Servo.EstTime=0
    Motor[L0].Servo.EstMinDac=0
    Motor[L0].Servo.NominalGain=0
    Motor[L0].Servo.MinGainFactor=1
    Motor[L0].Servo.MaxGainFactor=1
    Motor[L0].Servo.MaxW=0
    Motor[L0].Servo.MaxDR=0
    Motor[L0].Servo.MinW=0
    Motor[L0].Servo.MinDR=0
    
    //***********************************************************************************//
    

     

    Hi

    I used this code to simulate 26 virtual motors in my application.

    I want to do some software testing before implementing the code to the real thing.

     

    I found that I can trigger Motor[x].FeFetal by setting motor[x].FatalFeLimit to zero.

    is there any way to trigger other faults like Motor[x].AmpFault, I2TFault or EncLoss, by changing some software variables?

  16. Hi all

     

    I want to get time since startup in a background C app in milliseconds.

    what are the precision and drift of time functions in C like GetPmacRunTime() and GetCPUClock()?

    in the manual these functions return time in seconds and microseconds respectively. However, I was testing with GetPmacRunTime(), I found that it's value has some numbers after the decimal point. Can I use this number to get time in milliseconds just by multiplying by a 1000 or do you suggest better solutions to get milliseconds?

  17. Thanks for your reply. I got the help files for C API.

     

    In functions like GetResponse and Command they return an integer for status.

    0 is OK and negative number for error number. is there any list or information about what are the error numbers for these functions?

    I have done some testing in Command() and found the following error numbers:

    -31 for syntax error.

    -20 for program not open

    -22 for calling a program which is not in buffer.

     

    Are those codes correct?

     

    Thanks

×
×
  • Create New...