just testing with the magic value
This commit is contained in:
parent
808b44b1f4
commit
0e97a15fab
2 changed files with 4 additions and 4 deletions
|
|
@ -323,7 +323,7 @@ impl<'a> DShot<'a> {
|
||||||
let erpm = (60 * 1_000_000) / period_ms;
|
let erpm = (60 * 1_000_000) / period_ms;
|
||||||
|
|
||||||
let rpm = erpm/XING_EPRO_22_POLES;
|
let rpm = erpm/XING_EPRO_22_POLES;
|
||||||
self.rpm.set(Some(rpm))
|
self.rpm.set(Some((rpm as f32 / 1.7) as _))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,8 +126,8 @@ fn main() -> ! {
|
||||||
//PID-Controller
|
//PID-Controller
|
||||||
let loop_time = Duration::from_micros(10);
|
let loop_time = Duration::from_micros(10);
|
||||||
let cfg = pid::PidConfigBuilder::default()
|
let cfg = pid::PidConfigBuilder::default()
|
||||||
.kp(3.0)
|
.kp(2.0)
|
||||||
.ki(1.0).output_limits(100.00, 2040.00)
|
.ki(0.1).output_limits(100.00, 2040.00)
|
||||||
.sample_time(loop_time)
|
.sample_time(loop_time)
|
||||||
.filter_tc(0.1)
|
.filter_tc(0.1)
|
||||||
.build()
|
.build()
|
||||||
|
|
@ -137,7 +137,7 @@ fn main() -> ! {
|
||||||
let set_point = DEFAULT_TARGET_RPM;
|
let set_point = DEFAULT_TARGET_RPM;
|
||||||
dshot_esc.arm();
|
dshot_esc.arm();
|
||||||
let mut rpm = 0;
|
let mut rpm = 0;
|
||||||
let mut control: f32 = 200.0;
|
let mut control: f32 = 600.0;
|
||||||
// let timestamp = Instant::now();
|
// let timestamp = Instant::now();
|
||||||
loop {
|
loop {
|
||||||
dshot_esc.process();
|
dshot_esc.process();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue