Manually controlling machine using EMC2?

More
17 Apr 2011 08:57 - 17 Apr 2011 09:07 #8998 by AssassinXCV
I think this is the best place to post this, since it has got to do with machining.

Is there a way to manually move the machine using EMC2? What i mean by that is can i use the directional arrow keys on my keyboard, or any buttons on the screen (like on Kcam), to manually control the cnc machine using the stepper motors and driver?

I've read around that you can connect a usb gamepad and edit some of the hal files to control the machine with that, but, the only usb controller i have an a modified original xbox controller, that, on windows, uses open source drivers that are not signed by microsoft (meaning i jsut need to select "Disable Driver Signature Enforcement"). I've tried plugging in that xbox controller to my computer with linux, but when ever i edit the hal files, i get errors on the start up of EMC2.

Since using a gamepad isn't possible right now (unless i go out and buy one) I wanted to be able to just use the keyboard to control my machine.

Thanks.
Last edit: 17 Apr 2011 09:07 by AssassinXCV.

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

More
17 Apr 2011 11:18 #9000 by BigJohnT
The keyboard can certainly move the machine around and you can use the mouse to press the axis +- buttons on the screen. Have you discovered the MDI tab? You can enter one line of g code at a time there and execute it.

John

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

More
17 Apr 2011 18:38 - 17 Apr 2011 19:04 #9007 by AssassinXCV
i knew it must have been simple. thanks. can't believe i didnt see that.

EDIT, oh, i see now, i thought that was editing the feedrate for when running the g-code, not controlling the axis, cool, thanks
Last edit: 17 Apr 2011 19:04 by AssassinXCV.

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

More
18 Apr 2011 11:19 - 18 Apr 2011 11:21 #9041 by andypugh
AssassinXCV wrote:

've read around that you can connect a usb gamepad and edit some of the hal files to control the machine with that, but, the only usb controller i have an a modified original xbox controller, that, on windows, uses open source drivers that are not signed by microsoft (meaning i jsut need to select "Disable Driver Signature Enforcement"). I've tried plugging in that xbox controller to my computer with linux, but when ever i edit the hal files, i get errors on the start up of EMC2.


That just means you have edited the HAL files wrongly.

You need to do it step-by-step (and possibly in a seperate HAL file)

First make sure you can get hal_input to load and detect the joypad. then look in the hal-config screen of Axis to see what the buttons are called, then add them in.

There are rather too many pages on the joypad subject on the Wiki. This is the one you want to follow:
wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Simple_Remote_Pendant

Incidentally, when EMC2 starts up with errors, those errors tell you exactly what is wrong. If you read them, you should be able to fix the problem.
Last edit: 18 Apr 2011 11:21 by andypugh.

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

More
22 Apr 2011 04:07 - 22 Apr 2011 05:52 #9247 by AssassinXCV
In step 3, it says: "In you .hal file (the main one)" <--- what main one?? you guys aren't explaining if its one of emc's system files, or the one in ubuntu/emc2/config/MYCONFIG/.

And if it's in that location i gave, then which is the "main" one, any could be the main one, the "standard_pinout.hal" or the "core_stepper.hal". How are supposed to know?

Thanks, help would be appreciated

EDIT: found more indepth tutorial
Last edit: 22 Apr 2011 05:52 by AssassinXCV.

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

More
22 Apr 2011 11:03 - 22 Apr 2011 11:05 #9251 by BigJohnT
The problem is there are so many configurations and all have the "main" hal file with different names that no one can possible know which one is the "main" one. However in your ini in the [HAL] section the hal files are loaded in order from top down and the first one is your "main" hal file.

There is no real reason to have more than one hal file unless you have something like a pyvcp panel and you need to have some connections made after the gui loads. I assume some developers in the past thought it made it easier to have more than one hal file like core stepper and parallel port pin out etc.

www.linuxcnc.org/docview/html/config_ini_config.html#sub:[HAL]-section

And the files could really be anywhere but are usually in ~emc2/config/nameofyourconfig

John
Last edit: 22 Apr 2011 11:05 by BigJohnT.

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

More
28 Apr 2011 10:04 - 28 Apr 2011 10:14 #9444 by AssassinXCV
After making my own config using the creator i have a folder called "my-mill" containing files: "custom.hal" "custom_postgui.hal" "my-mill.hal" "my-mill.ini" "README" "tool.tbl"


Step1

----I run these 2 codes:

CNCMachineComputer@ubuntu:~$ halrun

halcmd: loadusr hal_joystick -d /dev/input/js0 -p joypad

----And it spits out this:

halcmd: <stdin>:1: execv(hal_joystick): No such file or directory


Step2

----I followed Step 2 and this is what i got in Terminal:

I: Bus=0003 Vendor=045e Product=0289 Version=0120
N: Name="Microsoft X-Box pad v2 (US)"
P: Phys=usb-0000:02:00.0-1/input0
S: Sysfs=/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-1/2-1:1.0/input/input4
U: Uniq=
H: Handlers=event4 js0
B: EV=b
B: KEY=683f0000 400000 0 0 0 0 0 0 0 0
B: ABS=3003f

Step3

----To make things simple, i used the exact same code as giving in the tut:

----In the my-mill.hal

" # for remote joypad
loadusr -W hal_input -KRAL Dual"

----In the "my-mill.ini" file in the [HAL] section i already have "HALUI = halui" so all is good.

Step4

EMC2 starts up and i get a big error log. Will post later (sorry if this is inconvienient


Any help would be great.

Thanks.
Last edit: 28 Apr 2011 10:14 by AssassinXCV.

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

More
28 Apr 2011 10:41 #9447 by andypugh
AssassinXCV wrote:

N: Name="Microsoft X-Box pad v2 (US)"
...
loadusr -W hal_input -KRAL Dual


The device name pattern math "Dual" will fail to find "Microsoft X-Box pad v2 (US)". Try

loadusr -W hal_input -KRAL X-Box

(load userspace driver hal_input and wait until it finishes loading, look for a HID device where the name contains "X-Box" and make pins for the Keys, Relative-Analogue, Absolute-Analogue and LED functions that you find)

More docs here:
www.linuxcnc.org/docview/html/man/man1/hal_input.1.html

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

More
28 Apr 2011 22:10 - 28 Apr 2011 22:13 #9472 by AssassinXCV
Okay, making progress. now in: HAL Configuration>Pins>Input>0:
i have: input.0.btn-a
input.0.btn-a-not
input.0.btn-b
input.0.btn-b-not
input.0.btn-back
input.0.btn-back-not
...

Onto next step
Last edit: 28 Apr 2011 22:13 by AssassinXCV.

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

More
28 Apr 2011 22:13 #9474 by BigJohnT
You have to click on each pin to add them to the Watch window.

John

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

Moderators: piasdom
Time to create page: 0.091 seconds
Powered by Kunena Forum