@@ -405,14 +405,14 @@ mod tests {
405405 pid. p ( 0.0 , 100.0 ) . i ( 0.0 , 100.0 ) . d ( 2.0 , 100.0 ) ;
406406
407407 // Test that there's no derivative since it's the first measurement
408- assert_eq ! ( pid_next_control_output!( pid, 0.0 , 1.0 ) . output, 0.0 ) ;
408+ assert_eq ! ( pid_next_control_output!( pid, 0.0 ) . output, 0.0 ) ;
409409
410410 // Test that there's now a derivative
411- assert_eq ! ( pid_next_control_output!( pid, 5.0 , 1.0 ) . output, -10.0 ) ;
411+ assert_eq ! ( pid_next_control_output!( pid, 5.0 ) . output, -10.0 ) ;
412412
413413 // Test derivative limit
414414 pid. d_limit = 5.0 ;
415- assert_eq ! ( pid_next_control_output!( pid, 10.0 , 1.0 ) . output, -5.0 ) ;
415+ assert_eq ! ( pid_next_control_output!( pid, 10.0 ) . output, -5.0 ) ;
416416 }
417417
418418 /// Integral-only controller operation and limits
@@ -422,26 +422,26 @@ mod tests {
422422 pid. p ( 0.0 , 100.0 ) . i ( 2.0 , 100.0 ) . d ( 0.0 , 100.0 ) ;
423423
424424 // Test basic integration
425- assert_eq ! ( pid_next_control_output!( pid, 0.0 , 1.0 ) . output, 20.0 ) ;
426- assert_eq ! ( pid_next_control_output!( pid, 0.0 , 1.0 ) . output, 40.0 ) ;
427- assert_eq ! ( pid_next_control_output!( pid, 5.0 , 1.0 ) . output, 50.0 ) ;
425+ assert_eq ! ( pid_next_control_output!( pid, 0.0 ) . output, 20.0 ) ;
426+ assert_eq ! ( pid_next_control_output!( pid, 0.0 ) . output, 40.0 ) ;
427+ assert_eq ! ( pid_next_control_output!( pid, 5.0 ) . output, 50.0 ) ;
428428
429429 // Test limit
430430 pid. i_limit = 50.0 ;
431- assert_eq ! ( pid_next_control_output!( pid, 5.0 , 1.0 ) . output, 50.0 ) ;
431+ assert_eq ! ( pid_next_control_output!( pid, 5.0 ) . output, 50.0 ) ;
432432 // Test that limit doesn't impede reversal of error integral
433- assert_eq ! ( pid_next_control_output!( pid, 15.0 , 1.0 ) . output, 40.0 ) ;
433+ assert_eq ! ( pid_next_control_output!( pid, 15.0 ) . output, 40.0 ) ;
434434
435435 // Test that error integral accumulates negative values
436436 let mut pid2 = Pid :: new ( -10.0 , 100.0 ) ;
437437 pid2. p ( 0.0 , 100.0 ) . i ( 2.0 , 100.0 ) . d ( 0.0 , 100.0 ) ;
438- assert_eq ! ( pid_next_control_output!( pid2, 0.0 , 1.0 ) . output, -20.0 ) ;
439- assert_eq ! ( pid_next_control_output!( pid2, 0.0 , 1.0 ) . output, -40.0 ) ;
438+ assert_eq ! ( pid_next_control_output!( pid2, 0.0 ) . output, -20.0 ) ;
439+ assert_eq ! ( pid_next_control_output!( pid2, 0.0 ) . output, -40.0 ) ;
440440
441441 pid2. i_limit = 50.0 ;
442- assert_eq ! ( pid_next_control_output!( pid2, -5.0 , 1.0 ) . output, -50.0 ) ;
442+ assert_eq ! ( pid_next_control_output!( pid2, -5.0 ) . output, -50.0 ) ;
443443 // Test that limit doesn't impede reversal of error integral
444- assert_eq ! ( pid_next_control_output!( pid2, -15.0 , 1.0 ) . output, -40.0 ) ;
444+ assert_eq ! ( pid_next_control_output!( pid2, -15.0 ) . output, -40.0 ) ;
445445 }
446446
447447 /// Checks that a full PID controller's limits work properly through multiple output iterations
@@ -450,11 +450,11 @@ mod tests {
450450 let mut pid = Pid :: new ( 10.0 , 1.0 ) ;
451451 pid. p ( 1.0 , 100.0 ) . i ( 0.0 , 100.0 ) . d ( 0.0 , 100.0 ) ;
452452
453- let out = pid_next_control_output ! ( pid, 0.0 , 1.0 ) ;
453+ let out = pid_next_control_output ! ( pid, 0.0 ) ;
454454 assert_eq ! ( out. p, 10.0 ) ; // 1.0 * 10.0
455455 assert_eq ! ( out. output, 1.0 ) ;
456456
457- let out = pid_next_control_output ! ( pid, 20.0 , 1.0 ) ;
457+ let out = pid_next_control_output ! ( pid, 20.0 ) ;
458458 assert_eq ! ( out. p, -10.0 ) ; // 1.0 * (10.0 - 20.0)
459459 assert_eq ! ( out. output, -1.0 ) ;
460460 }
@@ -465,25 +465,25 @@ mod tests {
465465 let mut pid = Pid :: new ( 10.0 , 100.0 ) ;
466466 pid. p ( 1.0 , 100.0 ) . i ( 0.1 , 100.0 ) . d ( 1.0 , 100.0 ) ;
467467
468- let out = pid_next_control_output ! ( pid, 0.0 , 1.0 ) ;
468+ let out = pid_next_control_output ! ( pid, 0.0 ) ;
469469 assert_eq ! ( out. p, 10.0 ) ; // 1.0 * 10.0
470470 assert_eq ! ( out. i, 1.0 ) ; // 0.1 * 10.0
471471 assert_eq ! ( out. d, 0.0 ) ; // -(1.0 * 0.0)
472472 assert_eq ! ( out. output, 11.0 ) ;
473473
474- let out = pid_next_control_output ! ( pid, 5.0 , 1.0 ) ;
474+ let out = pid_next_control_output ! ( pid, 5.0 ) ;
475475 assert_eq ! ( out. p, 5.0 ) ; // 1.0 * 5.0
476476 assert_eq ! ( out. i, 1.5 ) ; // 0.1 * (10.0 + 5.0)
477477 assert_eq ! ( out. d, -5.0 ) ; // -(1.0 * 5.0)
478478 assert_eq ! ( out. output, 1.5 ) ;
479479
480- let out = pid_next_control_output ! ( pid, 11.0 , 1.0 ) ;
480+ let out = pid_next_control_output ! ( pid, 11.0 ) ;
481481 assert_eq ! ( out. p, -1.0 ) ; // 1.0 * -1.0
482482 assert_eq ! ( out. i, 1.4 ) ; // 0.1 * (10.0 + 5.0 - 1)
483483 assert_eq ! ( out. d, -6.0 ) ; // -(1.0 * 6.0)
484484 assert_eq ! ( out. output, -5.6 ) ;
485485
486- let out = pid_next_control_output ! ( pid, 10.0 , 1.0 ) ;
486+ let out = pid_next_control_output ! ( pid, 10.0 ) ;
487487 assert_eq ! ( out. p, 0.0 ) ; // 1.0 * 0.0
488488 assert_eq ! ( out. i, 1.4 ) ; // 0.1 * (10.0 + 5.0 - 1.0 + 0.0)
489489 assert_eq ! ( out. d, 1.0 ) ; // -(1.0 * -1.0)
@@ -502,8 +502,8 @@ mod tests {
502502
503503 for _ in 0 ..5 {
504504 assert_eq ! (
505- pid_next_control_output!( pid_f32, 0.0 , 1.0 ) . output,
506- pid_next_control_output!( pid_f64, 0.0 , 1.0 ) . output as f32
505+ pid_next_control_output!( pid_f32, 0.0 ) . output,
506+ pid_next_control_output!( pid_f64, 0.0 ) . output as f32
507507 ) ;
508508 }
509509 }
@@ -532,7 +532,7 @@ mod tests {
532532 let mut pid = Pid :: new ( 10.0 , 100.0 ) ;
533533 pid. p ( 1.0 , 100.0 ) . i ( 0.1 , 100.0 ) . d ( 1.0 , 100.0 ) ;
534534
535- let out = pid_next_control_output ! ( pid, 0.0 , 1.0 ) ;
535+ let out = pid_next_control_output ! ( pid, 0.0 ) ;
536536 assert_eq ! ( out. p, 10.0 ) ; // 1.0 * 10.0
537537 assert_eq ! ( out. i, 1.0 ) ; // 0.1 * 10.0
538538 assert_eq ! ( out. d, 0.0 ) ; // -(1.0 * 0.0)
@@ -541,7 +541,7 @@ mod tests {
541541 pid. setpoint ( 0.0 ) ;
542542
543543 assert_eq ! (
544- pid_next_control_output!( pid, 0.0 , 1.0 ) ,
544+ pid_next_control_output!( pid, 0.0 ) ,
545545 ControlOutput {
546546 p: 0.0 ,
547547 i: 1.0 ,
@@ -557,7 +557,7 @@ mod tests {
557557 let mut pid = Pid :: new ( 10.0f32 , -10.0 ) ;
558558 pid. p ( 1.0 , -50.0 ) . i ( 1.0 , -50.0 ) . d ( 1.0 , -50.0 ) ;
559559
560- let out = pid_next_control_output ! ( pid, 0.0 , 1.0 ) ;
560+ let out = pid_next_control_output ! ( pid, 0.0 ) ;
561561 assert_eq ! ( out. p, 10.0 ) ;
562562 assert_eq ! ( out. i, 10.0 ) ;
563563 assert_eq ! ( out. d, 0.0 ) ;
0 commit comments