Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for the Jogcon's motor #15

Open
sonik-br opened this issue Sep 15, 2021 · 13 comments
Open

Adding support for the Jogcon's motor #15

sonik-br opened this issue Sep 15, 2021 · 13 comments

Comments

@sonik-br
Copy link

Hi!

Recently I've got an Jogcon and I've been messing with it's motors.

There's some documentation of it's commands here

After some experiments I've got it working on PsxNewLib. Please take a look at my fork

Basically it needs to be in analog mode with rumble enabled. Then when pooling, we don't set the two motors bytes. Instead it's one byte with the Mode and Power. Mode can be like rotate left, rotate right, return to center...

There's also an working sketch example to trigger the effects with button presses.

@sonik-br
Copy link
Author

sonik-br commented Oct 7, 2021

After some experiments I've got it working on MAME with racing games and simulating an Force Feedback Wheel.

https://www.youtube.com/watch?v=NGUYPHisn0s

And then my psx shield died :(
Still need to figure out what's happened.

@SukkoPera
Copy link
Owner

That is very cool! Thanks a lot! I'm very busy at the moment, but I will hopefully get to merging this soon.

Can you contribute a short document on how to configure MAME for this?

Also, did you fix your shield?

@sonik-br
Copy link
Author

Sure I can.
But I still need to finish the plugin. I'm struggling with the language and pointers :(
MAME does not support force feedback directly but there's an plugin for it. I'm editing this plugin to add support for the jogcon.
I will let you know when i publish the plugin code (and the arduino code)

The shield is still dead. I can code the shield LEDs to turn on. Pins are ok - tested them with a multimeter.
It started to malfunction from time to time then it completely stopped working.
Any advice on testing it?

@SukkoPera
Copy link
Owner

If you happen to accidentally bend the connector, sometimes the pins will break in an almost unnoticeable way, try looking at them with a lens.

You can also check the solder joints of the MOSFETs.

@sonik-br
Copy link
Author

Hi.
Published my working on:
https://github.com/sonik-br/FFBArcadePluginJogCon

It's all there. Arduino sketch and MAME plugin.

For MAME you should read the FFBArcadePlugin readme.
In short it's just drop the plugin in MAME's folder and edit mame.ini.
Then edit mame.ini and configure it's OSD OUTPUT OPTIONS.

output windows

This will let MAME send FFB commands to the plugin.

On the plugin side you just need to edit the included FFBPlugin.ini and set the correct serial com port.

@CrisesUrv
Copy link

Hi. Published my working on: https://github.com/sonik-br/FFBArcadePluginJogCon

It's all there. Arduino sketch and MAME plugin.

For MAME you should read the FFBArcadePlugin readme. In short it's just drop the plugin in MAME's folder and edit mame.ini. Then edit mame.ini and configure it's OSD OUTPUT OPTIONS.

output windows

This will let MAME send FFB commands to the plugin.

On the plugin side you just need to edit the included FFBPlugin.ini and set the correct serial com port.

Hi! This sounds really great. I already have a JogCon working as wheel/paddle/spinner using Sorgelig's JogConUSB code on an Arduino Micro, so trying your project seems quite straightforward.

I flashed your Arduino sketch with your patched PSX lib and the paddle/spinner modes seem to work (with FFB stops for the paddle mode). The wheel mode does not have FFB enabled (it does not self-center) but I understand that it is because it is expecting to receive FFB serial commands. I replaced the Mame FFB plugin by your patched version and put the Arduino's port in the .ini file. All seem to be set properly but I get no FFB effects at all. I've tried to monitor serial communication on the Arduino port while running some FFB-enabled mame games but there was nothing.

The regular FFB plugin was working fine with other controllers I have so Mame outputs seem to be working fine.

So, it seems that the patched FFB plugin is not sending FFB commands to the jogcon for some reason. I'm using mame 233 if this means anything. Do you have any clues on what may be happening?

@sonik-br
Copy link
Author

Hi!

Please test this app. It will send serial commands to the arduino.

JogconSerialApp.zip

Be aware that you need to press any button on the jogcon from time to time or it will disable the motor.
Let me know if it works.

@CrisesUrv
Copy link

Hi!

Please test this app. It will send serial commands to the arduino.

JogconSerialApp.zip

Be aware that you need to press any button on the jogcon from time to time or it will disable the motor. Let me know if it works.

Thanks! This worked fine: the app connected to the proper port (the same i set in the FFB plugin ini file) and the FFB commands produced the expected effects.

So it seems that for some reason the FFB plugin is not sending the serial commands. Does it maybe need special permissions? I'm using Windows 7 by the way.

@sonik-br
Copy link
Author

Don't need any special permission.
Try enabling log output on FFB Arcade Plugin. It should have some logging for the serial com port.

@CrisesUrv
Copy link

CrisesUrv commented Jan 30, 2022

Ok, this is what the log looks like when playing Outrunners:

loading original library...
C:\Windows\system32\dinput8.dll
library loaded
openning serial port for Arduino/Jogcon
\\.\COM45
successfully opened serial port
creating ffb loop thread...
Before CreateThread
After CreateThread
In FFBLoop
in initialize
numJoysticks = 
6
Joystick: 0 / Name: Nintendo RVL-CNT-01 / GUID: 030000007e0500000603000000000000

Joystick: 1 / Name: Motion Controller / GUID: 030000004c050000d503000000000000

Joystick: 2 / Name: Motion Controller / GUID: 030000004c050000d503000000000000

Joystick: 3 / Name: Motion Controller / GUID: 030000004c050000d503000000000000

Joystick: 4 / Name: SparkFun Pro Micro / GUID: 030000004f1b00000492000000000000

Joystick: 5 / Name: vJoy Device / GUID: 0300000034120000adbe000000000000

No haptic joystick found, selecting first joystick matching the GUID: 4 / Name: SparkFun Pro Micro / GUID: 030000004f1b00000492000000000000

disabling all current FFB effects
setting haptic gain to 100
setting haptic auto center to 0
creating base effects...
Initialize() complete
Setting DefaultCentering & DefaultFriction forces...
Entering Game's FFBLoop loop
RomName = orunners
RunningFFB = RacingActive1
P1 value: 
0
P2 value: 
0
P1 value: 
1
Doing sine...
P1 value: 
1
P1 value: 
1
P1 value: 
1
P1 value: 
1
P1 value: 
1
P1 value: 
1
P1 value: 
1
Doing sine...
P1 value: 
1
Doing sine...
Doing sine...
Doing sine...
Doing sine...
Doing sine...
Doing sine...
P1 value: 
0
P1 value: 
0
P1 value: 
0
P1 value: 
0
P1 value: 
0
P1 value: 
0
P1 value: 
0

@sonik-br
Copy link
Author

Try with only the arduino connected. Remove all other joysticks.
Also, I have not tested this game. I 've got it working on SF Rush and Virtua Racing.

@CrisesUrv
Copy link

CrisesUrv commented Jan 31, 2022

Got it working with SF Rush. Thanks!

For the other games, the problem was that I was not using the correct versions. For instance, for Out Run only the deluxe sitdown version has FFB.

I also tried other Jogcon compatible controllers (not Namco's), such as the Logic3 topdrive reactor, and the driving feeling and FFB is even better. Great!

@sonik-br
Copy link
Author

Yeah. on VR you have to enter the service menu and set it as deluxe cab I think.

Done this project for fun. The Jogcon is not a great controller to play those arcade games.

If you want to use common FFB wheels I recommend to use a newer version of the FFB Plugin (from Boomslang). Mine is outdated.
Also check the official thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants