What does Ki*Ts mean in Discrete PI controller in Simulink (MATLAB 2020a) ? - Page 1
Forum section: electronics / beginners

author: cadena
author_rank: Contributor
timestamp: April 15, 2020, 11:22:33 am
content: 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

author: Rerouter
author_rank: Super Contributor
timestamp: April 15, 2020, 11:33:41 am
content: 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.

author: cadena
author_rank: Contributor
timestamp: April 15, 2020, 12:21:08 pm
content: 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.

author: Rerouter
author_rank: Super Contributor
timestamp: April 15, 2020, 01:38:19 pm
content: Never used simulink I am afraid, just used to time scaled control systems.

author: IanB
author_rank: Super Contributor
timestamp: April 15, 2020, 02:08:00 pm
content: Quote from: cadena on April 15, 2020, 11:22:33 amOK, that documentation is a bit inadequate.One question:QuoteWhat 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.

author: IanB
author_rank: Super Contributor
timestamp: April 15, 2020, 04:11:16 pm
content: 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.