Arduino Leonardo and linears encoders.

More
25 Jan 2013 20:43 #29131 by casetero
Ok, i´m going to make the list with the buttons and the values they show.

I don´t know where to look the HID, but i can tell you that if i put "lsusb" in a terminal it is called Silicon Lab, and if i put "hidconfig" when selecting the device it shows KTURT in the name.

So maybe with shuttlexpress i can manage all? That would be great.

Thank you!

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

More
25 Jan 2013 20:51 #29132 by casetero
EUREKA!!! (I suposse is not a spanish word)

In the drivers of the pendant is the file ShuttlePro.dll so it does work with that driver for sure.

With it i can manage the LCD too??

Thank you!

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

More
25 Jan 2013 20:58 #29134 by andypugh

With it i can manage the LCD too??!

I am not sure.
Can you list the HAL pins?
The following user(s) said Thank You: casetero

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

More
25 Jan 2013 21:50 #29135 by casetero
Ok folowing this picture:

fr.aliexpress.com/item/CNC-wireless-MPG-...pping/642118415.html

I have numbered the buttons like this:

1
2 3 4 5
6 7 8 9
10 11 12 13
14 15 16

I charge the hid file with hidcomp at hal file like this:

loadusr -W hidcomp -ini smartsept.ini mando.hid


In the HAL meter, i see these PIN´s:

hidcomp.0.PIN1.raw
hidcomp.0.PIN1.ivalue
hidcomp.0.PIN1.fvalue
hidcomp.0.PIN2.raw
hidcomp.0.PIN2.ivalue
hidcomp.0.PIN2.fvalue
hidcomp.0.PIN3.raw
hidcomp.0.PIN3.ivalue
hidcomp.0.PIN3.fvalue
hidcomp.0.PIN4.raw
hidcomp.0.PIN4.ivalue
hidcomp.0.PIN4.fvalue
hidcomp.0.PIN5.raw
hidcomp.0.PIN5.ivalue
hidcomp.0.PIN5.fvalue


The Pins that have PIN1 and PIN5 shows the same value ( it is a repeated PIN i think)

PIN1 and PIN5 are referred to the main buttons (1-16),
PIN2 is for pressing two buttons at the same time ( in fact you mantain pressed one button and press another and give you different values depending on the two buttons you press, i think is for example to jog in velocity mode by pressing the velocitiy and the axis)
PIN3 is for the axis selector ( 6 positions, 4 axis and feed and spindle velocity)
PIN4 is for the pulse train to make and incremental jog. This one is rare, if you move slow the rotary button it shows 1, 1, 1, but if you move it faster it shows 2, 3 .. more faster, higher number.

I´ve made a list of values for PIN1 and PIN5 for the main buttons:

hidcomp.0.PIN1(or 5).fvalue :

Buttons Values of hal meter
1 -0.8198
2 -0.9922
3 -0.9844
4 -0.9766
5 -0.9688
6 -0.906
7 -0.953
8 -0.9452
9 -0.9374
10 -0.9296
11 -0.9216
12 -0.9138
13 -0.9608
14 -0.8982
15 -0.8902
16 -0.8824


hidcomp.0.PIN1(or 5).raw:

Button Value
1 23
2 1
3 2
4 3
5 4
6 12
7 6
8 7
9 8
10 9
11 10
12 11
13 5
14 13
15 14
16 15

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

More
25 Jan 2013 21:52 #29136 by casetero
Sorry it is a bit anoying to see but this wordprocessor haven´t respect me the spaces.

Do you understand it?

Thank you

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

More
29 Jan 2013 02:06 - 29 Jan 2013 02:06 #29230 by casetero
Hello Andy,

I´ve been doing some code to the incremental jog with the weel. It works with the comp function, but there is a problem.

This is the code i have wrote:


loadrt comp count=1


addf comp.0 servo-thread


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



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

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

Ok, it just moves in one direction. The first value that shows when moving the wheel is -0.9922 and in rest is -1.
The problem is that the hidcomp.0.PIN4.fvalue doesn´t return to -1 (rest) if i move the wheel fast, in fact i have to move it very slow to let it return to -1, so the comp can´t send a FALSE value between TRUE values, it stays in TRUE till i stop moving the wheel. So if i move the wheel with a normal velocity comp.0.out stays in TRUE value and it just move one increment while moving the wheel.

If i could manage to make a much more faster reading of the PIN it should work nicely i think. Can i do this by adding another thread much more faster? Maybe with the shuttleexpress i can do that too. But as i see at the url you posted, for the wheel it gives a float value, so i have to do a comp function too??

Thank you very much.
Last edit: 29 Jan 2013 02:06 by casetero. Reason: errates

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

More
29 Jan 2013 05:06 #29238 by andypugh

Hello Andy,

I´ve been doing some code to the incremental jog with the weel. It works with the comp function, but there is a problem..

I would be surprised if "comp" was the right way to interface the incremental jog.
Furthermore, if it is a Shuttle then the jog behaviour is just plain wierd.
The best solution is probably going to be a custom HAL component that handles all the complexity for you.
Whether that is an attractive solution depends on how comfortable you are with C-code.
Looking at www.linuxcnc.org/docs/html/hal/comp.html will either have you running away in fear or excited by the possibilities :-)
The following user(s) said Thank You: casetero

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

More
29 Jan 2013 20:29 #29258 by casetero
Ok, im going to try the shuttlexpress before making my own HAL component. It´s an amazing idea but i don´t know if i will be able.

Shuttlexpress has a PIN called shuttlexpress.0.counts that acumulate counts of the jog wheel, but it isn´t bit type, is s32. Do i have to connect it to stepgen.0.counts??

Im having problems to give permissions to shuttlexpress, I dont really undestand what happens when i put lsusb in a terminal. The devices that show me are real usb devices, or software modules like shuttlexpress must be showed too??

I have done a .rules files wich includes these lines:

# Generic HID device

SYSFS{idProduct}=="04d9", SYSFS{idVendor}=="1c40", MODE="0660", GROUP="plugdev"

# Contour design, shuttle pro

SYSFS{idProduct}=="0030", SYSFS{idVendor}=="0b33", MODE="0660", GROUP="plugdev",

# Mando chino

SYSFS{idProduct}=="eb70", SYSFS{idVendor}=="10ce", MODE="0660", GROUP="plugdev"

#El 002/002

SYSFS{idProduct}=="0200", SYSFS{idVendor}=="04f2", MODE="0660", GROUP="plugdev"

#Input

SUBSYSTEM=="input", mode=="0660", group=="plugdev"

#Otra para Shuttlexpress
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0b33", ATTRS{idProduct}=="0020", MODE=="0440"


And when i put in a terminal lsusb the Shuttle contour doesn´t appear. When i put:
halrun
loadusr shuttlexpress /dev/bus/usb/005/002 ( the device of the usb pendant)

it says that hidraw doesn´t have permissions.

What am i doing wrong??

Thank you very much.

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

More
29 Jan 2013 21:06 #29259 by andypugh

Shuttlexpress has a PIN called shuttlexpress.0.counts that acumulate counts of the jog wheel, but it isn´t bit type, is s32. Do i have to connect it to stepgen.0.counts??

No, it connects to the axis.N.jog-counts pin.
linuxcnc.org/docs/html/man/man9/axis.9.html
You need a bit of HAL logic so that it only connects to the axis you want to jog at any one time.
There is an example here: linuxcnc.org/docs/html/examples/mpg.html

Sorry, no idea about the permissions side of things.
The following user(s) said Thank You: casetero

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

More
29 Jan 2013 22:25 #29262 by ArcEye
casetero wrote:

Im having problems to give permissions to shuttlexpress


Are you actually following the instructions to the letter?
linuxcnc.org/docs/html/man/man1/shuttlexpress.1.html

You mention a .rules file, but not what its name or path is.
It should have its own file with just one entry.

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

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

Time to create page: 0.192 seconds
Powered by Kunena Forum