today i'm gonna be talking about
controlling a linuxcnc machine
with a usb controller
I found a lot of examples on internet
where people are doing this
but in order to get it set up it's very difficult
I found an easy to it with a program called
qjoypad
and I wanna show you guys how I did it
first I want to show you
what we're trying to accomplish
and then I'm gonna show you how it's done
if you look over here we have
a cnc mancine
this is the Tiag CNC machine
we have LinuxCNC
computer setup
and it's all setup and ready to go
we can controll it with the keys
but I really wanted to have something
that was more
user-friendly
and a little bit easier to use with one hand. Or, with the other hand
What I did was I found this USB controller
and this is what I'm going to use
to control the CNC machine
So, if you take a look
i have the different functions mapped. So I have my up, down, left, right
on my X and my Y axis and I have my
Z axis mapped to these buttons
I have my speed mapped
to speed slower on the left bumper, and speed quicker on the right bumper
so if you take a look at the CNC machine
I can move it....
with the Y axis
I can move the X axis... and I can also move the Z axis
If I want to increment the speed or decrement the speed I can use these buttons
so if I wanna go slower
slow it down
if I wanna go faster
so that's what we're trying to accomplish, let me show you how I did it
So what I did was plugged in my USB controller
now what I'm gonna do
is
install qjoypad
there's a couple different methods of installation
you can download the source code and compile it but i've found that is a
little bit more difficult
than other methods so
I'm gonna show you how i do it
I actually install it through a debian package file
which you can download off the internet and then double click to install
so I'm gonna open up my web browser
and then i found
repository that has
the file
that we're looking for
the way that i find it is i do a quick google search
and the user is falktx
and then I include the name of
the package
which is qjoypad
i'm using version 4.1
you get a list of some different packages. depending on your system
you might use one or the other. I'm just going to go ahead
and use this i386 version
I'm gonna click on it
if you scroll down
you'll find
under built files there's a package that ends in .deb
this is the installer that we're looking for
I just click it
download it
I'm gonna go ahead and save the file. And I'm gonna launch it
so i see that there is an issue telling me it's going to require the installation
of one packages
so it's telling me I need to install
libqtgui4
so what I'm going to do is go ahead and install that
I'm gonna close this
and move this over here
the way that you're going to have to do that
is by a simple command
sudo apt-get
install
and then it's gonna be
the package that we're missing which is libqtgui4
so it's going to ask if you want install it. just verify with yes.
If you are having an error when you try to do that make sure
that you run
sudo apt-get update
and then what that'll do is update your
package manager to make sure that you have access to the latest package
so now I'm gonna try to run
the installer again
and see what happened
okay, all dependencies are satisfied let's go ahead and install the package
if you run into any other
problems there
are some other packages which you may have to install
I didn't have to but I'm going to list those on the screen
so if you need to, you can have those available
but I'm gonna just install
It's giong to ask you for your password
i'm using the default which is linuxcnc
so that's going to do
is go ahead and install
the qjoypad program
ok, good. Installation's finished
let's close this out
and let's go ahead and open the program
so we're gonna go to our applications
and for some reason it puts it under games
I'm not going to worry too much about that
just gonna open it up
and what it does is opens
it's a little hard to see but it's up in this
system tray. you're gonna have to click on that and it's going to bring up a window
that basically shows all of your key mappings
what you're going to do next is..
come down here too quick set
and then it's just going to ask you the name of the button
that you want use so
take a look down here
what I can do is I can map
any of these buttons. So I can map my axes, or I can map my buttons
I just need to click on it in order to
let it know which one I want to use. So, for example I'm gonna map the
left arrow
and it's gonna ask me for a key, so I'm gonna push the key on the keyboard
I'm gonna go ahead and do the same with the down, the right, the up. Then I'm gonna do my
z axis
and my speed control
what you want to do is make sure you update that and save it
I'm just gonna close this out
the software stays open
and now i can
open my
CNC machine
and lets see if the
buttons map properly
so I'm gonna go ahead and enable my machine
and then I'm gonna try it out
looks like it's working
and that's how you map your
CNC machine to a USB gamepad
hope you guys found this helpful
leave me some comments if you have
any questions