Adjust PID, RPM math (still not correct)
This commit is contained in:
parent
e897d25b09
commit
9bce7f0416
4 changed files with 18 additions and 16 deletions
|
|
@ -56,7 +56,7 @@ use alloc::format;
|
|||
static EMERGENCY_BUTTON: Mutex<RefCell<Option<Input>>> = Mutex::new(RefCell::new(None));
|
||||
extern crate alloc;
|
||||
//target RPM
|
||||
const DEFAULT_TARGET_RPM: u32 = 500;
|
||||
const DEFAULT_TARGET_RPM: u32 = 4000;
|
||||
//in seconds
|
||||
const DEFAULT_SPIN_TIME: u32 = 10;
|
||||
// This creates a default app-descriptor required by the esp-idf bootloader.
|
||||
|
|
@ -126,8 +126,8 @@ fn main() -> ! {
|
|||
//PID-Controller
|
||||
let loop_time = Duration::from_micros(10);
|
||||
let cfg = pid::PidConfigBuilder::default()
|
||||
.kp(2.0)
|
||||
.ki(1.5).output_limits(100.00, 2040.00)
|
||||
.kp(3.0)
|
||||
.ki(1.0).output_limits(100.00, 2040.00)
|
||||
.sample_time(loop_time)
|
||||
.filter_tc(0.1)
|
||||
.build()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue