Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve end to end control latency measurement #9388

Merged
merged 1 commit into from
May 2, 2018
Merged

Conversation

dagar
Copy link
Member

@dagar dagar commented Apr 30, 2018

pixracer (multicopter)

nsh> perf
fmu control latency: 31096 events, 6985713us elapsed, 224us avg, min 201us max 566us 16.366us rms

pixracer (fixedwing)

nsh> perf
fmu control latency: 3182 events, 1534797us elapsed, 482us avg, min 171us max 5798us 395.665us rms

pixhawk 2 (multicopter)

nsh> perf
fmu control latency: 0 events, 0us elapsed, 0us avg, min 0us max 0us 0.000us rms
io control latency: 1016 events, 290388us elapsed, 285us avg, min 225us max 621us 33.261us rms

pixhawk 2 (fixedwing)

nsh> perf
fmu control latency: 0 events, 0us elapsed, 0us avg, min 0us max 0us 0.000us rms
io control latency: 5014 events, 2387356us elapsed, 476us avg, min 156us max 1745us 362.783us rms

pixhawk 2 (VTOL)

nsh> perf
fmu control latency: 29874 events, 445943798us elapsed, 14927us avg, min 3747us max 28028us 6376.741us rms
io control latency: 25358 events, 10419801us elapsed, 410us avg, min 316us max 1397us 35.020us rms

@dagar
Copy link
Member Author

dagar commented Apr 30, 2018

Note the VTOL FW output (fmu/aux outputs). This is mainly the result of the fmu module running in the high priority work queue. A small portion is also the vtol attitude controller. The FW numbers are still only counting the time from the vehicle_attitude publication.

@@ -1338,6 +1336,17 @@ PX4FMU::cycle()
up_pwm_update();
}

// use first valid timestamp_sample for latenccy tracking
for (uint8_t i = 0; i < actuator_controls_s::NUM_ACTUATOR_CONTROL_GROUPS; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • typo: latenccy
  • can you use int i = 0?
  • can you move this block after orb_publish_auto(ORB_ID(actuator_outputs) and use actuator_outputs.timestamp instead of hrt_elapsed_time?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dagar
Copy link
Member Author

dagar commented May 1, 2018

Comments addressed and I also added the perf counter to linux_pwm_out, snapdragon_pwm_out, and pwm_out_sim for consistency.

@dagar dagar merged commit 977ab4e into master May 2, 2018
@dagar dagar deleted the pr-ctrl_latency branch May 2, 2018 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants