halsampler source code
- southbayguy
- Offline
- Senior Member
Less
More
- Posts: 63
- Thank you received: 1
20 Jun 2014 10:55 #48136
by southbayguy
halsampler source code was created by southbayguy
Where is halsampler source code? I can't find it in linuxcnc-dev.
On the Z axis of my 3-axis router, I have a rotary encoder with a five inch long finger attached to it. The tip of the finger rests on a 3D model on the table. With a G code program, I draw the finger in successive passes across the 3-D model and use sampler and halsampler to develop XYZ data describing the contour of the 3D model.
My problem is too much data. Sampler is running all the time, glomming XYZ data all the time, even while the finger is clear of the model preparing for another data gathering pass. Also, even during a data gathering pass (when the finger is tracing across the surface of the 3D model), I don't need XYZ data every millisecond. I need to gather a pattern of points .010 to .030 apart. I'm sure that's fine enough to reproduce the model to adequate accuracy.
I want to tweak halsampler so as it reads sampler data from the sampler fifo it filters it on the fly and only writes useful data to the output file.
Thanks.
On the Z axis of my 3-axis router, I have a rotary encoder with a five inch long finger attached to it. The tip of the finger rests on a 3D model on the table. With a G code program, I draw the finger in successive passes across the 3-D model and use sampler and halsampler to develop XYZ data describing the contour of the 3D model.
My problem is too much data. Sampler is running all the time, glomming XYZ data all the time, even while the finger is clear of the model preparing for another data gathering pass. Also, even during a data gathering pass (when the finger is tracing across the surface of the 3D model), I don't need XYZ data every millisecond. I need to gather a pattern of points .010 to .030 apart. I'm sure that's fine enough to reproduce the model to adequate accuracy.
I want to tweak halsampler so as it reads sampler data from the sampler fifo it filters it on the fly and only writes useful data to the output file.
Thanks.
Please Log in or Create an account to join the conversation.
20 Jun 2014 13:18 - 20 Jun 2014 15:26 #48138
by ArcEye
Replied by ArcEye on topic halsampler source code
Hi
You need the source code
buildbot.linuxcnc.org/dists/lucid/v2.5_b...4.28.gea8e59a.tar.gz
will give you the sources for the last 2.5.4 release.
Then you will need to build your new halsampler, but will wait for that Q as it arises
regards
Where is halsampler source code? I can't find it in linuxcnc-dev.
You need the source code
buildbot.linuxcnc.org/dists/lucid/v2.5_b...4.28.gea8e59a.tar.gz
will give you the sources for the last 2.5.4 release.
Then you will need to build your new halsampler, but will wait for that Q as it arises
regards
Last edit: 20 Jun 2014 15:26 by ArcEye.
The following user(s) said Thank You: southbayguy
Please Log in or Create an account to join the conversation.
20 Jun 2014 17:44 #48143
by BigJohnT
Replied by BigJohnT on topic halsampler source code
Sounds more like a probing job to me. Take a look at the sample probing G code file.
JT
JT
The following user(s) said Thank You: southbayguy
Please Log in or Create an account to join the conversation.
20 Jun 2014 19:02 #48144
by PCW
Replied by PCW on topic halsampler source code
Also can't this all be done in HAL by manipulating the sampler.0.enable pin?
(set it false when idle, and then only true every 10 or 30 samples for .010 or .030 second sample rate)
(set it false when idle, and then only true every 10 or 30 samples for .010 or .030 second sample rate)
The following user(s) said Thank You: southbayguy
Please Log in or Create an account to join the conversation.
- southbayguy
- Offline
- Senior Member
Less
More
- Posts: 63
- Thank you received: 1
23 Jun 2014 07:30 #48190
by southbayguy
Replied by southbayguy on topic halsampler source code
It took a while, but I found it. It's not called halsampler.c. It's not called hal_sampler.c. I figured it wouldn't be in the same place as the other HAL components, because they are realtime code, and halsampler is a user space program. That was wrong. It is in linuxcnc-dev/src/hal/components and it's called sampler_usr.c. All right.
So ... yes ... here's the Q. I want to tweak sampler_usr.c and recompile it and test if the tweak works the way I want. I just want to recompile the one file, leave the others alone. Any guidance on how to do that? I see there is a submakefile in linuxcnc-dev/src/hal/components. Do I work with that somehow? Thanks.
So ... yes ... here's the Q. I want to tweak sampler_usr.c and recompile it and test if the tweak works the way I want. I just want to recompile the one file, leave the others alone. Any guidance on how to do that? I see there is a submakefile in linuxcnc-dev/src/hal/components. Do I work with that somehow? Thanks.
Please Log in or Create an account to join the conversation.
23 Jun 2014 21:35 #48200
by ArcEye
Replied by ArcEye on topic halsampler source code
Hi
Install linuxcnc-dev
You should then be able to go to src/hal/components and run
comp --userspace --compile sampler_usr.c
comp --compile sampler.c
If this works you will get a binary and a kernel module (.ko), you can rename the existing ones and substitute these ones
I can't test this will work at present, I am using a rt-preempt kernel which linuxcnc does not support, but it should do.
regards
Install linuxcnc-dev
You should then be able to go to src/hal/components and run
comp --userspace --compile sampler_usr.c
comp --compile sampler.c
If this works you will get a binary and a kernel module (.ko), you can rename the existing ones and substitute these ones
I can't test this will work at present, I am using a rt-preempt kernel which linuxcnc does not support, but it should do.
regards
The following user(s) said Thank You: southbayguy
Please Log in or Create an account to join the conversation.
- southbayguy
- Offline
- Senior Member
Less
More
- Posts: 63
- Thank you received: 1
24 Jun 2014 09:41 #48214
by southbayguy
Replied by southbayguy on topic halsampler source code
Hi -
Going to /src/hal/components and running
comp --userspace --compile sampler_usr.c
I get
"The program 'comp' can be found in the following packages
mailutils-mh
nmh"
... so I did an apt-get install on mailutils-mh and nmh, but it felt like I was just getting further afield, with the nmh package asking about
something called "Citadel" and asking for passwords. When again I tried
comp --userspace --compile sampler_usr.c
I got the same error again about the program 'comp' . Cycled power, tried again. Same error. Stuck.
Thanks for guidance.
Going to /src/hal/components and running
comp --userspace --compile sampler_usr.c
I get
"The program 'comp' can be found in the following packages
mailutils-mh
nmh"
... so I did an apt-get install on mailutils-mh and nmh, but it felt like I was just getting further afield, with the nmh package asking about
something called "Citadel" and asking for passwords. When again I tried
comp --userspace --compile sampler_usr.c
I got the same error again about the program 'comp' . Cycled power, tried again. Same error. Stuck.
Thanks for guidance.
Please Log in or Create an account to join the conversation.
24 Jun 2014 12:53 #48219
by ArcEye
That package contains comp and will trigger installation of gcc etc.
Replied by ArcEye on topic halsampler source code
Install linuxcnc-dev
That package contains comp and will trigger installation of gcc etc.
The following user(s) said Thank You: southbayguy
Please Log in or Create an account to join the conversation.
24 Jun 2014 20:43 #48222
by andypugh
That is a rather unfortunate message from Ubuntu (which is completely unaware of LinuxCNC). It causes a fair bit f trouble (with people doing what you tried, ie the obvious thing suggested) but I don't see a fix for it from the LinuxCNC end.
Replied by andypugh on topic halsampler source code
"The program 'comp' can be found in the following packages
mailutils-mh
nmh"
.
That is a rather unfortunate message from Ubuntu (which is completely unaware of LinuxCNC). It causes a fair bit f trouble (with people doing what you tried, ie the obvious thing suggested) but I don't see a fix for it from the LinuxCNC end.
The following user(s) said Thank You: southbayguy
Please Log in or Create an account to join the conversation.
- southbayguy
- Offline
- Senior Member
Less
More
- Posts: 63
- Thank you received: 1
25 Jun 2014 10:39 #48237
by southbayguy
Replied by southbayguy on topic halsampler source code
Hi -
I made a trivial change to sampler_usr.c but one that would show up in the output. I was able to compile (will wonders never cease?) and got a sampler_usr.o and a sampler_usr.d file, with today's date.
So now the question is: Where do I put the newly-compiled files so their new functionality will work with my regular install?
I plan to be careful, rename the original binary file as sampler_usr_original.o or something like that so I can retreat to it if necessary ... but I would like to drop my new file into the regular install and work with it. Don't know where.
Thanks.
I made a trivial change to sampler_usr.c but one that would show up in the output. I was able to compile (will wonders never cease?) and got a sampler_usr.o and a sampler_usr.d file, with today's date.
So now the question is: Where do I put the newly-compiled files so their new functionality will work with my regular install?
I plan to be careful, rename the original binary file as sampler_usr_original.o or something like that so I can retreat to it if necessary ... but I would like to drop my new file into the regular install and work with it. Don't know where.
Thanks.
Please Log in or Create an account to join the conversation.
Time to create page: 0.119 seconds