Remote Pendant - Logitech Joypad

More
22 Sep 2010 14:25 - 22 Sep 2010 15:30 #4282 by photomankc
Hey all,

I have been reading through the simple remote pendant and the adding controls examples and I am SLOWLY starting to understand what the config is doing in places but I have a couple of questions that I still don't really see how to address.

Using the example from the "Adding more functions to Simple Remote Pendant" wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Add...imple_Remote_Pendant - I don't see how, if I need to reverse a single axis, I go about doing it. My X/Y work as expected, the tool 'moves' in the direction you push the stick. However the Z axis is inverted. The tool moves the opposite of the stick. I need to invert that axis somehow but I'm not sure how to do it. It moves correctly everywhere else but the pendant. How do I reverse that axis?

Also, I can't get any of the MDI linked commands for the buttons to work. They all send EMC2 into la-la land where no other input gets processed. So I can't incremental jog nor can I home, or touch off. I added the MDI commands into my PM-25MV.ini file like this:
[HALUI]
MDI_COMMAND = G92 X0.000 M101
MDI_COMMAND = G92 Y0.000 M105
MDI_COMMAND = G92 Z0.000 M106
MDI_COMMAND = G90
MDI_COMMAND = G91 G0 z.001 M102 
MDI_COMMAND = G91 G0 z-.001 M102
MDI_COMMAND = G91 G0 x-.001 M102
MDI_COMMAND = G91 G0 x.001 M102
MDI_COMMAND = G91 G0 y.001 M102
MDI_COMMAND = G91 G0 y-.001 M102
MDI_COMMAND = G53 G0 Z0 M104
MDI_COMMAND = G53 G0 X0Y0 M107


I also created the files in emc2/nc_files/ directory with the names M101, M102, ect.... I assume they are in the right location as EMC complained about unknown m codes until I changed them to executable. After that every function that called one of them results in the loss of all function of the interface. I can use F2 to disable and reenable the machine and get back control but the problem repeats again if you use any of the MDI linked buttons. Any ideas on what might be up there?
Last edit: 22 Sep 2010 15:30 by photomankc.

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

More
22 Sep 2010 22:52 #4288 by photomankc
Figured out the M Command problem. I had a typo "#!bin/bash" instead of "#! /bin/bash". I guess HAL was getting messed up when the halcmd items were not running because the script bombed.

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

More
22 Sep 2010 23:01 #4290 by Rick G
Hello,

I will look at your post in detail tomorrow (storm comming)

I don't see how, if I need to reverse a single axis, I go about doing it. My X/Y work as expected, the tool 'moves' in the direction you push the stick. However the Z axis is inverted. The tool moves the opposite of the stick. I need to invert that axis somehow but I'm not sure how to do it. It moves correctly everywhere else but the pendant. How do I reverse that axis?


From John's article...

Reverse any Axis that go in the wrong direction
To reverse the direction of any axis add the following

loadrt sum2 count=2 # 1 for each axis you need to reverse, also check to make sure you don't all ready have sum2 loaded
addf sum2.0 servo-thread # in my case I needed to reverse the Y and Z axis
addf sum2.1 servo-thread


Replace the net joy-y-jog halui.jog.1.analog <= input.0.abs-y-position line with the following

# reverse the analog so the axis will go in the expected direction
setp sum2.0.gain0 -1
net reverse-y sum2.0.in0 <= input.0.abs-y-position
net joy-y-jog halui.jog.1.analog <= sum2.0.out


Replace the net joy-z-jog halui.jog.2.analog <= input.0.abs-z-position line with the following

setp sum2.1.gain0 -1
net reverse-z sum2.1.in0 <= input.0.abs-rz-position
net joy-z-jog halui.jog.2.analog <= sum2.1.out

I also created the files in emc2/nc_files/ directory with the names M101, M102, ect.... I assume they are in the right location


These M code files must be in the directory called for in the DISPLAY SECTION PROGRAM_PREFIX ... and must be executable (right click on file name select permission and check executable)

To keep things simple lets just get the axis reversed first then move on to the other issues.

Rick G

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

More
23 Sep 2010 07:07 - 23 Sep 2010 07:09 #4291 by radekB
photomankc wrote:

How do I reverse that axis?


Try changing +/- sign.
setp input.0.abs-x-scale 127.5
setp input.0.abs-y-scale -127.5
setp input.0.abs-rz-scale -127.5

photomankc wrote:

unknown m codes

=> bad place directory, for you users M-code.

Example:
#!/bin/sh
halcmd setp axisui.set-manual-mode 1
exit 0

RADEK
Last edit: 23 Sep 2010 07:09 by radekB.

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

More
23 Sep 2010 11:02 #4293 by Rick G
Hello,

HAL uses realtime components, they are listed in the Integrator manual and you can get more information on them from the terminal window by typing man and the name of the component.
In the case of changing the direction of the joystick the line

net joy-z-jog halui.jog.1.analog <= input.0.abs-z-position
takes the output of your joystick and sends it to halui.jog input.

If that makes it move the wrong direction you can change it by taking the output of your joystick and sending it to a component sum2 and reversing it.

In order to do that you must first load a sum2 component for the job. If you are already using sum2 components they are listed in your file such as
loadrt sum2 count=2

Add 1 to the count
edit loadrt sum2 count=2 and make it loadrt sum2 count= 3

We will assume the sum2 we are adding is sum2.2

In order for the component to be updated each one needs to be added to a thread

addf sum2.0 servo-thread
addf sum2.1 servo-thread
addf sum2.2 servo-thread
etc.


Set the sum2 parameter to reverse the signal by adding this line
setp sum2.2.gain0 -1

Take the signal from the joystick and send it to the input of the sum2 instead of to halui.jog.input

net reverse-z sum2.2.in0 <= input.0.abs-z-position

Now take the output of the sum2 which is inverted and send it to the halui.jog.input

net joy-z-jog halui.jog.1.analog <= sum2.2.out

Hpe that helps,

Rick G

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

More
23 Sep 2010 14:19 - 23 Sep 2010 14:20 #4299 by photomankc
That does help. I was not getting exactly what I needed to do with the loading and adding them to a thread part and it was getting hard to try to reverse my way through the logic that develops the final output to see what was going on. I am starting to understand how the nets work in the config now. I'll see if I can sit down one night and get the steps here added into the config. Otherwise though everything else is working nicely.
Last edit: 23 Sep 2010 14:20 by photomankc.

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

Time to create page: 0.075 seconds
Powered by Kunena Forum