Hal-Histogram

More
29 Jul 2016 04:08 #78124 by Todd Zuercher
Hal-Histogram was created by Todd Zuercher
Is there a way to use Hal-Histogram to monitor a parameter?
such as for example to log the data from motion.servo.last-period-ns.

Please Log in or Create an account to join the conversation.

More
29 Jul 2016 12:38 - 29 Jul 2016 12:39 #78134 by dgarrett
Replied by dgarrett on topic Hal-Histogram

hal-histogram works for pins only but a pin is provided for
measuring each thread time (in clocks).
Example:
$ hal-histogram servo.thread.time
You will have to adjust the minvalue,binsize,nbins either
interactively or from the command line.

Ref:
$ hal-histogram --help
Usage:
   hal-histogram --help | -?
or
   hal-histogram [Options] [pinname]

Options:
  --minvalue  minvalue (minimum bin, default: 0)
  --binsize   binsize  (binsize, default: 100)
  --nbins     nbins    (number of bins, default: 50)

  --logscale  0|1      (y axis log scale, default: 1)
  --text      note     (text display, default: "" )
  --show               (show count of undisplayed nbins, default off)
  --verbose            (progress and debug, default off)

Notes:
  1) LinuxCNC (or another Hal application) must be running
  2) If no pinname is specified, default is: motion-command-handler.time
  3) This app may be opened for 5 pins
  4) pintypes float, s32, u32, bit are supported
  5) The pin must be associated with a thread supporting floating point
     For a base thread, this may require using:
     loadrt motmod ... base_thread_fp=1
Attachments:
Last edit: 29 Jul 2016 12:39 by dgarrett.

Please Log in or Create an account to join the conversation.

More
29 Jul 2016 13:06 - 29 Jul 2016 13:07 #78136 by Todd Zuercher
Replied by Todd Zuercher on topic Hal-Histogram
I knew all that. but the pin servo.thread time is not equivalent of the parameter motion.servo.last-period. It looks like servo.thread.time is the amount of time used to execute all the functions. Useful info but tells you nothing about system latency unless your system can't process the servo-thread fastenough. Where as motion.servo.last-period is the length of the actual servo thread including jitter There are a number of Parameters that I could see it being very useful (or at least interesting) to observe with Hal-Histogram

My question, is there a workaround to make Hal-Histogram work with parameters, like Halmeter or Halscope can?
Last edit: 29 Jul 2016 13:07 by Todd Zuercher.

Please Log in or Create an account to join the conversation.

More
29 Jul 2016 13:58 #78138 by dgarrett
Replied by dgarrett on topic Hal-Histogram

is there a workaround to make Hal-Histogram work with parameters, like
Halmeter or Halscope can?


No-- hal-histogram provides input pins which must be connected by hal signals
to appropriate hal output pins. You could modify the source code to
change certain parameters to pins for your purposes.

An alternative method uses hal-histogram in conjunction with the
hal latencybins component that is used by the latency-histogram program.
(The latency-histogram program is not usable when linuxcnc is running).

Thisi latencybins component provides a hal pin for latency, and it
can be connected to hal-histogram using the method shown in the image.


Attachments:

Please Log in or Create an account to join the conversation.

More
29 Jul 2016 15:13 #78143 by Todd Zuercher
Replied by Todd Zuercher on topic Hal-Histogram
Would it be possible to write a simple userspace component that could input a parameter value and output that as a hal output pin? (or might something like this already exist?)

Please Log in or Create an account to join the conversation.

More
24 Jan 2017 13:13 #86554 by DomCa
Replied by DomCa on topic Hal-Histogram
Hi,

I am measuring latency on my system with the above method. I now wonder if it would make any difference measuring the base thread instead of the servo thread.

Would it be possible to measure the base-thread with the above? Exchanging the "servo-thread" with "base-thread" did not work for me...

Thanks
DomCa

Please Log in or Create an account to join the conversation.

More
24 Jan 2017 13:37 #86557 by Todd Zuercher
Replied by Todd Zuercher on topic Hal-Histogram
I think any thread that it is associated with has to be a floating point thread,
To load a base thread with a floating point use loadrt motmod ... base_thread_fp=1 (With the ... being what ever else what already on that line in your hal file.)

Please Log in or Create an account to join the conversation.

More
24 Jan 2017 14:00 #86558 by DomCa
Replied by DomCa on topic Hal-Histogram
Hi Todd,
sorry to ask again, but I only have the servo-thread and motmoto is allready loaded.

I am using the axis simulation that is automatically selected when starting linuxcnc.
Can you give me some guidance on how to get a 25ns instead of the 1000ns base thread that I can analyze with the histogram?

Thanks
DomCa

Please Log in or Create an account to join the conversation.

More
24 Jan 2017 14:34 #86562 by Todd Zuercher
Replied by Todd Zuercher on topic Hal-Histogram
The line would be something like this.
loadrt motmod base_period_nsec=25000  base_thread_fp=1 servo_period_nsec=1000000 num_joints=3
but it could look more like this using ini variables.
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD  base_thread_fp=1 servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES

Please Log in or Create an account to join the conversation.

More
25 Jan 2017 07:02 #86598 by DomCa
Replied by DomCa on topic Hal-Histogram
Thanks Todd,

Your help is realy appreaciated. However, I am getting an error because motmod is allready loaded. I am still using the axis Simulation.

If there is an easy fix, I would be glad.
However, I'm still learning inuxCNC and that goes beyond my knowledge at the moment. I will go on digging into LinuxCNC and come back.

Until then I will assume that the latency I am getting for the 1000ns thread is similar fo the 25ns thread and go on building my CNC.

Thanks
DomCa

Please Log in or Create an account to join the conversation.

Time to create page: 0.105 seconds
Powered by Kunena Forum