Author Topic: What does Ki*Ts mean in Discrete PI controller in Simulink (MATLAB 2020a) ?  (Read 1478 times)

0 Members and 1 Guest are viewing this topic.

Offline cadenaTopic starter

  • Contributor
  • Posts: 28
  • Country: gb
Hi everyone,

I am using a Discrete PI controller for an FOC algorithm I am developing in Simulink using the Motor Control Blockset. I would like to use a Ki gain if 2. At the input of the block, I have an input labelled Ki*Ts. If I use my gain with a sampling period of, let's say 1ms, should Ki*Ts = 2e-3 ? What would be an appropiate sampling period (Ts) and what would be the reason for it ? Please any help would be really appreciated.

Discrete PI controller Documentation: https://www.mathworks.com/help/mcb/ref/discretepicontroller.html
« Last Edit: April 15, 2020, 11:29:30 am by cadena »
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4706
  • Country: au
  • Question Everything... Except This Statement
Re: What does Ki*Ts mean in Discrete PI controller ?
« Reply #1 on: April 15, 2020, 11:33:41 am »
Ki is a scaling factor assuming a base of 1 second (old textbook math might be over 1 minute depending on where you learned it, but the device in question usually specifies it)
So if your reacting on the input at say a rate of 100Hz, Ki*Ts really is (Ki / Hz) because your reacting faster than once a second, you need to cut down how much you react each time step for the same effect.

Strongly built PID libraries may make use of variable time scaling (don't recall the exact term), where it counts how long since it last fired, e.g. a comms packet makes it miss 4 sampling windows, so the next response is scaled up 5 times more than usual to compensate smoothly.

In my own testing the square root of the time missed tended to give slightly smoother responses, but expensive operation if not precomputed.
« Last Edit: April 15, 2020, 11:40:43 am by Rerouter »
 

Offline cadenaTopic starter

  • Contributor
  • Posts: 28
  • Country: gb
Hi @Rerouter, thanks for your reply. So if i am using a gain of 2 at a rate of 100 Hz, then it would be 2/100 = 0.02 ? Also have you previously used Motor Control Blockset in Simulink ? I am haing a few issues underdstanding how to use some of the blocks included and your help would be more than appreciated.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4706
  • Country: au
  • Question Everything... Except This Statement
Never used simulink I am afraid, just used to time scaled control systems.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12794
  • Country: us
Hi everyone,

I am using a Discrete PI controller for an FOC algorithm I am developing in Simulink using the Motor Control Blockset. I would like to use a Ki gain if 2. At the input of the block, I have an input labelled Ki*Ts. If I use my gain with a sampling period of, let's say 1ms, should Ki*Ts = 2e-3 ? What would be an appropiate sampling period (Ts) and what would be the reason for it ? Please any help would be really appreciated.

Discrete PI controller Documentation: https://www.mathworks.com/help/mcb/ref/discretepicontroller.html

OK, that documentation is a bit inadequate.

One question:

Quote
I would like to use a Ki gain if 2.

What are your units of measure of Ki? When you do engineering, everything has a unit of measure. A value of "2" by itself is not properly defined unless you state what its units are (which could be dimensionless).

The integral constant of a PI controller can have one of two units, typically: either "input units per output unit by time units" (Ti) or "output units per input unit per time unit" (Ki). If the input units are motor speed in rpm, the time units are seconds, and the output is percent of control range, then the units of Ki would be "%/rpm/sec" for example.

If we change the input units to percent of measurement range, then the units above would become "%out/%in/sec" and the percents cancel giving units of "1/sec". This is often called "repeats per second".

If we want Ki to be dimensionless, then we can multiply it by some scaling time (e.g. the sampling time Ts), and then Ki*Ts has units of (1/sec * sec) which becomes dimensionless. I suspect this is what is intended here.

But without seeing actual details of how the calculation is performed the documentation is insufficient and it would require either inspection or experimentation to find out exactly what the Ki parameter does.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12794
  • Country: us
A simple answer to your question, however:

Since "Ki*Ts" is dimensionless, and a value of "2" is dimensionless (has no stated units of measure), you could reasonable assign Ki*Ts = 2 and achieve your stated objective. If 2 is not a good value you could adjust it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf