Struct au::controller::pid::Pid[][src]

pub struct Pid<T: Float> { /* fields omitted */ }

Proportional-Integral-Derivative controller

Implementations

impl<T: Float> Pid<T>[src]

Implementation of Pid methods

pub fn new_ideal(kp: T, ti: T, td: T) -> Self[src]

Create a new ideal PID controller

Arguments

  • kp - Proportional action coefficient
  • ti - Integral time
  • td - Derivative time

Example

use au::controller::pid::Pid;
let pid = Pid::new_ideal(4., 6., 0.1);

pub fn new(kp: T, ti: T, td: T, n: T) -> Self[src]

Create a new real PID controller

Arguments

  • kp - Proportional action coefficient
  • ti - Integral time
  • td - Derivative time
  • n - Constant for additional pole

Example

use au::controller::pid::Pid;
let pid = Pid::new(4., 6., 12., 0.1);

pub fn tf(&self) -> Tf<T>[src]

Calculate the transfer function of the PID controller

Real PID

         1         Td
Kp (1 + ---- + ---------- s) =
        Ti*s   1 + Td/N*s

     N + (Ti*N +Td)s + Ti*Td(1 + N)s^2
= Kp ----------------------------------
            Ti*N*s + Ti*Td*s^2

Ideal PID

   1 + Ti*s + Ti*Td*s^2
Kp --------------------
          Ti*s

Example

#[macro_use] extern crate au;
use au::{controller::pid::Pid, Tf};
let pid = Pid::new_ideal(2., 2., 0.5);
let tf = Tf::new(poly![1., 2., 1.], poly![0., 1.]);
assert_eq!(tf, pid.tf());

Trait Implementations

impl<T: Debug + Float> Debug for Pid<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Pid<T> where
    T: RefUnwindSafe

impl<T> Send for Pid<T> where
    T: Send

impl<T> Sync for Pid<T> where
    T: Sync

impl<T> Unpin for Pid<T> where
    T: Unpin

impl<T> UnwindSafe for Pid<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,