I would like to get some different behaviors from my
Gamepad for jogging. I looked around in the kmotion
Directory and all I could find is joystick.dll.
Is there anything a user could do with visual studio to
modify jog behavior?
Is there a third party app that fits between the gamepad
And kmotioncnc that is recommended?
The most important change I need is that during xy
jogging only one axis should be moving. There are setup
situations where having any movement whatsoever
on the other axis is intolerable. Maybe I could have one
of the trigger buttons isolate x or y.
There are too many possibilities to just
ask for them. It would be best if this is something I can
experiment with.
Customizing gamepad interface
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Customizing gamepad interface
Hi BillK,
There isn't currently any way to customize the Gamepad functionality without altering KMotionCNC source.
If you wish to do that see:
int CKMotionCNCDlg::DoJoyStick() in <>\PC VC Examples\KMotionCNC\KMotionCNCDlg.cpp
You might try temporarily setting the Jog Speeds for the axes you do not wish to move to zero in order to inhibit motion of those axes.
There isn't currently any way to customize the Gamepad functionality without altering KMotionCNC source.
If you wish to do that see:
int CKMotionCNCDlg::DoJoyStick() in <>\PC VC Examples\KMotionCNC\KMotionCNCDlg.cpp
You might try temporarily setting the Jog Speeds for the axes you do not wish to move to zero in order to inhibit motion of those axes.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Customizing gamepad interface
What is the ideal Visual studio to install ?
I had 2017. It did an import and had me add mfc 8.1
(probably) and rebuilt. There were some warnings but
no errors. It couldn’t find the exe to run and gave me
a long message about linker. I tried it with vs2015 but it also required an import of the project and it gave hundreds of errors.
I had 2017. It did an import and had me add mfc 8.1
(probably) and rebuilt. There were some warnings but
no errors. It couldn’t find the exe to run and gave me
a long message about linker. I tried it with vs2015 but it also required an import of the project and it gave hundreds of errors.
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: Customizing gamepad interface
Hi BillK,
The projects are compatible with VS2015 without any upgrading. See here.
Make sure you are using our latest Release Version 4.34
VS2017 should also work but when Microsoft upgrades the project the Target Directory is not maintained correctly. So you will need to correct this.
The projects are compatible with VS2015 without any upgrading. See here.
Make sure you are using our latest Release Version 4.34
VS2017 should also work but when Microsoft upgrades the project the Target Directory is not maintained correctly. So you will need to correct this.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Customizing gamepad interface
Bill,
If you opened the solution/projects in 2017 then went back and tried to open/build in 2015 that is probably what is causing your build errors in 2015.
I'd suggest reinstalling to a new dir and building with 2015 again.
If you get that far I found that I had to modify the following code as the joystick was far too sensitive for my use. Even without touching the joystick I'd see it command very small moves. If I used other joystick software to validate the hardware it would not show any 'movement' ( A good online one is https://gamepadviewer.com/ ). Anyway here is what I modified:
Around line 5378 of KMotionInstallDir\PC VC Examples\KMotionCNC\KMotionCNCDlg.cpp
you'll find method:
Modify the 1600 value, increase the value to make the joystick less sensitive. I ended up at 30000. For me this makes it so that if I'm slightly off while pushing on the joystick I only get movement in the dominate direction that I'm pushing the joystick. I'm using an Xbox 360 wireless controller.
To aid in debugging this might help, around line 4982 (just before the // handle external Jog commands) add:
Greg
If you opened the solution/projects in 2017 then went back and tried to open/build in 2015 that is probably what is causing your build errors in 2015.
I'd suggest reinstalling to a new dir and building with 2015 again.
If you get that far I found that I had to modify the following code as the joystick was far too sensitive for my use. Even without touching the joystick I'd see it command very small moves. If I used other joystick software to validate the hardware it would not show any 'movement' ( A good online one is https://gamepadviewer.com/ ). Anyway here is what I modified:
Around line 5378 of KMotionInstallDir\PC VC Examples\KMotionCNC\KMotionCNCDlg.cpp
you'll find method:
Code: Select all
double CKMotionCNCDlg::DoJoyAxis(int axis, int joystick)
{
double v;
v = joystick-0x7fff;
if (ThreadIsExecuting) v=0;
if (fabs(v) < 1600) v=0; // <- modify the 1600 value here to suit, higher values make joystick less 'sensitive'
v *= m_JogSpeed[axis] * m_JogSpeedOverride[axis] * m_JogSpeedFactor / 32768.0;
return v;
}
To aid in debugging this might help, around line 4982 (just before the // handle external Jog commands) add:
Code: Select all
TRACE("new xpos %g\n", ji.dwXpos);
TRACE("new ypos %g\n", ji.dwYpos);
TRACE("new m_Joyvx %g\n", m_Joyvx);
TRACE("new m_Joyvy %g\n", m_Joyvy);