1. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  2. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  3. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

News Open source force feed back

Discussion in 'DIY peripherals' started by Hoantv, Oct 2, 2019.

  1. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    337
    Balance:
    2,177Coins
    Ratings:
    +107 / 1 / -0
    P.s. Also there are some concept that MMOS has some limited gain on the force compared to arduino EMC. Will you encounter that with your soft?
  2. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    I. About LUT Generator. Here is result with myfirmware, MMOS Firmware with same hardware and result T300rs. I dont understand these. can you explain them?
    1. what do color curves mean
    2. which is good and why is it good?
    upload_2020-4-20_21-46-36.png
    II. Grapth.
    I dont understand too. Which is good and why is it good?
    upload_2020-4-20_22-0-52.png
    upload_2020-4-20_22-2-23.png

    I have not used EMC yet. You mean MMOS have internal gain for each force?
    I will display gain configuration for each force (arduino version did)
    Last edited: Apr 20, 2020
  3. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    337
    Balance:
    2,177Coins
    Ratings:
    +107 / 1 / -0
    You've got DD so you can compare. That's a dd too. You can get what is what then with that test. Your chart is fine.
    OSW Small MiGE DirectDrive Wheel.jpg


    Lut basicaly Asseto Corsa tool, here it's convenient to look up the linearity with it. The line should be straight. Eliminate the dead zone with your wheel and it'll be good.
    Kinda.
    [​IMG]

    But this is also a basic concept for this test, and the wheel also may not be seted up according to this for gaming, to make the long story short.

    No I mean MMOS may be suppressed on gain vs EMC.
    • Like Like x 1
  4. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Hmm, I understand that,:
    1. About LUT: If I resolve deadzone, it is good.
    2. About Graph:
    here is result with MMOS with same wheel. Compare with other wheel, this firmware is still not good.
    the better x axis reach 0 and -10000, the better firmware.
    Currently I have not thought which affects this result yet.

    upload_2020-4-21_11-55-15.png
  5. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    337
    Balance:
    2,177Coins
    Ratings:
    +107 / 1 / -0
    This is simply full power direction changes in 300 ms if default signals. Depends how much gain you put in soft ofcourse. The other thing is the sharpness of that changes, reaction, and all that depends on the wheel not on the soft then. It even can be a motor driver itself too. For the sake of a test you can power up the motor with crazy figures, but that's not gonna be a practical application for gaming.
    Your graph is quite alright for a belt drive with this motor.

    Tell more about your software. Do you have an interface already? When will be released?
    It must be must be cool of coding with stm32)
  6. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    I found problem.
    It is my pwm frequency is 20khz.
    i control pwm in main loop that is too high frequency (38khz) => that cause pwm update too fast and turnback imediately after receiving torque command.
    the remedy: i used interrupt timer wit 20khz it same MMOS as video :D.
    If i reduce pwm to 8khz, it is better than mmos (it reach -9800). i dont know how pwm frequency affect if i reduce it.
    Looking for a recommandation :)!

    Do you have an interface already =>You mean GUI? => not yet, i will learn about delphin or C# to made it (with arduino i using processing 3, but it is hard to make comunitcation with processing). Currently i dont know how to comunicate with firmware, maybe use HID or other protocol.
    When will be released? => I dont know, i made it in my free time. I learn about it when i code. So it is slowly :(.
    Hope it can replace the legendary MMOS :D!!!
    Last edited: Apr 21, 2020
  7. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    I try to debug deadzone, i recognized that, it is not caused by firmware. It cause by DC motor and BTS7960. If i turn on motor and connect bts7960 to power without control signal pwm. The motor moves hardly. When removing power for bts7960, motor moves easily. Does any one resolve this problem?
  8. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    337
    Balance:
    2,177Coins
    Ratings:
    +107 / 1 / -0
    that cause pwm update too fast and turnback immediately after receiving torque command.

    What do you mean by this?)

    If you are using BTS driver, going with 38khz:
    ScreenShot04337.jpg ScreenShot04338.jpg

    With reports on power on motor hardly moves. Haven't noticed such things actually, but people report. With EMC new versions, the author made two pwm signals, and instead of giving constant 5v+ on r_en/ l_en hi made dir pin activation when it is needed. Also min force applied must be resolving it a bit.
    ScreenShot04205.jpg



    MMOS has such connections layout, if it might help you too.
    PwmPins (1).png
  9. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    I mean main loop set PWM strengh. It update too fast with ffb calculator (38khz in main loop, pwm is 20khz) => motor can not reach desired position. I reduce frequency update to 10khz, i think it ok know.
    I think min force is good idea, it is remedy for this case. Now I test each effects one by one:

    My firmware
    https://youtu.be/HWS_HxkV4eM
    https://youtu.be/jJVz6ZulJWs
    https://youtu.be/vAuLJjlXF6M
    https://youtu.be/tb5H-fFh-z4
    https://youtu.be/m9KNdqBQkrc
    https://youtu.be/8Q-PXxV_xjA
    MMOS
    https://youtu.be/YBTG2mTKSyA
    • Like Like x 1
    Last edited: Apr 26, 2020
  10. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Need help for testing:

    These firmware is for testing. Currently I haven't made GUI. I hardcode some-

    • Gain total = 30%
    • gain for each effect is 100%.
    • PWM mode is H-Brigde (PE9, PE11)
    • metric for conditional effect (damper, interia, friction)
    based on your encoder choose correcponding to firmware

    Please report issuses i will solve them as soon as possible.

    I will find the way to create GUI and log report from STM32. currently I dont know how to made this :(.

    https://github.com/hoantv/CarSimulatorFirmware
    • Like Like x 1
    Last edited: Apr 25, 2020
  11. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Video i used firmware for AC:
    • Like Like x 2
  12. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    337
    Balance:
    2,177Coins
    Ratings:
    +107 / 1 / -0
    So, how is it?;)
    Did you overcome the dead zone with a base? And I guess you should not make the default with 100% for all effects. Better to bring them down. That also can be the reason for DZ. Only ffb and soft lock. And better to put up the ffb main gain to 100%. In a game it can be lowered then.
    Last edited: Apr 29, 2020
  13. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    It was solved. But i dont know why ( i reinstall hardware :) ). The wheel move easily. When testing encoder deviance, i used cycle test with 40% (dont reduce after reinstall hardware), it is too strong. After 10 minutes i came back the wheel is deattached, end motor holded on in this position.
    I think it is broken bts or motor, because deadzone is too high. I will purchase new ones to replace.
    I will add all gain for all effect include total gain when i code GUI.

    Attached Files:

    • Like Like x 1
  14. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    I 've tested. Can use HID send report to config firmware. there is 2 type of config.
    this used for hardware setup, need reset STM32
    typedef struct { // Setup Report
    uint8_t reportId; // =20
    uint32_t encoderCPR;
    uint32_t encoderIndex;
    uint32_t encoderReverse;
    uint8_t pwmMode;
    uint8_t pwmFrequency;
    } __attribute__((packed)) USB_Setup_Report;

    This used for wheel setup on flying
    typedef struct { // Setup Report
    uint8_t reportId; // =20
    uint8_t resetWheelPostion; // =20
    uint16_t maxWheelAngle;
    uint16_t minForce;
    uint16_t maxForce;
    uint16_t constantGain;
    uint16_t rampGain;
    uint16_t squareGain;
    uint16_t sineGain;
    uint16_t triangleGain;
    uint16_t sawtoothDownGain;
    uint16_t sawtoothUpGain;
    uint16_t springGain;
    uint16_t damperGain;
    uint16_t inertiaGain;
    uint16_t frictionGain;
    } __attribute__((packed)) USB_Config_Report;
    maybe more like filter factor, pid factor,...

    do you recommend some things else?
  15. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    337
    Balance:
    2,177Coins
    Ratings:
    +107 / 1 / -0
    I,m not into codding, sorry) but looks like everything what is needed. Keep going man!

    With bts, better look for those that did noth have gag523 chips.
  16. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Do you know others better?
  17. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    337
    Balance:
    2,177Coins
    Ratings:
    +107 / 1 / -0
    Any of them. 633 etc don't take 523
  18. tassault

    tassault New Member

    Joined:
    May 3, 2020
    Messages:
    5
    Balance:
    78Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hi all,
    I made my own simulator with steering wheel and pedals. I will post some pictures but now I want to develop the for feedback with the arduino code of HoanTV. Thank you for your job, it's amazing !!

    I want to make FFB in two steps :
    - 1st step : arduino LEONARDO with TB6560, STP-58D111, power supply 24V-15A and rotary encoder LPD3806-600BM-GS-24C
    This is a micro FFB configuration to verify the code and play a little before I use the real configuration. if I succeed this micro setup, I apply in my real configuration
    - 2nd step : arduino LEONARDO with HBS86H servo drive, 86HSE8.5N-B32 (encoder included 1200), power supply 24V-15A

    So,
    Do you think that it's possible to use the HOANTV code for my two confugurations?
    Do you have an schematic wires please ? Can you confirm me :
    Pin 0 and 1 for the encoder ?
    Pin 9 for the PULSE and Pin 10 for the DIRECTON ?

    I donwload te arduino code in the arduino loenardo and everything is ok (donwload ok). But, when I plugged the arduino LEONARDO, the WHEEL CHEK 1.72 software bugged (not response). What's the problem ?

    I'm sorry for my basic questions but I'm a neewbie in electronic system.
    Thank you very much for your help.
  19. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Pin 0,1 for encoder
    Pin 9,10 for pwm +-, pulse/dir not yet test because i dont have driver.
    About freeze, i just tested lastest code. Firmware work as normal. Try again with lasted code.
    About step i dont have experience. I only use servo and driven belt. If you success, pls post your setup here :)!
  20. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    107
    Balance:
    873Coins
    Ratings:
    +64 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    i recognized that, bts had a problem, it only control motor when ffb is greater than 20%, that why motor can easily move. I replace with new bts. It is hard to move the motor again. Not yet found a solution. I will try set pwm =+- 1 based on encoder value to see what happen.
    Last edited: May 4, 2020