Changing mux2.0.sel values every X time.

More
02 Feb 2013 19:34 #29479 by ArcEye

But in what directory do i do all this??


It does not matter, comp will install the module in the correct directory.
The only exception is if you are running a RIP install, in which case it must be compiled within the bash session in which you ran the rip-environment script

Do i have to link the component after to any servo-thread or base-thread??


It will need to run on the servo thread as it uses floating point pins.

How do i fix the timer to 0.2 seconds?


setp mux-toggle.period NN where NN equals the number of servo thread periods (number of times it polls the component) that equate to the time you want
The speed of your servo thread is in your .ini file, you can do the maths or just guesstimate and fine tune, no telling exactly what the optimum time is going to be, I assume you plucked 0.2 secs out of the ether

regards
The following user(s) said Thank You: casetero

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

More
02 Feb 2013 21:07 #29485 by casetero
Hi

Thank you all, finally i got it using the siggen component. Your information is very valuable ArcEye, i´m sure i will need to compile some new component in the future.

Andy it works like i wanted, the behaviour of the jogwheel now is much better, but it could be better with shuttlexpress i think.

This is the code i wrote :


loadrt mux2 count=2
loadrt comp count=1
loadrt siggen num_chan=1

addf mux2.0 servo-thread
addf mux2.1 servo-thread
addf comp.0 servo-thread
addf siggen.0.update servo-thread

setp siggen.0.frequency 5
setp mux2.0.in0 -1


setp halui.jog-speed 500
setp halui.jog.0.increment 0.1

net toggle siggen.0.clock => mux2.0.sel

net countsmando mux2.0.in1 hidcomp.0.PIN4.fvalue
setp comp.0.in0 -0.9988
net comparator comp.0.in1 mux2.0.out

net x-jog comp.0.out halui.jog.0.increment-plus


It´s very basic and it only moves one axis in one direction, but the idea of taking counts from the jogwheel is in the code.

The problem of doing it like this is that no matter how fast you move the wheel, the axis moves always at the same velocity. But apart of this its behaviour is nice enough and precise.

I´m going to continue trying to link it to shuttlexpress because i think with shuttlexpress it will "read" the velocity of the jogwheel too.

Thank you all!

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

More
03 Feb 2013 22:41 #29525 by andypugh
The raw values seem to be signed 8 bit numbers.
They don't look that was as they are being copied into a signed-32 bit value.
component wheel "pendant jogwheel thingy";

pin in signed raw-val;
pin out signed jog-counts;

function _;

author "andy pugh";
license "GPL";

;;
FUNCTION(_){
char v;
v=raw_val;
jog_counts += v;
}

This is untested, but does at least compile with sudo comp --install wheel.comp

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

More
04 Feb 2013 06:55 #29540 by casetero
Sorry andy but mi knowledge of programing is low, what does that component do exactly?

Thank you.

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

More
04 Feb 2013 16:04 #29551 by andypugh

Sorry andy but mi knowledge of programing is low, what does that component do exactly?.

Hopefully it converts the raw pin from the jogwheel into a continuous counts value for connecting in HAL. But that is based on guesswork about how the wheel pin works.

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

More
04 Feb 2013 19:28 - 04 Feb 2013 19:32 #29559 by casetero
Andy i can´t compile it, in which path have i to do it?

I´m doing it in a false copy of linuxcnc, which i used to compile the shuttlexpress.c.

But it says that comp: command not found.

I copy what shows in the terminal:

pablo@Pablo-cnc:~/carpetaNuestra/build/src/hal/components$ sudo comp --install wheel.comp
sudo: comp: command not found
pablo@Pablo-cnc:~/carpetaNuestra/build/src/hal/components$

Maybe i have to do it in the real /src/hal/ path of linuxcnc but i can´t find it.

Thank you!
Last edit: 04 Feb 2013 19:32 by casetero.

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

More
04 Feb 2013 20:16 #29562 by casetero
Ok, i think the problem is i have to install the development packages, like said here:

www.linuxcnc.org/docs/html/hal/comp.html...:simple-comp-example

but i don´t have internet in that computer, where can i download?

Here:

buildbot.linuxcnc.org/ ???

If its in there, can you say me which is the file that i have to download?

Thank you!

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

More
04 Feb 2013 20:47 #29565 by andypugh

Ok, i think the problem is i have to install the development packages, like said here:

www.linuxcnc.org/docs/html/hal/comp.html...:simple-comp-example


That was going to be my guess, but I don't know how to get it without internet.

It seems a bit odd, though, as you shouldn't be able to compile LinuxCNC without comp being installed.

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

More
04 Feb 2013 20:55 #29566 by casetero
What i have done is to compile linuxcnc again (running make like whith shuttlexpress) and it has created to me differents files called

wheel.c

wheel.9.d

wheel.comp

wheel.mod.o

wheel.o

wheel.mak

wheel.ko

Can i copy these files in any directory to enhace the hal component??

This evening i will try to put internet in the computer, last time i tried i broke linuxcnc because i changed the Kernel, but now i know a lot more of linux, i think i won´t break anything this time...

Thank you!

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

More
04 Feb 2013 22:24 #29571 by andypugh

wheel.ko
Can i copy these files in any directory to enhace the hal component?


I think that wheel.ko is the only one you need.

It needs to go with the other hal component .ko files. Then try
halrun
loadrt wheel
exit

and see what happens.
The following user(s) said Thank You: casetero

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

Time to create page: 0.098 seconds
Powered by Kunena Forum