Jump to content
OMRON Forums

Question about basic pid and user servo algorithm


jstkrkim

Recommended Posts

Hello there,

 

I build simulink user servo algorithm as figure(a.jpg), following diagram from Power pmac user manual(b.jpg).

 

and Tuning control gain(kp, ki, kvff, kvfb) to work motor well.

 

then, The Same motor apply Basic PID(Motor[x].Ctrl=Sys.PidCtrl) with same gain.

 

I assume both of control gain are same but the motor servo off due to exceed following error limit.

 

The Basic PID in Power pmac is something different with the diagram in manual(b.jpg)?

 

The Servo frequency is 6kHz both of them. (at Simulink config, setting fixed step 1/6000)

 

Applying about 1/100 smaller kvff, kvfb gain than user servo, basic PID algorithm applied motor seems to control well.

b.jpg.e8a5f876da93f029b628700f1920a88d.jpg

a.jpg.58ac50dae27b1b634bafa6f3017799b0.jpg

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

You might be forgetting a few scale factors present in the actual servo loop. See the diagram below:

 

sfdiagram.png.3e07eecd1a5c15e55afdd58f307cdc89.png

 

Motor[x]. structures use “Motor Units” or M.U.s for length units

 

A Motor Unit is the resultant of the following multiplications:

  • The Encoder Conversion Table (ECT) processes raw feedback and its “raw” units are multiplied by EncTable[n].ScaleFactor, resulting in a floating-point number, before being multiplied by Motor[x].PosSf or Motor[x].Pos2Sf and used in the servo loop.
  • Delta Tau recommends setting EncTable[n].ScaleFactor such that the ECT entry’s output is in units of the feedback sensor (e.g. quadrature counts, ADC LSBs, etc.) to make troubleshooting easier.
  • For the position loop, Motor[x].PosSf multiplies the output of the Encoder Conversion Table entry to which Motor[x].pEnc points (i.e. an EncTable[n].a address).
  • For the velocity loop, Motor[x].Pos2Sf multiplies the output of the Encoder Conversion Table entry to which Motor[x].pEnc2 points (i.e. an EncTable[n].a address).
  • All of the above scale factors are effectively gain terms in the servo loop
  • It is up to the user’s preference whether the Motor Units are in “raw” feedback units (e.g. counts) at the same scale as the output of the ECT (usually when Motor[x].PosSf = Motor[x].Pos2Sf = 1.0)
  • Many of the default motor parameters are set for reasonable values in units of counts and would have to be changed dramatically if the motor units were engineering units (e.g. mm or degree), but when using kinematics, having Motor Units in engineering units can make the programming more convenient

Link to comment
Share on other sites

Thank you for your prompt reply.

 

I check my Power pmac system variables follow your mentions, but Motor[x].PosSf, Motor[x].Pos2Sf are set as 1.

 

and I use just one positional encoder.(it means motor[x].PosSf=motor[1].Pos2Sf, motor[x].Actpos=motor[x].Actpos2, too.)

 

As you attached diagram, if i use Motor[1].ActPos variable, this variable is already multiplied scale factors(Enctable.scalefactor, motor[x].Possf).

and CompTable are applied also.(In my case, CompTable are empty)

 

Don't know why different Basic PID with user algorithm by Simulink. it just simple and same structure PI-D controller

Link to comment
Share on other sites

  • 2 months later...

Ki, Kvff and Kvfb in the Sys.PidCtrl algorithm are equivalent to Ts*Ki, Kvff/Ts and Kvfb/Ts in the Simulink model respectively. Here Ts=1/6000.

This is because -as you see in the pictures- the content of the discrete time integrator blocks for example in the Sys.PidCtrl diagram reads Ki/(1-z^(-1)) but in the Simulink diagram the block content reads K*Ts/(1-z^(-1))*Ki. So you would need to multiply (divide) all your Simulink derivative (integrator) gains by 6000. Kp must remain untouched.

 

Also, verify that in the generated code, the servo rate of 6000 has appeared and not the default servo rate

Link to comment
Share on other sites

  • 3 years later...
I want to know how to set the upper limit value and lower limit value of saturation block in the above diagram,we all know that the Motor[x].MaxDac=32768 means that the Power Pmac controller output ±10v analog voltage,but if I build my servo algorithm in simulink,because the saturation block have two value need to set( upper limit and lower limit) how to set the saturation?
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...