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

Fan Control in Assetto Corsa With GameDash and Pololu Maestro?

Discussion in 'Official Companion Apps' started by Roonster, Apr 16, 2014.

  1. Roonster

    Roonster Member

    Joined:
    Aug 22, 2009
    Messages:
    25
    Location:
    GTA Ontario
    Balance:
    609Coins
    Ratings:
    +11 / 0 / -0
    Hi,
    I would like to control speed on a DC fan in Assetto Corsa if possible.

    The DC Fan is being controlled by an RC motor controller and getting the control signals from the Pololu Maestro. I've been able to get the Pololu Maestro working with the Game Engine ok. I can move attached servos and control the DC fan speed with the test sliders.

    Now I would like to start testing with GameDash so that I can have the fan speed matching car speed.
    I think I have the Serial Output settings set right, but I do not know how or what to put in the popup Output Rules Box for Each Dash 1-20.

    I've attached a screenshot of the Interface settings in Game Engine, as well as a screenshot of GameDash.

    Are there documents available on the GameDash setup? I wasn't able to find any via search.

    I'd appreciate any tips.

    Thanks,

    Paul.

    gamedash setup.jpg


    Maestro settings work with game engine.jpg
  2. 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,431Coins
    Ratings:
    +1,684 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Ok its a little involved to get running but once ya done it once its pretty easy.
    First we need to make sure in the Game Manager the dash has been selected. Pic below.
    16-04-2014 6-17-05 PM.png

    Ok now DashOutput is enabled we can fire the game up and variables will appear in the GameDash.
    You will notice that Dash 1 is Speed.
    Ok script needed will depend on the figure you want to send to the ard.
    Test the Game Dash and report back to me what the figure is pretty sure its the speed as is in KPH, don't worry this can be changed.
    Then we can move on.
  3. Roonster

    Roonster Member

    Joined:
    Aug 22, 2009
    Messages:
    25
    Location:
    GTA Ontario
    Balance:
    609Coins
    Ratings:
    +11 / 0 / -0
    Thanks Eaorobbie,
    Ok, Game Dash is connected now and is receiving data from the game. Speed data is shown in Dash 1.

    What script do I need in the output box to get an 0 to 100% RC servo signal relative to 0-300KPH speed.

    game dash connected.jpg

    Game Dash Output Settings.jpg
  4. 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,431Coins
    Ratings:
    +1,684 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Ok looks like Speed is coming in as KPH so the script should look like this.

    MATH * 0.85
    ROUND 0

    Now how did I work that out.
    Well you want 300 to equal 255 so we simply divide 255 by 300 which gives us 0.85, meaning 1kph is equal to 0.85 for the servo.
    Now the servo controller needs whole numbers and no decimals, so we need to round the figure to 0 decimals, Round 0.
    Test that mate everything else looks cool.
    • Informative Informative x 3
  5. Barry

    Barry Active Member

    Joined:
    Mar 20, 2014
    Messages:
    398
    Occupation:
    Web Developer
    Location:
    Northern Ireland
    Balance:
    3,877Coins
    Ratings:
    +251 / 2 / -0
    My Motion Simulator:
    3DOF, DC motor, JRK
    This is an awesome idea. I will have to definitely incorporate this into my system if I intend to have a bike on it. Airflow would be an essential extra in that case.
  6. 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,431Coins
    Ratings:
    +1,684 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Can be done with an ardunio uno too instead of an rc card and you can then use a mosfet and drive a much bigger fan too. Blow ya off the eat stuff.
    Would suit a bike sim for sure.
    • Like Like x 1
  7. Barry

    Barry Active Member

    Joined:
    Mar 20, 2014
    Messages:
    398
    Occupation:
    Web Developer
    Location:
    Northern Ireland
    Balance:
    3,877Coins
    Ratings:
    +251 / 2 / -0
    My Motion Simulator:
    3DOF, DC motor, JRK
    I have 3 huge fans I use for my garage which I never use. I'll repurpose them I think and stick some smaller blades to them and a cowl to narrow the air channel.
  8. 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,431Coins
    Ratings:
    +1,684 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    mmm DC or AC , DC fans are far easier to control. To control AC is expensive. Best I have seen is RC plane motors, very strong breeze.
  9. Barry

    Barry Active Member

    Joined:
    Mar 20, 2014
    Messages:
    398
    Occupation:
    Web Developer
    Location:
    Northern Ireland
    Balance:
    3,877Coins
    Ratings:
    +251 / 2 / -0
    My Motion Simulator:
    3DOF, DC motor, JRK
    Good point. They plug straight into the wall. I didn't think of that.
  10. Roonster

    Roonster Member

    Joined:
    Aug 22, 2009
    Messages:
    25
    Location:
    GTA Ontario
    Balance:
    609Coins
    Ratings:
    +11 / 0 / -0
    Eaorobbie,
    Thanks to your script I am now seeing the correct value (Speed*.85) in the Out value for Dash 1. But I still haven't been able to get any movement on a Servo, or Fan control.

    If I setup GameEngine with the settings below I can control a servo or speed control with the manual slider:
    engine setup s.jpg


    engine output tests.jpg

    Before I try to Test GameDash I change the Interface settings on Game Engine to Use COM1. There is nothing connected to COM1 but I will be using the Pololu Maestro on COM4 with GameDash and I don't think GameEngine and GameDash can have the same settings:

    engine output to com1.jpg

    I set the Game Dash Output Settings to Use Com4:

    Game Dash Output Settings.jpg

    I have tried getting Servo Movement without the game running and manually entering values in the test window. The Math part is working, but I cannot get any motion output:

    dash testing output no game running s.jpg

    I have also tried with the game running, Math still works right, but no motion output:

    game dash game running s.jpg

    Sorry forthe Data dump of screenshots but I figured I would try to provide as many details as possible.

    I am using a separate PC than the Gaming computer to run both GameEngine and GameDash.

    Any ideas on where to go from here?

    Thanks,

    Paul.
  11. 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,431Coins
    Ratings:
    +1,684 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Ok feel I might have missed something from the script looking at your game engine setting the output is required to be in binary.

    Try adding to the script:

    TOBIN

    Which will change the output of the integer to binary.
  12. Roonster

    Roonster Member

    Joined:
    Aug 22, 2009
    Messages:
    25
    Location:
    GTA Ontario
    Balance:
    609Coins
    Ratings:
    +11 / 0 / -0
    The data in the output window shows up in Binary now, still no movement on the RC output unfortunately.

    binary output-1.jpg
  13. PNG1977

    PNG1977 New Member

    Joined:
    Aug 22, 2016
    Messages:
    1
    Location:
    Berkshire, UK
    Balance:
    111Coins
    Ratings:
    +0 / 0 / -0
    Hello Everbody,

    I'm new to Simtools but a great little program, I am having exact same issues as above, I can get servo movement through Game Engine and the servo is kind of jittering as I pick up speed in game, but very very little movement.

    Can anybody help me get over this last bit?

    Thanks in advance



    Paul B