3 unstable releases

0.2.1 Jan 29, 2024
0.2.0 Jan 19, 2024
0.1.0 Jan 14, 2024

#380 in Embedded development

Download history 12/week @ 2024-01-13 1/week @ 2024-01-20 5/week @ 2024-01-27 8/week @ 2024-02-17 47/week @ 2024-02-24 6/week @ 2024-03-02 6/week @ 2024-03-16 43/week @ 2024-03-23 30/week @ 2024-03-30 1/week @ 2024-04-06

74 downloads per month

MIT/Apache

135KB
112 lines

SOGI-PLL


docs.rs Crates.io

Crates.io


Demo

Pure Sine Wave

SOGI-PLL With A Pure Sine Wave

Distorted Sine Wave

SOGI-PLL With A Distorted Sine Wave


You can find the code used to generate these images in the examples folder.


lib.rs:

SOGI-PLL implementation

Based on: https://ieeexplore.ieee.org/document/1711988

Usage:

let mut pll = SogiPll::new(config);

// Call .update every sample_time s
let result = pll.update(measured_voltage);

Recommended parameters:

sogi_k: 1.0
pi_proportional_gain: 178.0,
pi_integral_gain: 0.0001
sample_rate > 1000Hz

K, Kp, Ki for 50Hz taken from here

Dependencies

~220KB