Jump to content

Open Source Joystick FFB / DIY FFB Joystick


Recommended Posts

That H-Bridge is fine. You will only need one.

Buy some very cheap motors to get a working test setup before you buy the motors you intend to use. Don't tear apart a Sidewinder for motors you can buy at a fraction of the cost. You can salvage a wall-wort for the power supply for the test set-up, but you will eventually need a proper power supply.

 

You will also need an ATmega32U4 based board and something to use as an ISP programmer. An Arduino Uno would be an easy choice.

You will need some 10 pots and some soldering equipment also. Practice before you solder anything if it's your first time.

 

I'd recommend a breadboard and some easy use wires.

 

 

Bear in mind, that it appears there is no working code at the moment.

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 419
  • Created
  • Last Reply

Top Posters In This Topic

Hi all

Now that summer is reaching its end I have more time to work on the Software again.

 

And here the problems start:

First I am still not happy with the effects. The sin function is my main problem at that point. I cannot figure out how this is defined.

Next problem is to calculate the Forces /PWMs without using floating-point operations. These are too time consuming for the MCU

 

Second is the Motors.

DC Motors have a nonlinear Power/ PWM curve and we need to find a solution to make it changeable easier.

I was thinking about a lookup table but the ATMega is lacing the space to add it. As we need to store the predefined effects as well.

 

And last I am running into Timing problems again. Whenever I try to add some functions to the Inputs (ADC or shift registers) the Device gets unstable.

 

 

Baseline of most of these problems is the MCU so I am starting to think about an Alternative.

 

First would be the stay with the ATMEGA32u4 and try to keep it slim and fast.

 

Next in line would be an Atmel SAM3 or SAM D10. But I haven’t used any 32bit controller. These come on the Arduino due. So they are easy to get. Here I am not sure if it would be possible to boot it as a HID

 

Then we have the Raspberry Zero but that would need a lot work to be recognized as Device.

 

Then there are the PIC / PIC32 MCU's but I think there will be some problems with the Compilers. These become quite expensive when we need more internal space.

 

Last Idea comes from my Working Colleges (thanks for that)

Implementing a Virtual USB Device and passing ready processed Data to a Physical device (UDP/USB-serial something completely different.

But here we would need a Person with more experience in Driver Development (not my best region)

 

 

EDIT: Another idea is to use multiple MCUs but the communication would be difficult

 

 

Maybe someone has some more ideas? Or can help in making a decision?

 

MetalGear_Honk


Edited by MetalGear_Honk

The threemost dangerous threads to Programmers:

  • Fresh air
  • Bright sun light
  • The horrifying screams of singingbirds

Link to comment
Share on other sites

What about using something like the Teensy 3.5 or 3.6?

 

https://www.pjrc.com/store/teensy35.html

https://www.pjrc.com/store/teensy36.html

 

The processor runs at 120/180 MHz and supports floating point. 512K flash and 192K RAM means that a LUT should easily fit. It also has a Joystick library to run it as a HID:

 

https://www.pjrc.com/teensy/td_joystick.html

 

Though it won't support force feedback out of the box.

Link to comment
Share on other sites

I'm very glad you will have so e more time to work on this Honk.

Last Idea comes from my Working Colleges (thanks for that)

Implementing a Virtual USB Device and passing ready processed Data to a Physical device (UDP/USB-serial something completely different.

But here we would need a Person with more experience in Driver Development (not my best region)

 

vJoy can already act as a virtual, forcefeedback USB device. So that route may be much easier than you think. Here is one thread that may be a good starting point for finding out more:

http://vjoystick.sourceforge.net/site/index.php/forum/5-Discussion/1244-what-do-you-use-as-an-ffb-source-when-coding

Link to comment
Share on other sites

Hi, I would be interested in getting into the software side. I have the tools, basic hardware and even some experience to go with. And, of course, as a flight simmer (is that a word?), motivation too.

 

 

 

I dug out my old project (adapt-ffb-joy - I think someone referenced it in this thread a couple of years ago) and wanted to improve the MS Sidewinder's FFB effects (the GamePort version) by bypassing its obscure FFB firmware with code running in Teensy (2.0) and controlling its motors directly with a simple L298N h-bridge. If that would work well, most of the FFB control code should have a lot in common with more ambitious hardware (like seen in this project plans) too.

 

 

 

Now, I stumbled into this project just recently. And, it seems like your path is taking a lot of parallel directions and seems very interesting. Is there some project page with the designs, code etc. in some Git or elsewhere or is this forum thread (phew! this is a looong thread you got here) the only way to the info and interaction?

Link to comment
Share on other sites

Hi

It is not my Thread but I think I High jacked it at some point.

I know of the FFB Adapter as it was part of my initial idea. And I think the code I put together as still some parts from your sources.

The mechanical design is only a basic idea and a STL file that I put up here in this thread.

For the Circuit I use a STK600 with a ATMEGA32U4 for testing but a Arduino micro is good as well (same MCU)

The plan is to add an ADS1115 for precision and some Daisy Chained Shift registers for Buttons/Rotaries.

The output is as you said an H-Bridge so a PWM and two directional Pins for each Motor.

My test Version is in this thread as well ... somewhere.

20171123_203833.jpg

JOYSTICK_Test.zip

 

MetalGear_Honk

The threemost dangerous threads to Programmers:

  • Fresh air
  • Bright sun light
  • The horrifying screams of singingbirds

Link to comment
Share on other sites

I saw your design images earlier, but now you've actually printed and constructed a physical version. Nice.

 

 

 

Any estimates on how much load, wear and tear it will take when printed with 3D printer plastic? The bearings seem to take the most wear off the plastic but the place where motors are attached to the axis could take some beating?

 

 

Ah, yes. The code does look a bit familiar. Good that you have found some use for the earlier work.

 

 

 

I have branched the adapt-ffb-joy code to an experimental branch called "direct-drive" which you can see here:

 

 

 

https://github.com/tloimu/adapt-ffb-joy/tree/direct-drive

 

 

It now has a working spring effect and auto center spring, but for other effects, just empty place holders.

 

 

The code is structured to separate the FFB calculations ("ffb-abacus") so that it could be easily tested separately and ported to other projects too, if you may. I could see potential for us to share that part of the code at least. The USB side and the actual low level motor control (including hardware dependent impulse response and force linearization compensations) can still go on their own directions easily.

Link to comment
Share on other sites

Hi

The print is only for testing. I am Planning to cast it in Aluminum went I am satisfied. I have a second version build out of Aluminum Profiles. (Paleti) but it is too heavy for my small testing Motors.

The printed version is more like a desktop mount.

I have not studied all of your code but it looks like it is at the same point as the one I did.

It is much more readable (looks like you work in a bigger Team more often)

For working together: happy to be part in your Project.

Now for the problems:

As I said some posts before I don't think the 32U4 can handle sin or Direction calculations. So there will be need for alternatives. LUT comes in mind but that would require more space in the MCU.

That would mean to get les Effects stored in the first place.

I think I need to take a closer look in your version. Maybe we can work it out together.

For the start I managed to add some more Effects in on my version that should be easy to port to your side.

Next would be inputs: do you plan on using the Internal ADC? As it is only 10bit. I was thinking on using an ADS1115 for its 16bit

MetalGear_Honk

The threemost dangerous threads to Programmers:

  • Fresh air
  • Bright sun light
  • The horrifying screams of singingbirds

Link to comment
Share on other sites

The sine pattern LUT shouldn't really be an issue.

 

 

Sine is symmetrical anyways, so you need only a quarter of it in the LUT and then mirror it along x or y axis depending on which part you need. You also don't need to be that accurate, 16 points is likely more than enough. Given that a long integer is 4 byte, that would cost you around 64 byte of memory - absolutely not an issue.

 

 

And why did I say long integer? That's because you should not use float for time critical calculations. Use fixed point arithmetics instead.

 

 

As for Microcontrollers, I really like STm32 based systems. Olimexino board for example is only around 20-30 bucks and the programmer, ST-LinkV2 is only 30 bucks too. Teensy sounds nice too.

Callsign "Lion"

Link to comment
Share on other sites

Here's a useful resource for this thread if it's not already known... a CAD generator for making custom pulleys to print. I downloaded OpenSCAD and generated pulleys with it and it works quite well.

 

https://www.thingiverse.com/thing:16627

 

I've been pursuing my MSFFII mod and finally have all the parts together, (the Shotkey diodes I needed were out of stock -everywhere- until last month) other than the large pulleys I've yet to print. Not sure if I should post about it here at this point though since it's in a very different direction than this thread has chosen so will start my own thread once I'm cutting metal and soldering have things to take pics of. I've already posted most of the relevant info along the way anyhow.

 

I acquired some 30t GT2 and 20t GT3 pulleys to do a comparison to evaluate the tactile properties though, which I'll post here after I get the belts and make a test rig for them. My drive will be 25:1 (5:1 x2), based on one of these pulleys.

 

I wound up using the 03 models of the 14000 series Pittman motors I linked before (skewed armature brushed DC motors that can be driven from a modded version of the MS circuit). Motor selection came down to cost, as these were readily available on ebay for pretty cheap along with some resistors to bring the voltage drop to the desired range. Torque will be ~3.5 - 4Nm after reduction.

Link to comment
Share on other sites

Here's a useful resource for this thread if it's not already known... a CAD generator for making custom pulleys to print. I downloaded OpenSCAD and generated pulleys with it and it works quite well.

 

https://www.thingiverse.com/thing:16627

 

I've been pursuing my MSFFII mod and finally have all the parts together, (the Shotkey diodes I needed were out of stock -everywhere- until last month) other than the large pulleys I've yet to print. Not sure if I should post about it here at this point though since it's in a very different direction than this thread has chosen so will start my own thread once I'm cutting metal and soldering have things to take pics of. I've already posted most of the relevant info along the way anyhow.

 

I acquired some 30t GT2 and 20t GT3 pulleys to do a comparison to evaluate the tactile properties though, which I'll post here after I get the belts and make a test rig for them. My drive will be 25:1 (5:1 x2), based on one of these pulleys.

 

I wound up using the 03 models of the 14000 series Pittman motors I linked before (skewed armature brushed DC motors that can be driven from a modded version of the MS circuit). Motor selection came down to cost, as these were readily available on ebay for pretty cheap along with some resistors to bring the voltage drop to the desired range. Torque will be ~3.5 - 4Nm after reduction.

 

 

I am really looking forward to see your finished stick. I would like to do the same with an MSFFII but with a much higher output torque for a full length stick. I wonder if it was possible.

[sIGPIC][/sIGPIC]



KG13 Control Grip Building

Control Stick and Rudder Design



 

i7 8700K, Asus Z370-E, 1080 Ti, 32Gb RAM, EVO960 500Gb, Oculus CV1

Link to comment
Share on other sites

Quick update. Got Constant, Sine and Square effects implemented and working in both x-y-axis with proper directions on my modded MSSW FFP. It has L298N H-bridge (with 12V wall wart) connected to Teensy 2.0 running the adapt-ffb-joy's direct-drive code branch. The lastest code is in the Git.

 

 

Looks like the ATmega32U4 is fast enough to relatively easily run at least a single Sine effect with all directions and such even when using full floating point calculus and no LUTs for sin(). But it is getting a bit tight and it certainly cannot run 10 active Sine effects in parallel if you want to update all forces every 1m while still be able to handle all joytick position reading and other USB protocol details.

 

 

Of course, you could really divide the force calculations into multiple 1ms cycles (of reading joystick position via USB) and thus, allow for more parallel effects to run even if their math takes longer than 1ms in total. I don't think anyone would be even able to feel the difference (especially thru all kinds of motor and real world inertias) even if you would calculate only some effects every 2ms and other effects every other 2ms.

 

 

But yes, as someone just mentioned here a couple of posts ago, optimizing for speed using a simplified sin() (LUT) and switching to integer math only will come handy at some point of development.

Link to comment
Share on other sites

  • 5 months later...

Hello. Inspired by the 5-coil FF joystick from the movie i thought of making less sophisticated, but much more DIY-able version of it with only 1 coil. It would basically be an electromagneting centering spring, with varying power depending on aircraft speed. Faster flight would generate more electromagnetic power, and no speed = no force.

 

 

 

I loved my saitek evo force's FF and miss it profoundly. And I hate spring centering, my springs were always neutralised. As most of FF flying consists of feeling speed forces on the stick, the 1-coil setup could be an affordable substitute for a fullblown FF stick. Plus, it can be easily incorporated into rudder pedals too.

 

 

 

I'm in the process of making my nth joystick, and at this stage i could seasily put a magnet and a coil inside it. The electronics seems so easy it can be made on Arduino, the only problem would be getting the speed value from the sim and getting it to the arduino, i'm not that much of a coder. Perhaps someone here could help.

 

 

I'm not sure what can be extracted from a flightsim, but flutter, buffet (e.g. stall warning), flak hits or losing an aerodynamical surface could be simulated too in this setup. This would make for much nicer experience.


Edited by sam_ogon
typo
Link to comment
Share on other sites

  • 3 months later...

Hello, i tried to get tloimus direct drive branch working, however the board is not detected when plugged in to usb.

I also tried MetalGear_Honks latest version which is detected fine as an FFB-Stick, but the data beeing sent does not change at all when the inputs are changed.

 

Has anyone managed to get either of the two versions running?

Link to comment
Share on other sites

Hi

For my Test Versions:

The Inputs are disabled so I can use my normal stick while testing.

If I remember correct I deleted the request trigger from the USB side.

I shelfed this Project. So not much more will happen from my side.

MetalGear_Honk

The threemost dangerous threads to Programmers:

  • Fresh air
  • Bright sun light
  • The horrifying screams of singingbirds

Link to comment
Share on other sites

  • 7 months later...

Force feed back

 

Hi, i am interested to build force feed back yoke.

Now i try making coding script.

I using leornad / uno board and upload as joystick.

Mega board run force feed back and run stick shaker.

I got two dc motor as x y

One motor as stick shaker.

I line coding vall map (16362, 0,-16362)

I also write situation airbone offser

Trim offset

Auto pilot offset

On ground will be generated value =1

On flight will be generated value =0

On speed 80knot vibration is slowly come. U will feel in your hand. (not see on yoke) every value i take from flightsim interface link2fs or nunalink.

Tq

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
Such a shame another great project for a yoke seams to have fallen by the wayside ! anyone care to help ressurect this awesome project ?

 

 

John

 

I very much want to ressurect this project!

 

As I've said several times, I think I have the coading/software skills this project really needs however my electronics/manufacturing skills are so severely lacking I have been unable to assemble even a mock setup for testing. If you (or anyone else) is able to guide me through assembling a test rig I'll gladly start cranking out software for this project:????

Link to comment
Share on other sites

  • 1 month later...

Hi, I didn't read through the thread, but made a first test using how many g's you pull to recenter.

I definitely like this feeling more than my good old sidewinder and will do some more testing.

At 1.14 you can see what happens if you near the stall.

Link to comment
Share on other sites

how to get the trim position and axis-position

 

Hi, I would like to continue my tests with using the trim-position and axis-position but I don't know how to get them from the export.lua. Do you know how I can get these values?

Harry

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...