Force Feedback Device

Page: 12345.. > >> Showing page 1 of 6
Author
pk_volt
Super Member
  • Total Posts : 354
  • Reward points : 0
  • Joined: 2007/04/27 19:35:47
  • Location: 0
  • Status: offline
2008/03/04 23:07:18 (permalink)
0

Force Feedback Device

Anyone have any luck with this?

An "efriend" helped me out a lot with the report descriptor which he somehow extracted the ~800 line report descriptor from a MS FFB wheel using snoopy.   Miraculously, "we" got it to finally work by modifying the sample C code for the 18f4550. 

I haven't touched the device for a while now, and as mentioned by LBodnar on this forum, the PID data sheet is full of errors and very difficult to understand. 

One also mentioned that bigger companies design their own protocol and heavily abuse the USB compliant standards.

I was just wondering if there has been any work on the force feedback side of things in the open-source side of things.


#1

114 Replies Related Threads

    DarioG
    Scheisse Menschen
    • Total Posts : 52392
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: hi there
    • Status: offline
    RE: Force Feedback Device 2008/03/05 02:52:11 (permalink)
    0
    That's nice - I'm always interested in such objects.
    Are you creating the whole device too? Motors and such?
    #2
    pk_volt
    Super Member
    • Total Posts : 354
    • Reward points : 0
    • Joined: 2007/04/27 19:35:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/03/05 03:13:04 (permalink)
    0
    Hi DarioG,

    I remember you helping me out a lot on these forums during the time I was developing the firmware.  Really glad to see that you're still sticking around! :)

    I've built a simple mosfet H bridge driver.  The plan was to drive a geared disc motor through a gear pulley to increase torque and minimize torque ripple.  Since I have very little experience with mechanical setup, I wasn't able to complete the task before school started.   It's a real shame that I never got to even test out what the device would've felt like.  It'd be really interesting to see how the torque ripple would come into play. 

    I was thinking of implementing some PID to a brushless or multi-phase motor to totally minimize torque ripple and allow maximum "smooth" steering rotation somehow.

    Here is a little video of what I had working:

    http://youtube.com/watch?v=8ZKv0dJCjiA

    I was thinking of maybe releasing the firmware sometime in the future, but right now, the code is just an entire mess with lack of commenting on a lot of parts. 

    If you ever have any interest in developing ffb devices, let me know, and I'll try to help you out with resources in any way I can!
    post edited by pk_volt - 2008/03/05 03:17:02
    #3
    DarioG
    Scheisse Menschen
    • Total Posts : 52392
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: hi there
    • Status: offline
    RE: Force Feedback Device 2008/03/05 03:19:17 (permalink)
    0
    Yeah Smile

    I have little knowledge in mechanical so I usually have to rely on others Smile which is often hard.
    I guess that we can keep in touch on this - I've taken a look at accelerometers recently and I also should start a work on bike-models, so I'll be around.
    #4
    yvesr
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2005/05/02 03:08:07
    • Status: offline
    RE: Force Feedback Device 2008/03/05 16:07:59 (permalink)
    0
    this interface work with Happ control wheel force feedback
    http://www.happcontrols.com/driving/50010200.htm

    high power driver interface

    Yves


    schematic file in PDF

    #5
    pk_volt
    Super Member
    • Total Posts : 354
    • Reward points : 0
    • Joined: 2007/04/27 19:35:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/03/09 07:28:24 (permalink)
    0
    ORIGINAL: yvesr

    this interface work with Happ control wheel force feedback
    http://www.happcontrols.com/driving/50010200.htm

    high power driver interface

    Yves


    schematic file in PDF


    Very Interesting.

    Seems like they used an op-amp instead of an H-bridge for a motor controller.  I was wondering what kind of benefits there would be with this setup.


    #6
    Pierre1
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2008/08/26 04:21:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/09/11 14:08:19 (permalink)
    0
    Hi Volt,

    I am involved in the development of a force feedback application using a PIC18F4550 micro-controller. I understand you have worked on something similar.  Could you possibly provide some assistance on how to modify the Microchip OS so that we are able to get the FF signal from a gaming application on the PC, via a USB port so that the controller could activate a basic rumble engine?  The PID specs are quite complicated to go through and figure out how things should be done...

    Any assistance would be appreciated. Is your code available if we dare to have a look [8|]
    Thanks,
    Pierre
    #7
    pk_volt
    Super Member
    • Total Posts : 354
    • Reward points : 0
    • Joined: 2007/04/27 19:35:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/09/12 14:31:52 (permalink)
    0
    Hi there,

    it's nice to see someone have interest in this particularly rare development. I did not modify anything in my operating system because the USB Force Feedback drivers are standard USB HID compliant, so windows should automatically detect it when you plug in your force feedback device.

    I have to admit that the firmware was not entirely my own work as I got a lot of help from a few people, but nevertheless, it works.  The hardest part is to get the few hundred line report descriptor to enumerate by windows. 

    I agree that the force feedback PID pdf is poorly written and very difficult to understand, and I was told the example report descriptor doesn't even work and ended up having to extract the report descriptor from an old microsoft force feedback joystick using snoopy. 

    If I were to attempt this project again, I would probably try writing my own microsoft drivers to intercept force feedback commands from the O/S and send my own defined commands to my force feedback device.
    post edited by pk_volt - 2008/11/26 12:32:20
    #8
    Pierre1
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2008/08/26 04:21:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/09/15 01:48:14 (permalink)
    0
    Volt,

    Thanks for your feedback and advice. 

    For our application we just need the vibrator signals as force feedback signals, excluding all the remaining signals provided by USB stack.  Accordingly,  if at all possible, we would appreciate getting the "output report descriptor" listing for this specific application of vibrator signals transmission to be recognized by windows OS and how to extract the incoming packet (is it with HIDRxReport function)?

    Input and advice are quite appreciated.
    Best,
    Pierre
    #9
    chinzei
    Super Member
    • Total Posts : 2250
    • Reward points : 0
    • Joined: 2003/11/07 12:39:02
    • Location: Tokyo, Japan
    • Status: offline
    RE: Force Feedback Device 2008/09/16 08:33:06 (permalink)
    0
    Hello Pierre1,

    Are you talking about MS Xbox gamepads (or equivalent)?
    From USB view point, these gamepads aren't HID devices, but HID-like devices.

    These links show the device/config descriptors of these devices.

    a) Xbox game controller (old one): VID/PID = 045E/0202
    "Inside Xbox Controller"
    http://euc.jp/periphs/xbox-controller.ja.html
    Descriptor:
    http://euc.jp/periphs/xbox-pad-desc.txt

    b) Xbox 360 controller: VID/PID = 045E/028E
    http://www.free60.org/wiki/Gamepad
    Google cache
    http://209.85.175.104/search?q=cache:PmdskQ0UrdEJ:www.free60.org/wiki/Gamepad

    c) Xbox 360 Wireless Controller (PC): VID/PID = 045E/028F
    http://hexitaka.exblog.jp/6223238/


    In the interface descriptors on these links, you'll find that these gamepads don't have any HID class, but vendor specific.

    bInterfaceClass 255 Vendor Specific Class

    Therefore, you can't enumerate these gamepads using the original Windows built-in HID device driver. To make PC recognize the Xbox 360 controller as a HID device, MS provides a specific HID mini-driver. This mini-driver connects lower USB device driver to HID driver, and it makes the device as if it is a HID device.

    "Xinput Driver for Microsoft Common Controller (32 Bit)" on MS downloads
    http://www.microsoft.com/downloads/details.aspx?FamilyID=0e989b12-576b-42f2-b7c1-2a17ce25188b&displaylang=en

    Also, these devices don't return any report descriptor.
    Just the packet format is known, as above a) and b) describe.

    As of the vibration,
    a) Xbox game controller (old one) (from above a) link)
    The output report (rumble control) is 6-byte.
    offset	data
    +0 0x00
    +1 0x06 (size of the whole report)
    +2 0x00
    +3 left actuator (*)
    +4 0x00
    +5 right actuator (*)

    (*) unsigned 8-bit


    b) Xbox 360 controller (from above b) link)
    Rumbler Control
    Rumbling is also similar to on the original controller. Rumble commands take the following 8-byte form:
    000800bbll000000
    Where b is the speed to set the motor with the big weight, and l is the speed to set the small weight (0x00 to 0xFF in both cases).


    Tsuneo
    #10
    pk_volt
    Super Member
    • Total Posts : 354
    • Reward points : 0
    • Joined: 2007/04/27 19:35:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/09/16 12:12:22 (permalink)
    0
    Hi there,

    I apologize for the late reply.  I personally don't mind giving a helping hand.  I will have to consult with the the person I worked with on releasing any part of the firmware since it was his work.

    But for now, just to give you a head start, if you want vibration effects, you need to use the periodic effect descriptor as mentioned in the pid.pdf.  Basically, this report descirptor will tell you the frequency, amplitude and the effect tyhpe (sine wave, trapezoid etc).  Though I yet to implement it in my firmware, I did at one point, manage to make sense out of the data using snoopy.

    I will try my best to keep you updated.

    I will also upload some of the force feedback programs I used to test out my device so that you can get a better idea of how data is transmitted in and out of the USB port.

    stay tuned.  Smile
    post edited by pk_volt - 2008/09/16 12:13:57
    #11
    Pierre1
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2008/08/26 04:21:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/09/16 14:02:54 (permalink)
    0
    Hi Chinzei,
    The game controller is a generic USB controller one for the PC.  Not familiar with Xbox technology.
    Would any of the Xbox info apply?

    #12
    chinzei
    Super Member
    • Total Posts : 2250
    • Reward points : 0
    • Joined: 2003/11/07 12:39:02
    • Location: Tokyo, Japan
    • Status: offline
    RE: Force Feedback Device 2008/09/17 00:29:41 (permalink)
    0
    The game controller is a generic USB controller one for the PC.

    Generic for what, USB HID or DirectX?

    If it is generic USB HID joystick, pk_volt's comment is applied.
    If it is generic DirectX device, Xbox 360 controller is the base.

    To know which type, read out the descriptors of the game controller.
    For this purpose on Windows, UVCView is better than USBView.
    Which interface do you see?

    bInterfaceClass 03 HID Class --- generic USB HID joystick
    or
    bInterfaceClass 255 Vendor Specific Class --- generic DirectX device

    UVCView is included in WDK.
    "How to Get the WDK and the WLK" on MS WHDC
    http://www.microsoft.com/whdc/DevTools/WDK/WDKpkg.mspx

    After installation of WDK,
    C:\WINDDK\6001.18001\tools\avstream\x86\UVCView.exe


    If it is a USB HID device, the formatted report descriptor is read out by this sniffer.

    HHD USB Monitor Professionnal (DMS) - one month trial
    http://www.hhdsoftware.com/Downloads/usb-monitor-pro.html

    Tsuneo
    post edited by chinzei - 2008/09/17 01:02:28
    #13
    Pierre1
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2008/08/26 04:21:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/09/20 10:19:03 (permalink)
    0
    Hi Volt,

    We actually succeeded to write the descriptor based on the data we get using sniffers from a joystick with embedded vibrators:
    The descriptor is:
     
    0x05,0x01,0x09,0x04,0xa1,0x01,0xa1,0x02,0x75,0x08,0x95,0x01,0x15,0x00,0x26,0xff,
    0x00,0x35,0x00,0x46,0xff,0x00,0x0b,0x02,0x00,0x00,0xff,0x09,0x30,0x09,0x31,0x09,
    0x32,0x09,0x35,0x15,0x00,0x26,0xff,0x00,0x75,0x08,0x95,0x05,0x81,0x02,0x09,0x39,
    0x15,0x01,0x25,0x08,0x35,0x00,0x46,0x3b,0x01,0x65,0x14,0x75,0x04,0x95,0x01,0x81,
    0x02,0x05,0x09,0x19,0x01,0x29,0x0c,0x15,0x00,0x25,0x01,0x75,0x01,0x95,0x0c,0x55,
    0x00,0x65,0x00,0x81,0x02,0xc0,0xa1,0x02,0x75,0x08,0x95,0x07,0x46,0xff,0x00,0x26,
    0xff,0x00,0x0b,0x02,0x00,0x00,0xff,0x91,0x02,0xc0,0xc0

    Where 7 bytes are sent form the host to the device but the problem is that while using the below mentioned command to retrieve the incoming data, we are getting the same results even though the vibrator is active:
       if(!mHIDRxIsBusy()) HIDRxReport(RxB,7); Where RxB is an array of Char   We appreciate your assistance..
    Thanks,
    P.
    #14
    pk_volt
    Super Member
    • Total Posts : 354
    • Reward points : 0
    • Joined: 2007/04/27 19:35:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/09/21 03:23:00 (permalink)
    0
    Nice!

     I remember there is another report descriptor you need to look at other than the effect report as referring to the usb pid.pdf.  Use snoopy to see how which sets of data is being received and find that particular descriptor in the pid.pdf that indicates the amplitude, and frequency of the signal.



    I've uploaded some ffb files for reference on my website

    http://members.shaw.ca/bokinator/ffbstuff.zip


    i just did a quick search on google and found this to extract a report descriptor:  http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=hid_init#5

    maybe give that a shot.  I'm very tempted to resume my progress in my firmware.

    keep us posted.  I will try my best to help you out in any way I can.
    post edited by pk_volt - 2009/01/30 13:50:47
    #15
    pk_volt
    Super Member
    • Total Posts : 354
    • Reward points : 0
    • Joined: 2007/04/27 19:35:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/09/21 12:35:15 (permalink)
    0
    One more thing I should've mentioned

    For your vibration effect, the way the descriptor works is that it will send only  ONE report per effect.  This is like playing a file for 3 seconds.  In the very beginning of the effect, the PC will send you all the information such as start/duration value of the periodic effect, the amplitude and frequency etc. 

    Your controller has to calculate this signal out and determine how long the effect has to be played for and the amplitude of the signal etc (eg. sinewave).  When you have multiple effects, you have to add all the signals together in your firmware (eg. if you have a trapezoid and sinewave together).

    This is the reason why you only have only one constant 7 byte report coming from the host for a vibration effect.

    Try playing around with the fedit.exe file I have posted.

    good luck, and keep us posted
    post edited by pk_volt - 2008/09/21 12:42:51
    #16
    Pierre1
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2008/08/26 04:21:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/09/22 07:40:30 (permalink)
    0
    Chinzei,
    Thanks again for your detailed reply. We are actually struggling a bit with the incoming stream and the modality to actuate the rumble engines.  Forwarded your reply/recommendations to the rest of my team and might get back to you with questions.

    Best,
    Pierre
    #17
    Pierre1
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2008/08/26 04:21:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/09/23 11:45:43 (permalink)
    0
    Hi Volt,
    Through Snoopy and fedit as well as the DirectX engine, we succeeded in identifying the seven byte structure as the following listing:
     
     Byte 0: Always equal 01.  Byte 1: Determine the actuation direction, in our case 81 for the left vibrator and 41 for the right vibrator.   Byte 2/3: Actuation duration represented in two bytes.  Byte 4/5: Always 10/E0.  Byte 6: Signal magnitude.   Moreover, the following patterns figure in the 7 bytes which still unidentified but we estimate that the first byte represent a certain command:    02-01-00-00-00-00-00  03-01-00-00-00-00-00  04-00-00-00-00-00-00  06-00-00-00-00-00-00   However, we still cannot figure a way to retrieve the 7 bytes in our firmware. We are adopting MICROCHIP firmware for the USB stack written in C18. We would appreciate your assistance in retrieving the mentioned bytes or any lead that could assist in this endeavor.  
    Thanks in advance, Pierre
    #18
    Arrow
    New Member
    • Total Posts : 12
    • Reward points : 0
    • Joined: 2008/09/23 12:54:17
    • Location: POLAND
    • Status: offline
    RE: Force Feedback Device 2008/09/23 13:52:14 (permalink)
    0
    Hi,


    I have a question to you pk_volt
    I saw your video on youtube and your implementation of force feedback playing with LFS (I love this game ;) ).
    I want to ask you what kind of PID effect did you use? It is a Download Force Sample or Custom Force Streaming? Maybe other one?
    I already implement some software and I able to send a receiving date via USB.
    I’m also able to “talk” with PC as joystick, sow the basic I have, now I really want to implement force feedback for my steering wheel for LFS ;)
    Please give me advice an may by some example, I don’t ask about source code, but fore information about this whole descriptors ;-)

    Sorry for my English ;-)


    Best regards,
    Arrow
    #19
    pk_volt
    Super Member
    • Total Posts : 354
    • Reward points : 0
    • Joined: 2007/04/27 19:35:47
    • Location: 0
    • Status: offline
    RE: Force Feedback Device 2008/09/23 14:07:32 (permalink)
    0
    Hi Arrow,

    LFS only spits out constant force.  So if you can get constant force to work in your program, then you're all set to go in LFS and force feedback :)


    #20
    Page: 12345.. > >> Showing page 1 of 6
    Jump to:
    © 2017 APG vNext Commercial Version 4.5