[−][src]Struct automatica::controller::pid::Pid
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 coefficientti
- Integral timetd
- Derivative time
Example
use automatica::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 coefficientti
- Integral timetd
- Derivative timen
- Constant for additional pole
Example
use automatica::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 automatica; use automatica::{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
Auto Trait Implementations
impl<T> RefUnwindSafe for Pid<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Pid<T> where
T: Send,
T: Send,
impl<T> Sync for Pid<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Pid<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Pid<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,