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

2DOF wiper Seat mover

Discussion in 'DIY Motion Simulator Projects' started by Ramok, Mar 25, 2014.

  1. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,652Coins
    Ratings:
    +1,009 / 9 / -1
    Hi Ramok, Nice setup. ;)

    Did you solve your intermittent problems?

    I notice in the forums over time there have been quite a few people suspect Comms baud rates as the cause of their problems... In my opinion while changing the baud rate may solve the issue in many instances, I don't think it is the root cause - especially for Arduino setups. If you have a look at an Arduino setup you see that the actual RS232 serial comms is actually only running between two chips on the Arduino board itself - over a distance of about 2cm. Refer to the drawing below:

    The comms between your PC and the Arduino is USB hence the use of a USB cable. The PC communicates via USB to the 16U2 chip on the Arduino board and sets that chip up to communicate at whatever baud rate you want the PC to talk to the ATmega328 with. Your Arduino code runs on the ATmega328 and has to be setup to use the same baud rate. Both the chips on the Arduino have their own crystals which are used when configuring these baud rates - so the RS232 baud rates are not PC dependent.

    That aside, I have used RS232 comms quite alot in my past and it is quite a robust interface - one reason it has lived on as long as it has. It is actually also designed to be relatively tolerant of clock variations between sender and receiver. In most instances when I have had RS232 serial comms problems in the past it has been due to poor signal levels usually caused by incorrect grounding between sender and receiver. As the sender and receiver are on the one Arduino board this is less likely unless something else is causing significant ground noise.

    The reality is there is no reason that the Arduino should have a chip to convert the USB to an intermediate RS232 serial comms to then communicate with the ATmega328 except that it is a cheap, easy and well supported method. If a different processor was used your sketch code could just communicate with the PC USB directly, but then you would have to know how to communicate over USB which is a bit more involved - and the processor would need to be a bit better resourced.

    So how does that help you?

    Well I guess what I'm trying to say is don't be too concerned with baud rate. Even at 9600 baud, one byte of data will be sent in approx 1ms so if this gets you running, use that and look for other causes while its running.

    It could be that your computer is sending data too fast and either the USB to serial converter or the ATmega isn't keeping up and buffers are overflowing - try increasing the packet delay in the Simtools interface setup. Start off with something like 50ms to see if it improves things and if it does slowly reduce it to where it falls over.

    It could be bad drivers on the PC that aren't configuring the 16U2 on the Arduino properly - I think that's less likely but I assume you installed the Arduino drivers when you installed the IDE?

    My guess though is that it is most likely related to poor grounding or noise in your setup. Motors, particularly when running with high current have the potential to create alot of electrical noise. You should have good solid (as in heavy duty) cabling for your power/ground cables throughout the setup. Try to keep the motor power cables away from the USB, pots cables, and electronics if possible.

    Look for other ways of validating parts of your build. For example to test the PC to Arduino comms (both USB and RS232 serial) you could write some test code for the arduino that does nothing else but send back that data it receives at whatever baud rate you want to test. The use a free terminal program on the PC to send a large binary file and capture the received data to another file. When complete you can do a file compare to see if there were errors - do this without any motors powered or running.

    Your comment that it seems to be working with external power supply - perhaps the PC USB port does not meet spec and is having trouble powering the Arduino?

    Sorry if this is a long winded explanation - I find it hard to fault find when I can't get my hands on things, but I hope it gives you some ideas of where you can look.

    comms.JPG
    • Informative Informative x 3
  2. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,652Coins
    Ratings:
    +1,009 / 9 / -1
    By the way, there should be no need to change any comm settings in the device manager - all settings are typically done via the app, in this case simtools.
    • Agree Agree x 1
  3. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,234
    Location:
    Marseille - FRANCE
    Balance:
    20,895Coins
    Ratings:
    +2,084 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    +1 :cool:
    @Ramok, could you upload some picrures of the wiring inside your box? did you use shielded cables?
  4. Ramok

    Ramok Member SimAxe Beta Tester Gold Contributor

    Joined:
    Mar 6, 2013
    Messages:
    45
    Location:
    Slovenia
    Balance:
    1,130Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino

    Attached Files:

  5. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,234
    Location:
    Marseille - FRANCE
    Balance:
    20,895Coins
    Ratings:
    +2,084 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    >quite a mess
    Yes indeed! :-/ sorry, i cannot see anything to help...

    That's fine that 12V cannot kill you!!
    I'm joking but maybe it's part of the problem?
    :)
    Yours
  6. 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 built a small compact PC a few years ago and I struggled with inconsistency and signal problems. It turned out to be crosstalk from the power line. Everything worked fine when I was doing bench tests but when the components were packed together in the case I had problems.

    Take all the slack out of your wiring and route them carefully round the edges of the box away from any signal or control wires. Route those down the other side. Or if you can take everything out and bench test with the wires seperated out.
    • Agree Agree x 1
  7. Ramok

    Ramok Member SimAxe Beta Tester Gold Contributor

    Joined:
    Mar 6, 2013
    Messages:
    45
    Location:
    Slovenia
    Balance:
    1,130Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hi
    I tested with external power supply for some days and looks like work fine.
    No more crashes for simtools.
    I want to thank everyone who helped me. THANK YOU :)
    We'll hear when run into a problem again.
    :cheers
  8. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,234
    Location:
    Marseille - FRANCE
    Balance:
    20,895Coins
    Ratings:
    +2,084 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Good news!
    you're welcome :cheers
  9. Ramok

    Ramok Member SimAxe Beta Tester Gold Contributor

    Joined:
    Mar 6, 2013
    Messages:
    45
    Location:
    Slovenia
    Balance:
    1,130Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hi me again after 2 years ;) hug:
    I have a problem with my setup. After 1 year of sleeping in sim racing i decide to play again with motion. I install SimTools 2.0 and nothing work any more :(
    Ok download Arduino code from @RacingMat, put in to Arduino and motor just turn in one direction never stop. Then searching for code. Found here http://www.gamoover.net/Forums/index.php?topic=25907.0 But no work in SimTools 2.0 . I try in SimTools 1.3 there is working ( Output testing (manual)).
    If you have any idea what will be wrong.
    :sos:sos
  10. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,557
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,160Coins
    Ratings:
    +10,780 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    By default SimTools 2.0 is in demo mode, which includes the LFS plugin for testing purposes. It needs to be unlocked to access other plugins. See here to request a free DIY SimTools 2.0 license, conditions apply: https://www.xsimulator.net/request-diy-key-simtools/

    SimTools 2.0 also has a slight change needed for the Interface Settings, where you will need to specify the group, normally 'a', like this: <Axis1a>

    With respect to the code it sounds like the tolerance parameter is not properly set, carefully follow all the instructions here: https://www.xsimulator.net/community/marketplace/arduino-code-2dof-and-2-pins-direction-hbridge.67/
    Last edited: Jan 16, 2017
  11. Ramok

    Ramok Member SimAxe Beta Tester Gold Contributor

    Joined:
    Mar 6, 2013
    Messages:
    45
    Location:
    Slovenia
    Balance:
    1,130Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hi @noorbeast
    I follow all the instructions and now work in manual testing. I also try LFS but not work in game. Yes game is patched. What i am do wrong?
  12. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,557
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,160Coins
    Ratings:
    +10,780 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  13. Ramok

    Ramok Member SimAxe Beta Tester Gold Contributor

    Joined:
    Mar 6, 2013
    Messages:
    45
    Location:
    Slovenia
    Balance:
    1,130Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    @noorbeast
    I change language setting but nothing happened. Still not working.
    Here is two video Assetto and LFS in AC is a tiny movement in virtual axis.


  14. value1

    value1 Nerd SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    14,509Coins
    Ratings:
    +3,319 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider
    What are your max min settings in tuning centre?
  15. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,557
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,160Coins
    Ratings:
    +10,780 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Please post pictures of all of your settings, particularly your Interface Settings and Axis Assignments.

    Does Game Manager turn blue when LFS is running?
  16. Ramok

    Ramok Member SimAxe Beta Tester Gold Contributor

    Joined:
    Mar 6, 2013
    Messages:
    45
    Location:
    Slovenia
    Balance:
    1,130Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Here is my screenshots.
    In LFS game data output is "0" and AC show some numbers.

    2017-01-18 (1).png 2017-01-18 (2).png 2017-01-18 (3).png 2017-01-18 (4).png 2017-01-18 (5).png 2017-01-18 (6).png
  17. value1

    value1 Nerd SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    14,509Coins
    Ratings:
    +3,319 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider
    upload_2017-1-18_18-22-44.png
    That was my guess. Your MaxMin settings in Tuning Centre are all ±32767. With such high numbers you will never get any movement.
    Click on
    Capture Max Min, then on Reset and drive a round (without crashing) and Save New Settings.
    You'll have movement!
  18. Ramok

    Ramok Member SimAxe Beta Tester Gold Contributor

    Joined:
    Mar 6, 2013
    Messages:
    45
    Location:
    Slovenia
    Balance:
    1,130Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Ok thanks a lot @value1 AC works great. :thumbs
    Why LFS doesn't work ?
    Automobilista plugin exist or is compatibility plugin (GSC......)