Manually controlling machine using EMC2?
- AssassinXCV
- Offline
- Junior Member
- Posts: 35
- Thank you received: 0
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.
Please Log in or Create an account to join the conversation.
John
Please Log in or Create an account to join the conversation.
- AssassinXCV
- Offline
- Junior Member
- Posts: 35
- Thank you received: 0
EDIT, oh, i see now, i thought that was editing the feedrate for when running the g-code, not controlling the axis, cool, thanks
Please Log in or Create an account to join the conversation.
'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.
Please Log in or Create an account to join the conversation.
- AssassinXCV
- Offline
- Junior Member
- Posts: 35
- Thank you received: 0
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
Please Log in or Create an account to join the conversation.
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
Please Log in or Create an account to join the conversation.
- AssassinXCV
- Offline
- Junior Member
- Posts: 35
- Thank you received: 0
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.
Please Log in or Create an account to join the conversation.
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.
- AssassinXCV
- Offline
- Junior Member
- Posts: 35
- Thank you received: 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
Please Log in or Create an account to join the conversation.
John
Please Log in or Create an account to join the conversation.