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

proyecto forcefeedback arduino

Discussion in 'DIY peripherals' started by nicko_esx, Jan 20, 2014.

  1. nicko_esx

    nicko_esx Member

    Joined:
    May 28, 2012
    Messages:
    37
    Location:
    argentina
    Balance:
    696Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    Arduino
    hola compañeros.
    les queria presentar mi proyecto de forcefeedback. hay dos prototipos en la mecanica.
    el primero utiliza una gran reduccion, conectada por un eje al volante. como embrague entre segmentos del eje utilizo un trozo de manguera ajustando la presion. el problema que tiene este es la elasticidad propia de la manguera... l cual quita velocidad en respuesta.
    el segundo prototipo es basado en un rodillo de impresora matriz de punto. antigua. luego a ambos lados del mismo estan dos ejes pasa hojas de impresoras. estos ultimos son los ejes conductores conectados a reductores. la ventaja de este sistema es que el eje del volante recibe la presion de los conducidos pero resbala al superar sierta friccion, a modo de embrague. protegiendo asi el motor.
    espero les guste.
    por ahora falta mucho desarrollo en el firmware. y honestamente no logro hacerlo funcionar con simtools por no conocer el modo en que envia los datos para asi desarrollar su firm.
    prototipo 1
    [​IMG]


    prototipo2
    [​IMG]
    • Like Like x 5
  2. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,918Coins
    Ratings:
    +1,285 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    Allow me to be the first respond to your magnificent work ... WOW
  3. nicko_esx

    nicko_esx Member

    Joined:
    May 28, 2012
    Messages:
    37
    Location:
    argentina
    Balance:
    696Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    Arduino
    thank you very much.
    I must say that there is much work to do.
    I have to improve firmware.
    I must learn simtools
    ..
    Thanks for commenting.
  4. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,918Coins
    Ratings:
    +1,285 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    You must be a very good printers technician to do such idea :thumbs ... me to have some knowledge in this field ... but never thought of using such mechanisms in feedback pot or driving a FFB motor to the steering wheel ... perfect my dear perfect ...:thumbs

    I guess you used a normal h-bridge for that DC motor ... does it worm up or it needed a fan onto it ?

    keep up the good work ... love it:cheers
  5. nicko_esx

    nicko_esx Member

    Joined:
    May 28, 2012
    Messages:
    37
    Location:
    argentina
    Balance:
    696Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    Arduino
    friend
    I'm not really technical printer. I'm a newbie and electronics enthusiast. Printer parts were collected for a DIY CNC project.
    with respect to the H bridge, I used this simple model to put together. a cooler for cooling. but take very little temperature to 200 pwm. pwm already heated to 255.
    http://www.pyroelectro.com/tutorials/h_bridge_4_transistor/

    if you want I can upload the Arduino code. It is very simple. much remains to be scheduled. but I have no such experience.

    sorry for my bad English. I use a translator
    • Like Like x 1
  6. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,918Coins
    Ratings:
    +1,285 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    yes please ... If you have problems making it receive from Simtools ... which I guess it is not needed as long you're able to make it working through your game directly ... I'm sure we have the perfect Developers here who can really help ...

    me too using translator and a lot of spilling errors are found:oops: ... please keep the common English .
    Last edited: Jan 20, 2014
  7. nicko_esx

    nicko_esx Member

    Joined:
    May 28, 2012
    Messages:
    37
    Location:
    argentina
    Balance:
    696Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    Arduino
    ok. upload the Arduino code.
    with respect to x-sim. is a simple profile. use a single axis, with the forces: lateral, axis in game, yaw.

    Code:
        int motor = 3;
    int motor2 = 5;
        int giroi;
        int girod;
        int Gforce = 0;
        int Gforce1 = 0;
        int Gforce10 = 0;
        int Gforce100 = 0;
    
        char kind_of_data;
    
        void setup() {
                       
         
          Serial.begin(9600);
        }
    
        void loop() {
    
         
          while(Serial.available() > 0) {
         
            kind_of_data = Serial.read(); //para USO X~a01~ Y~a02~
            if(kind_of_data == 'X') {
              Read_Pos(kind_of_data);
            }
            if(kind_of_data == 'S') {
              Read_Pos(kind_of_data);
            }
          }
        }
         
        void Read_Pos(char motor_ffb){
          delay(2);
          int Gforce100 = Serial.read()- '0';
          delay(2);
          int Gforce10 = Serial.read()- '0';
          delay(2);
          int Gforce1 = Serial.read()- '0';
       
         
        //if (Gforce1 < 0) { Gforce = Gforce10 + 10*Gforce100; }
        // if (Gforce1 < 0 && Gforce10 < 0) { Gforce = Gforce100; }
        // if (Gforce100 < 0) { Gforce = 127; }
        //  if (Gforce1 >=0 && Gforce10 >= 0 && Gforce100 >= 0) { Gforce = 100 * Gforce100 + 10 * Gforce10 + Gforce1; }
    Gforce = 100 * Gforce100 + 10 * Gforce10 + Gforce1;
         
          if (motor_ffb == 'X') {
           
            //Gforce = constrain ( Gforce, -255 , 255);
           
            if (Gforce < -100) {
                giroi = Gforce ;   
          giroi = map(Gforce  ,-255 ,-100 , 100, 200); 
          giroi = constrain (giroi, 100 , 200);
            analogWrite(motor2,0);
            analogWrite(motor,giroi);
           
            delay(10);
    
         
            }
          if(Gforce > 100){
          girod = Gforce;
            girod = map (Gforce , 100, 255, 100 , 200 );
            girod = constrain (girod, 100 , 200);
            analogWrite(motor,0);
            analogWrite(motor2,girod );
           
            delay(10);
    
          }
       
         
      if (Gforce >= -80 && Gforce <= 80){
    analogWrite(motor,0);
            analogWrite(motor2,0);
            delay (10);
          }
     
      }
          if (motor_ffb == 'S') { //para el stop
            analogWrite(motor,0);
            analogWrite(motor2,0);
        }
        }
        
    • Like Like x 1
    • Agree Agree x 1
  8. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,918Coins
    Ratings:
    +1,285 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    As fast idea as I'm not a FW code expert but I guess there are a missing line or two to be added on top of your code to solve the problem ... but with review and permission from the Developers to use ... you can find it in any same version arduino FW that works with Simtools projects here ... Good luck
    Last edited: Jan 20, 2014
  9. nicko_esx

    nicko_esx Member

    Joined:
    May 28, 2012
    Messages:
    37
    Location:
    argentina
    Balance:
    696Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    Arduino
    I uploaded the code is for x-sim.
    you say that simtools just need some lines to fit?
    I will investigate.
    thank you very much
  10. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,918Coins
    Ratings:
    +1,285 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    last post edited ... please don't risk your project until it is fully compatible .
    @yobuddy ,@value1 ,@prilad these are the big stars here for this job ... Big sorry if I missed any one else :oops:

    as you see my green badge says I'm only a tester for Simtools ;)
    • Like Like x 2
    Last edited: Jan 20, 2014
  11. nicko_esx

    nicko_esx Member

    Joined:
    May 28, 2012
    Messages:
    37
    Location:
    argentina
    Balance:
    696Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    Arduino
    hola a todos.
    subo un nuevo video.
    aqui se muestran algunas mejoras en configuración.
    se agrego efectos como aceleración, gear, se mejoro la vibración etc.
    espero les guste.
    hi all.
    I upload a new video.
    you can see improvements in configuration.
    aggregate effects as acceleration, gear, vibration is improved ....
    I hope you like it.

  12. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,918Coins
    Ratings:
    +1,285 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    good + lot of noise .... put 2 or 3 > 100uf/50V Non pole [NP] capacitors or higher in parallel with the motor to reduce the noise ... or some low pass filter coils in serial with the motor ...
    Non-Polarized-Electrolytic-Capacitors-NP-BP-220UF50V-Size8X21-.jpg ECR0192.jpg photo2.jpg

    why still not using Simtools ?:(
    • Like Like x 1
    • Informative Informative x 1
  13. nicko_esx

    nicko_esx Member

    Joined:
    May 28, 2012
    Messages:
    37
    Location:
    argentina
    Balance:
    696Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    Arduino
    hello thank you very much for the recommendation.
    simtools still no use. I can not find an example that serves to guide me. to adapt the code.
  14. eaorobbie

    eaorobbie Well-Known Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,574
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,400Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Adapting the code is quiet easy @nicko_esx all depends on what force you are using to send to the Ard.
    Not all plugin allow the use of lat or yaw but alot have it.

    I can easily advise what needs to be changed and how to set up simtools.

    BTW a very nice idea and build, Well Done.
    • Like Like x 1
  15. eaorobbie

    eaorobbie Well-Known Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,574
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,400Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    @nicko_esx looking at your code this should work, just need to add your comport to the settings and save.
    FBB - YAW_LATURAL.png FBB - INTERFACE.png
    Just checking noticed in the code you phrase it as x and y but code looks for x and s ?
    If it is yes then the output needs to be changed from y to s. Thats all.
    Plus we call lat force here a Sway DOF
    • Like Like x 1
    • Informative Informative x 1
  16. nicko_esx

    nicko_esx Member

    Joined:
    May 28, 2012
    Messages:
    37
    Location:
    argentina
    Balance:
    696Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    Arduino
    thank you very much for the orientation
    I'll try
    with respect to S. I use it as xsim stop sign at datapacket simulatorstop. otherwise the engine is in motion.

    I have some doubts.
    xsim I am using a single axis with the following forces:
    longitudinal force 100% (add result value)
    joyaxis sender X 100% (add. ..)
    acceleration speed 40% (add..)
    lateral force 100% (add..)
    100% gear shake effect (add..)
    100% RPM (add..)

    as I do in simtools to add all these forces in one axis?
    • Creative Creative x 1
  17. nicko_esx

    nicko_esx Member

    Joined:
    May 28, 2012
    Messages:
    37
    Location:
    argentina
    Balance:
    696Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    Arduino
    I Could not use simtools with Arduino
    Connection arduino light illuminates. but no data movement or
    I'll have to modify the code?
    Last edited: Jan 24, 2014
  18. eaorobbie

    eaorobbie Well-Known Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,574
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,400Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Ok now we see , no sorry this will not work with simtools at the present, we dont output the joy axis , gear shake and rpm from the engine some of that is done via the Game Dash.
  19. nicko_esx

    nicko_esx Member

    Joined:
    May 28, 2012
    Messages:
    37
    Location:
    argentina
    Balance:
    696Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    Arduino
    Ok. but maybe you can try only with the forces. the problem is that I can not run by arduino.

    Enviado desde mi XT915 mediante Tapatalk
  20. eaorobbie

    eaorobbie Well-Known Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,574
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,400Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    ok you just need to set axis correctly as in axis 1 needs to include yaw and sway only
    Then in the interface you just need the X<Axis1>
    On end you can do the S.
    If I get what ya mean.