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

Simulated Wind using MonsterMoto and ArduinoUno

Discussion in 'SimTools compatible interfaces' started by SilentChill, May 15, 2015.

  1. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,461
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,596Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    The Arduino won't care what brand the fan is.
  2. Martyn

    Martyn Member Gold Contributor

    Joined:
    Feb 12, 2017
    Messages:
    97
    Location:
    Europe
    Balance:
    49Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    2DOF, SCN6
    Well ok i gave it a go, it´s doing something, but for sure not what it should..
    I used the arduino code and settings from the first post (Many thanks @SilentChill !), i got output from Simdash but the fan acts like it is off until i reach 255kmh then it starts to blow:)
    I test it using Assetto corsa so i deleted the Math value..
    Any ideas?

    Edit: i tested NL2 with same resoluts. I connected fan to motherboard and it runs ok. MM is probably fine also (the light at motor output goes more bright with bigger speed and vice versa..).
    Maybe i connected it wrong somehow - the fan cable has 3 pins, but i connected just + and - to MM - is that correct,,?
    Last edited: Oct 23, 2018
  3. Bastiuscha

    Bastiuscha Active Member

    Joined:
    Apr 1, 2017
    Messages:
    291
    Location:
    Germany
    Balance:
    750Coins
    Ratings:
    +191 / 2 / -0
    My Motion Simulator:
    6DOF
    Yes, the third pole is only for the rpm logging. I don't believe, that the fans are strong enough, but that is no problem, to change them later. Did you do a virtual test (interface output type), in the game dash tool?
  4. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    You don't control the speed of a 3 wire pc cooling fan by varying the input voltage like a regular dc motor because its brushless.
  5. Bastiuscha

    Bastiuscha Active Member

    Joined:
    Apr 1, 2017
    Messages:
    291
    Location:
    Germany
    Balance:
    750Coins
    Ratings:
    +191 / 2 / -0
    My Motion Simulator:
    6DOF
    Hm i don't believe. That can be simple tested by a power supply with a possible voltage changing. I did that for many times in my life.
  6. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    From my limited experience you can control them but only down to about 40%-50% then the brushless controller doesn't function. Therefore I'm not sure why his doesn't start until full power is applied.

    Edit:Maybe full power is not being applied but I figure 255kmh with no math outputs 255. At 8bits thats full power.
    Last edited: Oct 24, 2018
  7. Martyn

    Martyn Member Gold Contributor

    Joined:
    Feb 12, 2017
    Messages:
    97
    Location:
    Europe
    Balance:
    49Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    2DOF, SCN6
    I dunno what you mean by virtual test..?
    But asi i said - output from gamedash seems ok.. Motomonster also changes output LED brightness according to speed..
    So maybe the @BlazinH is correct and this type of fan can not be used like this..?

    Attached Files:

  8. Bastiuscha

    Bastiuscha Active Member

    Joined:
    Apr 1, 2017
    Messages:
    291
    Location:
    Germany
    Balance:
    750Coins
    Ratings:
    +191 / 2 / -0
    My Motion Simulator:
    6DOF
    The virtual test, can be activated in this tool under "Settings/Interfaces" as a output type. But your screenshoot looks quit ok. For me, the fan you want to use is bad too, but because they blow not strong enough. To simply check yor electric setup, check your 12V output with a multimeter. The voltage should be simpley increase with the speed. My Assetto Corsa settings are:
    MATH * 9
    ROUND 0
    PAD 4 0
    For me that works perfect. On near 300km/h i have 12V Output. As fan i can strongly recommend the seaflow fans, that many people use here, including me.
    • Like Like x 1
  9. Martyn

    Martyn Member Gold Contributor

    Joined:
    Feb 12, 2017
    Messages:
    97
    Location:
    Europe
    Balance:
    49Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    2DOF, SCN6
    Thank you for info! Will try to measure the voltage at output and probably order the seaflo fan..:)
  10. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    Heres some good info about how pc fans work. It does say you can control speed by varing the voltage but since brushless motors require electronic components to work it only makes sense that if the input voltage drops below whats required it will stop working. For example will your television still work if you run it at half voltage.
    https://www.hardwaresecrets.com/anatomy-of-computer-fans/2/
    Last edited: Oct 24, 2018
  11. Bastiuscha

    Bastiuscha Active Member

    Joined:
    Apr 1, 2017
    Messages:
    291
    Location:
    Germany
    Balance:
    750Coins
    Ratings:
    +191 / 2 / -0
    My Motion Simulator:
    6DOF
    I use Seaflow "Blower 4" (two of them) and they are awesome.
  12. Fernando Romão Filho

    Fernando Romão Filho New Member Gold Contributor

    Joined:
    Aug 6, 2018
    Messages:
    9
    Balance:
    271Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, AC motor, Arduino
    hello friends, good night everyone,
    I'm putting a fan in my project, but because it is of great proportions, I chose to use a fan with a three-phase AC motor,
    control the same via frequency inverter,
    I put a code, send via the serial monitor the phrase "S x" (where X is a value from 0 to 255), before my programming my fan rotates according to x value, but when I use the same to gamedash,
    does not go out of zero, and using a virtual interface, it appears that the gamedash is sending "S x" (where x is the speed of the cart),
    Can anyone give me a light on why serial monitor works and no gamedash?
  13. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    Game Dash is sending what you told it to send if I'm understanding you correctly. Try using S<Dash1> instead.
    • Like Like x 1
    Last edited: Nov 4, 2018
  14. Fernando Romão Filho

    Fernando Romão Filho New Member Gold Contributor

    Joined:
    Aug 6, 2018
    Messages:
    9
    Balance:
    271Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, AC motor, Arduino
    EXACTLY!! it's like what I send via serial, but it does not work, I think it's the bit type, something like that,
    How do I attach my code here?
    I am not using BuffArray system I am using String

    //PROJETO SIMULADOR DE VENTO NOLIMITS2
    // DESENVOLVIDO POR MAICON RUIZ
    // 14 988074057
    //DEFININDO VARIAVEIS PARA ATRIBUIR VALORES LIDOS;
    String stringGeral, dispositivo, valorRecebido;
    int S1 = 11;
    //variavel que ira receber o valor do GAMEDASH
    int valor;
    void setup() {
    // INICIA SERIAL DE COMUNICACAO
    Serial.begin(9600);
    //DECLARA O TIPO DOS PINOS
    pinMode(S1, OUTPUT);
    }
    void divideDados()
    {
    //verifica se os dados recebidos possuem "espaço"
    if(stringGeral.indexOf(" ")>=0)
    {
    //vamos retirar a primeira frase de 0 ate o "espaço" , que é o separador
    dispositivo = stringGeral.substring(0, (stringGeral.indexOf(" ")));

    // vamos retirar a frase depois do "espaço" que é o primeiro caracter apos separador
    valorRecebido = stringGeral.substring((stringGeral.indexOf(" ") +1));
    if (valorRecebido > 255) {
    valorRecebido = 255;
    }
    }
    }
    void loop() {

    // VERIFICA SE ESTA CHEGANDO ALGO NO BLUETOOTH
    if (Serial.available() )
    {
    stringGeral = String("");
    while(Serial.available())
    {
    //PEGA TODOS CARACTERES E ADD NA STRING
    stringGeral = stringGeral + char(Serial.read());
    delay(10);
    }
    divideDados();
    //Serial.println("String Geral: "+stringGeral);
    //Serial.println("Dispositivo: "+dispositivo);
    //Serial.println("Valor Recebido: "+valorRecebido);
    // LE O VALOR RECEBIDO DO GAMEDASH E COLOCA NA VARIAVEL VALOR
    valor = valorRecebido.toInt();
    // VERIFICA E EXECUTA OS COMANDOS DA VARANDA 1
    if(dispositivo == "S")
    {
    analogWrite(S1, valor);
    }
    }
    }
  15. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    The speed value is output as an ascii char if that helps. And did you set game dash output settings?
  16. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    Upon looking over your sketch its over complicated. You will always get 2 bytes in each packet so all you need to do is when serial available is > 1 is to read once and put S into its variable and then read again to get the speed.

    edit:If you put a space between S and the speed value then of course its 3 bytes not 2
    • Informative Informative x 1
    Last edited: Nov 4, 2018
  17. Fernando Romão Filho

    Fernando Romão Filho New Member Gold Contributor

    Joined:
    Aug 6, 2018
    Messages:
    9
    Balance:
    271Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, AC motor, Arduino
    Hi BlazinH,

    Thank you for your help, my friend.
    because by serial monitor, if I type for example S 100, the motor receives this normal value,
    now in the gamedash sent S 100 no ... do you have any parameters to edit? what type of data does the gamedash send in the serial?
    in my code I use the space to identify which data is a signal and which is a value, assigning in the variable "device" what is before the space (in the example "S"), and assigning in the VariableReceived, whatever is after space example <dash1>), after assigning these values, I make a comparative, if in the variable "device" is assigned the letter "S", I send the value Received in the analog output 11, it is very basic, I used this same method of code, to automation of a house via bluetooth, I made an app that sends on serial bluetooth for example L1 100, and in the code when "device" is "L1", ReceivedValue goes to an output that controls intensity of a lamp, works perfect in a house of 3 floors, including that my code via serial monitor works normal, I think the type of character that is coming from gamedash is not being represented by my code, could you give me a light please, if you want to do the test, build my code on a board there, ee nvie via serial S x (where X value between 0 and 255) will see that it works ....
    Thank you for your attention.
  18. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    I didn't have your issue 100% nailed down in my last two post but they helped me get there eventually. The problem is a serial monitor doesn't send numbers it sends text. So when you send 100 for example your sending char 1, char 0, and char 0. Simtools though sends only one byte that represents 100, that being the ascii char 100.
    So you don't need to use string variables at all just integers. So just do what I said in my previous post and when serial available >1 read the two bytes into integer variables. I believe you can still use "S" to test for that ascii char or just use its ascii number of 83 instead.
    So to send S100 that emulates Simtools output from a serial monitor you would send "Sd"; ascii 83 and ascii 100.
    • Informative Informative x 1
    Last edited: Nov 4, 2018
  19. Fernando Romão Filho

    Fernando Romão Filho New Member Gold Contributor

    Joined:
    Aug 6, 2018
    Messages:
    9
    Balance:
    271Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, AC motor, Arduino

    Goodnight friend,

    I'm trying to find the error, I put a delay (10) on the serial data reading because I used via bluetooth, it happens that S XXX, it would take 40ms to read the 4 char ... as gamedash sends a new code every 20ms, there was no time for the card to read the data ... I went down to delay (1), it worked at 100% functional time , I will finalize the project and send photos videos to the forum, thank you for the help.

    Att
    • Like Like x 1
  20. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    Hi. Glad you got it sorted despite my advise. Now I realize in my haste to assist you I gave you bad advise. I misunderstood that when in Game Dash it states a number between 0 and 255 is output as an ascii character that doesn't mean <Dashx> values too even though they are usually 8 bits also.

    So I did my homework after the fact and looked into my own code I wrote years ago that uses NET output and also the sketch on this thread. Mine uses a string for input like yours and inputs 4 characters but Visual Basic makes it easy to convert the numeric text portion into an actual number. And now I know what you mean by using an array because that's what the sketch on this thread uses.

    So sorry for giving the bad advise but it brings up the question why Game Dash doesn't output <Dashx> values as a single byte also since its a more optimized method. The only thing that comes to mind is Yobuddy didn't write Game Dash because he's usually all about optimization. :)

    BTW you can change the output rate to something larger like 50ms instead of 20ms if you want in game dash settings.
    • Like Like x 1
    • Friendly Friendly x 1
    Last edited: Nov 7, 2018