1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. 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!
  3. 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
  4. 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:
    391
    Balance:
    2,216Coins
    Ratings:
    +115 / 2 / -0
    Superb!
    Will it be hard to add pwm like 250Hz? Just curious to test motors with it.
  2. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    I think it is not hard, calculate prescale and period.
    I see all firmware have “spring on desktop”. But I dont understand why we need this? It only for testing or other purpose?
  3. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    391
    Balance:
    2,216Coins
    Ratings:
    +115 / 2 / -0
    250Hz or a kind of it will be great.
    Spring should even be made on the game a bit, i've read somewhere. I use it with dir mode in diy driver, to make the switching in the center to be active and all be working right then. So, the motor controllers working on it, should then have it too. I guess so.
  4. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    I added desktop spring on GUI.


    Todo:
    - process configdata in stm32
    - store config data to flash
    - add desktop spring effect.
    - add filter for condition force
    - add BLDC support
    - test and fix bug
    - RELEASE :D!!!!
    • Like Like x 3
    • Winner Winner x 1
  5. tassault

    tassault New Member

    Joined:
    May 3, 2020
    Messages:
    5
    Balance:
    78Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hi Hoantv,
    unfornately, it's not possible to use stepper motor for ffb... I make a mistake.... So, I don't know what I can use with brushless motor... What do you propose ?
  6. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    currently, I dont have brushless motor. So I dont know how to code for it.
  7. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    update: write config to and read config from flash
    • Like Like x 2
  8. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    391
    Balance:
    2,216Coins
    Ratings:
    +115 / 2 / -0
    Hoantv, hi. The right pwm dir connection to check the motor free rotations.
    The schematic is now right. Just swap the wires. It works.
    PwmPins.jpg..jpg
  9. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    It is strange :). Pwm connect to enable, dir (always 1,0) to pwm.
    I will test after finishing the configuration module.
  10. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    391
    Balance:
    2,216Coins
    Ratings:
    +115 / 2 / -0
    Previously the lay out it was not proposed by me. But by another dude.

    If read the manual to BTS it won't be strange) L_EN R_EN is just a switch to each of the half bridges correspondingly. And only one controlling signal for each of the half bridges RPWM LPWM is required.
    ScreenShot03757.jpg


    ScreenShot03756.jpg

    So you have to pwm the switch. A commom thing actually, but in that case, it's usually just one mosfet stand alone, on negative or positive side to be pwm'ed ) So all then should come clear.

    But i bet a lil bit some extra work should be done. I don't like the way it works. The DZ is even more vs "standard". MB give an optos to the signals. Will see.
    • Like Like x 1
  11. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Update: test configuration :d!!!
    • Like Like x 2
  12. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    What do you think about pwm frequency like this


    switch (setupMotorConfig_Report.pwmFreq) {
    case 0:
    pwmPeriod = 499;
    break;
    case 1:
    pwmPeriod = 999; // 8.4 Khz
    break;
    case 2:
    pwmPeriod = 1499; // 5.6 Khz
    break;
    case 3:
    pwmPeriod = 1999; //4.2 kHz
    break;
    case 4:
    pwmPeriod = 3499; //3.36 kHz
    break;
    case 5:
    pwmPeriod = 3999; //2.1 kHz
    break;
    case 6:
    pwmPeriod = 8399; //1.0 kHz
    break;
    case 6:
    pwmPeriod = 16799; //500 Hz
    break;
    case 8:
    pwmPeriod = 33599; //250 Hz
    break;
    default:
    pwmPeriod = 499;
    break;
    }

    Attached Files:

    • Winner Winner x 1
  13. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    391
    Balance:
    2,216Coins
    Ratings:
    +115 / 2 / -0
    I don't know, how it will behave, bit it's defenetly very cool you can, and make it!:)
  14. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Basiccally, all feature except overall filter (i write a hard code to fix cutoff frequency)
    Need some days to optimize before release.
    Would you like to test the firmware?
    • Winner Winner x 1
    Last edited: May 30, 2020
  15. Sieben

    Sieben Active Member

    Joined:
    Nov 6, 2018
    Messages:
    391
    Balance:
    2,216Coins
    Ratings:
    +115 / 2 / -0
    For sure)
  16. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Too much setup for wheelbase :(!!!!!
    Maybe I will release test version in early June. I need volunteers to test firmware to make it better (communicate via PM)
    I will create a group for discussion.

    Attached Files:

    • Like Like x 1
    Last edited: Jun 1, 2020
  17. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    The firmware is ready to test. I will write a document to describe how to configure it and release at the weekend
    • Like Like x 1
    • Winner Winner x 1
  18. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Hmm, there is a problem with filters. I used this library:

    https://www.earlevel.com/main/2012/11/26/biquad-c-source-code/
    The sample frequency: is equal force feedback update (2500 sample per second)
    Fc: 1-> 1250.
    Q: default value is 0.707
    Used this to choose FC and Qfactor
    https://www.earlevel.com/main/2013/10/13/biquad-calculator-v2/

    If is no filter (Fc>0), ffb is still fine.
    If apply filtering, some time losing ffb around 0.5-> 1 second.
    Any idea for this?
    (The condition effect is not smooth. Need make it smoother)
  19. Fzonta

    Fzonta New Member

    Joined:
    May 5, 2019
    Messages:
    9
    Balance:
    100Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    Arduino

    I'm very interested
  20. Hoantv

    Hoantv Active Member

    Joined:
    Jul 19, 2019
    Messages:
    117
    Balance:
    981Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    AC motor, Arduino
    Problem is solved. Due to my bts is too hot :)) when i tested max torque!
    • Like Like x 1
    • Winner Winner x 1