HAL_INPUT - EMC2 initial pin values

More
03 Apr 2011 02:22 - 03 Apr 2011 11:21 #8404 by Andy123
Not sure what I am doing wrong:

I have PC with EMC2.3.x that is using custom joypad as a pulse generator
works just fine using X-position, Y-Position and few buttons

Now I switched to EMC2.4.6 on a different PC:

When I start EMC2 all values sent by joypad are zeros including button states that supposed to be ON and X, Y positions that should be 30000

As soon as I click handwheel or push a button, value for corresponding pin changes and reflects correct value in HAL Meter
Rest will stay at 0 until I touch them

I loaded hal_input it from terminal - I see all pin values as expected on start

Any ideas what changed in 2.4.6?
Last edit: 03 Apr 2011 11:21 by Andy123.

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

More
03 Apr 2011 02:36 - 03 Apr 2011 11:21 #8405 by Andy123
I found this:
www.linuxcnc.org/docview/html/man/man1/hal_input.1.html

BUGS
The initial state of keys, buttons, and absolute axes are erroneously reported as FALSE or 0 until an event is received for that key, button, or axis.


Any ideas how to fix this?
Last edit: 03 Apr 2011 11:21 by Andy123.

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

More
03 Apr 2011 22:08 #8426 by andypugh
I have had a look at the code in hal_input.py.

Whilst I know next to nothing about Python, it looks like it responds to "events" from the USB-hid system. I think that means that there is no easy solution because events are only passed on to the driver when a control state changes. Thus, it looks like a usb-hid problem rather than an EMC2 one.

As I understand it python files are either interpreted or runtime compiled, so if you can find hal_input.py on your system you could experiment. I don't know where the file "lives" on a normal emc2 installation so can't actually point you to it.

How custom is your controller? I wonder if the problem can be solved at your end, for example changing the values on non-zero controls after EMC2 has started up.

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

More
03 Apr 2011 22:22 - 03 Apr 2011 22:42 #8430 by Andy123
If current code responds to events only they why it works with correct initial values if I run it under terminal?

halrun
loadusr -W hal_input -KRAL ArkUSBCNC
show pin

Also why it works OK in ver 2.3.x?

This is a USB-HID device based on microchip PIC18F2450 HID code and I can change it if necessary,
I can toggle bits and quikly change position numbers, but I prefer not to do it since it can cause unpredictable moves.
Last edit: 03 Apr 2011 22:42 by Andy123.

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

More
03 Apr 2011 22:40 #8432 by andypugh
To be honest, I have no idea.

I think this is a question for the developers list, where the big-brains hang out. (including Jeff, who wrote that driver)

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

More
03 Apr 2011 22:43 #8433 by Andy123
In any case, it is listed under Bugs and it would be nice to have it corrected...

I will put it to the mailing list...

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

More
03 Apr 2011 23:35 - 03 Apr 2011 23:35 #8435 by Andy123
I compared hal_input.py files from 2.3 and 2.4 - there are some differences, but as far as I see nothing in the area of initial values

what is bugging me is that 2.3 documentation also mentions this bug but initial valuses are set all the time

It looks like something in EMC2 code works different :(
Last edit: 03 Apr 2011 23:35 by Andy123.

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

More
03 Apr 2011 23:49 #8437 by andypugh
Are you sure that the 2.3 config isn't using the previous hal_joystick function? (Which reportedly doesn't work with 2.4 at all)

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

More
04 Apr 2011 00:39 #8440 by Andy123
Yes, it is HAL_INPUT, I did not use HAL_Joystick

I even tried to copy configuration from 2.3 and used it with 2.4 - same results
This only thing I can think about is the PC with 2.4 is much faster computer: 2GHz vs 700MHz with much more memory
May be it has something to do...

I will try to install 2.3 on another harddrive on Faster PC to see if it is not something speed related.

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

More
04 Apr 2011 16:40 #8501 by Andy123
I installed 2.3.5 / Ubunty 8 on a different harddrive of the same PC

got inconlusive results:

Position X, and position Y have correct initial value when EMC2 starts, but buttons remain in "0" state iven I have some "ON"

again, running it under terminal shows correct values

not sure what to say...

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

Time to create page: 0.099 seconds
Powered by Kunena Forum