GAMEPAD problem

More
12 Dec 2012 02:37 #27597 by GM2012
Replied by GM2012 on topic GAMEPAD problem
Thanks to all for help.

I have my gamepad working, for now using 'simple remote pendant. All I had to do is to change some of pin names.

I've used bit newer PC, installed Ubuntu 10 and it didn't take to long to make gamepad work.

So problems I've had could either something with USB bus or something with Ubuntu 8. It would be nice that I've figured out what exactly was wrong.

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

More
12 Dec 2012 16:49 #27611 by Rick G
Replied by Rick G on topic GAMEPAD problem
Glad to hear you got it worked out.

There is a change in the naming of one pin from 2.n to 2.5 that I know of...

input.0.btn-trigger

is now

input.0.btn-joystick

Rick G

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

More
12 Dec 2012 23:26 - 12 Dec 2012 23:27 #27633 by GM2012
Replied by GM2012 on topic GAMEPAD problem
Actually, buttons 1-4 on Logitech F310 are all different but all is easy once THE THING is recognized and working - so I've changed those.
Having gamepad is nice but I will have to try to see what features advanced version have.
I am not using manual mode often just for simple cuts and what simple joystick control doesn't have is actual arrow button mimic or driving machine straight in X,U,Z direction.
Also I often like to use incremental machine movement in manual mode. Probably somebody already worked on those options - will have to read more.

In a way I was lucky that I couldn't make gamepad work on older PC so my replacement PC which was almost ready to go OUT is actually newer and better machine. I had an issue with
latency which was obviously related to onboard video. Than I've found old NVIDIA card, installed it and latency go from 6000-13000, very good I'd say.

So next problem that I've resolved half way is my wireless connection. I am using (again old) Realtek USB wireless dongle, installed Windows XP drivers and after some struggle managed
to connect to cable modem ... but couldn't open any web pages ... it was 2 in the morning - had to leave it for now.

As I've said I will make some writing about Logitech - it may be useful to other people.
Last edit: 12 Dec 2012 23:27 by GM2012.

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

More
14 Dec 2012 20:47 #27725 by Rick G
Replied by Rick G on topic GAMEPAD problem
Glad to hear you are getting it sorted out.

Having gamepad is nice but I will have to try to see what features advanced version have.
I am not using manual mode often just for simple cuts and what simple joystick control doesn't have is actual arrow button mimic or driving machine straight in X,U,Z direction.
Also I often like to use incremental machine movement in manual mode. Probably somebody already worked on those options - will have to read more.


One way of adding incremental move is shown here, gives 3 different size incremental moves using same buttons as continuous moves.
It also uses the component "near" to make sure the move is straight and on just one axis. You will probably want to add an indicator to show what state is active, continuous or incremental as shown later in the article.
wiki.linuxcnc.org/cgi-bin/wiki.pl?Adding...imple_Remote_Pendant
The latest version that I am using uses two buttons, one for incremental mode one for continuous and beeps to indicate what mode is activated.

To avoid moving two axis accidentally with the continuous moves on the Simple Remote Pendant you can use the component "deadzone" and set it to your liking.
I believe someone also posted an axis lockout modification to avoid unwanted moves.

Rick G

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

More
17 Dec 2012 08:14 #27792 by GM2012
Replied by GM2012 on topic GAMEPAD problem
Link that points to "adding new features ...."
This HAL is written for older Logitech 310. I am not sure about

btn-joystick - which switch is this pme?

old vs new logitech F310:

btn-top2 = abs-z
btn-base = btn-tl
btn-pinkie = abs-rz
btn-base2 = btn-start
btn-trigger = btn-x
btn-thumb = btn-a
btn-thumb2 = btn-b
btn-top = btn-y

and so on - anyone with new F310 can figure this out.

I assume that btn-joystick is the switch that acts when you push JOYSTICK all the way down.
New Logitech has those two as thumbl and thumbr. What is the switch on the right JOYSTICK on old Logitech?

thanks

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

More
17 Dec 2012 18:11 #27797 by Rick G
Replied by Rick G on topic GAMEPAD problem
Left joystick down on mine is input.0.btn-base5
and
Right joystick down is input.0.btn-base6

I find the easiest way to find the names of the buttons is to use hal watch, select all the pins and hit one button on the joypad at a time to see the effect.

Rick G

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

More
18 Dec 2012 00:39 - 18 Dec 2012 00:46 #27808 by GM2012
Replied by GM2012 on topic GAMEPAD problem
Thanks Rick. I've used HAL to find out button 'names'. What I've meant is part of code where it is referred to BTN-JOYSTICK.
net remote-speed-slow or2.0.in0 or2.2.in0 input.0.btn-joystick
net remote-speed-medium or2.1.in0 or2.3.in0 input.0.btn-thumb
net remote-speed-fast or2.0.in1 or2.1.in1 or2.2.in1 or2.3.in1 input.0.btn-thumb2

The incremental jogs require the sticks to be pushed all the way to activate to avoid accidentally jogging the wrong axis by not pushing the stick perfectly straight.


I know it is hard to answer if you do not have exactly the same gamepad; I assume that "sticks to be pushed all the way" means "all the way DOWN"?
And BTN-JOYSTICK must be switch on the joystick.
Code above is bit different than the original one (simple pendant):
net remote-speed-slow or2.0.in0 input.0.btn-trigger
net remote-speed-medium or2.1.in0 input.0.btn-thumb
net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-thumb2

Where btn-trigger is Button 1 (one of four buttons on the right (1,2,3,4)) so than it makes no sense to use BTN-JOYSTICK.
And maybe "pushed all the way" has a different meaning.
Last edit: 18 Dec 2012 00:46 by GM2012.

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

More
18 Dec 2012 03:07 #27812 by GM2012
Replied by GM2012 on topic GAMEPAD problem
After taking closer look at the code for improved pendant I think that I've found answer to what I've asked:

"push stick all the way" - is not pushing the stick down but to end + or - position.

btn-joystick is actually button #1 on the gamepad. I "simple pendant" code it is btn-trigger

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

More
18 Dec 2012 06:00 #27816 by Rick G
Replied by Rick G on topic GAMEPAD problem

"push stick all the way" - is not pushing the stick down but to end + or - position.


Yep.

I guess that could be clearer. The idea was to prevent unwanted movement of the other axis, so the axis that you want to move has to be moved all the way.
This can be adjusted with the "near" settings .

Rick G

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

More
20 Dec 2012 07:31 - 20 Dec 2012 07:39 #27876 by GM2012
Replied by GM2012 on topic GAMEPAD problem
I've added three pdf files showing simplified logic/block diagram. This can be of use only to beginner to better understand hal code.
Those pdf's may have errors as I've already found for MUX4 should be 0,1,2,3 for sel0,sel1 position.

As a beginner I found that hal code should be read backward or from the last line towards first line.

I also used this code and running my gamepad, have increments now.
I think I need to add some GUI to display if continuous or incremental is selected. It is easy to forget in which MODE you are.

Unless I am missing something I still do not have continuous mode with X,Y or Z axis only (linear).

Most of hal components are straightforward. Just a note on MUX4:

-It is a multiplexer with 4 inputs (digital or analog) and two select bits (sel0 and sel1). State of sel0 and sel1 determines what input is 'transmitted' to output:

00 is binary 0, 01 is 1, 10 is 2 and 11 is 3.
>>>>>>>>>>>>>
Just to add: in pdf's crossed are old Logitech buton names and new Logitech F310 names are added.
Instead of using TOP (button 3) I preffer BOTOM (btn-a).
To me TOP is first choice over bottom and even though it is not in button order (1,2,3,4) - but anyone can change buttons to whatever.
Attachments:
Last edit: 20 Dec 2012 07:39 by GM2012.

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

Time to create page: 0.088 seconds
Powered by Kunena Forum