halui analog jog (ref interfacing a shuttleXpress)

More
19 Apr 2013 20:17 #32921 by BigJohnT
The shuttle express is in the manual... dunno if it is the same as the shuttle pro

linuxcnc.org/docs/html/drivers/shuttlexpress.html

John

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

More
21 Apr 2013 07:48 #32955 by m8298
Thanks John, I did see that. Unfortunately, it isn't the same. It's practically the same device, its from the same manufacturer, it's just smaller and has fewer buttons. The problem is that the Product ID is different. I imagine someone could modify the shuttlexpress.c file and then re-compile the kernel. But that is well outside of my knowledge and skill set.

My problem lies in the fact that I barely understand how to set pins in hal. Now I need to figure out how to do it with different data types, and in different hal files. I am really confused on what to do with the wheel and dial. I have a different thread on this already, but then I found this one. And it looks like George has figured out what I want to do. I just don't have a clue how to link the wheel and analog jog. And I get kinda frustrated bouncing back and forth between manuals, wiki, forum threads, etc.

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

More
21 Apr 2013 22:35 #32963 by BigJohnT
Actually you would not have to recompile the kernel only LinuxCNC.

Sometimes being leader of the pack can be frustrating....

John

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

More
21 Apr 2013 23:02 #32964 by m8298
You are right, I read that. I mis-spoke.

As to being the leader of the pack... It won't be me any time soon, especially in Linux. It's both frustrating and even embarrassing how little I know in Linux.

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

More
26 Apr 2013 00:16 - 26 Apr 2013 00:20 #33207 by m8298
How hard would it be to edit the shuttlexpress.c file and re-compile Linunxcnc? I am still too much of a newbie in Linux to attempt it on my own. I am relatively sure that the only difference between the Shuttle xpress and the Shuttle Pro are the product ID, and the additional buttons, shuttle xpress has 5 and shuttle pro has 13. Other than that, they have the same spring wheel and center dial.

Actually, taking it one step farther, the same applies for the shuttle pro2, except it has 15 buttons.
Last edit: 26 Apr 2013 00:20 by m8298.

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

More
26 Apr 2013 00:31 #33209 by andypugh

How hard would it be to edit the shuttlexpress.c file and re-compile Linunxcnc?


Not desperately hard, and fairly low-risk if you don't intend using a Shuttle Express.
(Ideally you would make the driver work with either device, and push the change back to the project)

Instuctions here:http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Installing_EMC2#On_Ubuntu_10_04_or_8_04_from_source but in brief:

sudo apt-get install git-core build-essential linuxcnc-dev
git clone git://git.linuxcnc.org/git/linuxcnc.git linuxcnc-dev
cd linuxcnc-dev
{Edit src/hal/user_comps/shutlexpress.c}
./autogen.sh
./configure --prefix /usr
make
sudo make setuid

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

More
26 Apr 2013 00:48 #33211 by m8298
I looked at the shuttle press.c file. There are some parts I don't understand. Could it be as simple as copying and adding the structures for the buttons, making entries for 15 buttons, and editing the Product_ID/Vendor_ID to work with any one of three or more combinations???? That way if you have shuttle xpress you only link the first five buttons, if you have shuttle pro you link only the first thirteen buttons, and if you have the shuttle pro2 you link all buttons.

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

More
26 Apr 2013 07:11 #33220 by andypugh

I looked at the shuttle press.c file. There are some parts I don't understand. Could it be as simple as copying and adding the structures for the buttons, making entries for 15 buttons, and editing the Product_ID/Vendor_ID to work with any one of three or more combinations?.

Probably.
In fact as a first stage, just change the product ID and see if you get something with only 5 working buttons.

In practice there is the issue of finding which button is which in the returned bytes, and how many bytes there are in the packet too.

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

More
26 Apr 2013 09:04 #33224 by m8298
Can you explain what the packet numbers here are:
*s->hal->button_0 = packet[3] & 0x10;
*s->hal->button_0_not = !*s->hal->button_0;
*s->hal->button_1 = packet[3] & 0x20;
*s->hal->button_1_not = !*s->hal->button_1;
*s->hal->button_2 = packet[3] & 0x40;
*s->hal->button_2_not = !*s->hal->button_2;
*s->hal->button_3 = packet[3] & 0x80;
*s->hal->button_3_not = !*s->hal->button_3;
*s->hal->button_4 = packet[4] & 0x01;
*s->hal->button_4_not = !*s->hal->button_4;

And what are the 0x10 numbers?

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

More
26 Apr 2013 19:15 #33238 by andypugh

Can you explain what the packet numbers here are:
*s->hal->button_0 = packet[3] & 0x10;
*s->hal->button_0_not = !*s->hal->button_0;
And what are the 0x10 numbers?


The packets are the data sent to the component by the USB system and OS.
We don't know how many packets the Pro uses, but there is a hard-coded number in the code for the Express.

0x10 etc are being used as bit masks, as each button appears as a set bit in the data byte. 0x10 is a hex number (16 in decimal, 00010000 in binary. Bitwise AND of the data picks out the value of the 5th bit.

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

Time to create page: 0.633 seconds
Powered by Kunena Forum