Skip to main content
. 2022 Oct 12;22(20):7729. doi: 10.3390/s22207729
Algorithm 1: PID Wavenet Controller
  • 1:

    Read the wavenet parameters: number of neurons Lσ, learning rates (μWσ,μaσ,μbσ), synaptic weight values Wσ and the wavelet ψσ.

  • 2:

    Read the IIR filter parameters: number of feed-backs and feed-forward coefficients, Mσ and Nσ, respectively; learning rates (μCσ,μDσ), the IIR coefficient values (CσDσ) and the persistent signal vσ(k).

  • 3:

    Read the PID controller parameters: gain values (Kpσ,Kiσ,Kdσ) and its update rates (μpσ,μiσ,μdσ).

  • 4:

    Read the operation parameters: number of epochs epks.

  • 5:

    Initialize the internal parameters and k=0.

  • 6:

    while it is working do

  • 7:

        for epk=0;epk≤epks;i++ do

  • 8:

            Get the control signal uσ(k) and the output from plant yσ(k), Equations (39) and (9).

  • 9:

            Compute the vector τLσ(k) using (14).

  • 10:

            Evaluate the mother’s wavelet ψL(τLσ(k)) with (13).

  • 11:

            Compute the wavelet output zσ(k) with (23).

  • 12:

            Compute estimated y^σ(k) using (24).

  • 13:

            Compute the estimated error using (28).

  • 14:

            Compute the energy function Eσ(k) with (27).

  • 15:

            Compute the parameter gradients: ΔWσ(k), Δaσ(k), Δbσ(k), ΔCσ(k), ΔDσ(k), Equations (29)–(33).

  • 16:

            Update the parameter values using its learning ratios: ΔWσ(k+1), Δaσ(k+1), Δbσ(k+1), ΔCσ(k+1), ΔDσ(k+1); Equations (34)–(38).

  • 17:

        end for

  • 18:

        Get the parameter Γ^σ(k) and the tracking error εσ(k), Equations (25) and (40).

  • 19:

        Tune controller gains: Kpσ(k),Kiσ(k),Kdσ(k): Equations (41)–(43).

  • 20:

        Calculate the new control signal u(k+1) using (39).

  • 21:

        Reassign the new values.

  • 22:

        Increase the value of while loop operator, k=k+1.

  • 23:

    end while