All the design above is based on continuous time. In order to make the control algorithm executable in the
DSP, discretization must be done to the equations of each block in the continuous system which are listed
at the end of each section in this chapter. Since the control loop frequency is 10kHz, which means that
the control loop period is 0.1ms, the sampling period h for the discretized system is selected as 0.1ms. As
mentioned in Sec. 2.3.2, at a certain time instant t = kh, in one cycle of the control loop sampling takes
place firstly, then the sampled values at t = kh are passed down into the function block chain in Fig. 2.8.
Then each block takes its input signals and stored state variables into calculation, derives its output to feed
into the next block and then get its state variable updated for the next iteration at time instant t = (k + 1)h.
In this project, Forward Euler approximation is used to transform the continuous system into discrete
system.With x(t) defined as a continuous variable, x[kh] as its value at the current time instant and x[(k +
1)h] for the next time instant, as illustrated in Fig. 5.11 the derivatives can be approximated with a forward
difference as [40]