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

TL additon to 8020 rig, 24VDC wheelchair motor

Discussion in 'DIY Motion Simulator Projects' started by Foo, Dec 16, 2017.

  1. Foo

    Foo New Member

    Joined:
    Dec 16, 2017
    Messages:
    4
    Location:
    UK
    Balance:
    190Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    DC motor, Arduino
    Hi all,

    I have an existing rig constructed from alu profile and I've recently gained the space that I need to start adding some motion. I thought I'd start with traction loss because I think it's the sensation I miss the most and because it seems relatively straightforward. If it goes well, I'll look at moving the seat in the future.

    I've been reading and planning for a while and thought it would be good to get some feedback before I set off with the saw / drill / soldering iron.

    I've attached some renders of my current design:

    rig.png top.png tlr.png bearing.png motor.png motor2.png

    Here are some of the details:

    Front pivot: pillow blocks on top frame, 20mm diameter steel rod welded to 5mm steel plate on bottom
    Casters: 75mm dia, fixed, ball bearing
    Base frame plates (for casters to run on): 5mm alu plate
    Motor mount, lever arm: 5mm mild steel
    Lever arm length: 300mm with CTC options at 160, 200 and 240mm
    Connecting rod: ~ 12mm dia steel, heim joints on high misalignment spacers at ends
    Motor: 24v 300W wheelchair motor, 32:1 gearbox, ~ 150 rpm at shaft, keywayed hub adapter
    Pot: 120 degree hall, flex coupler to motor shaft, 3d printed support

    I drive in VR and plan on mounting the Rift camera to the top frame.

    I've also attached a schematic of the planned electronics:

    syren.png

    I intend to use a customised version of the SMC3 for Sabertooth (packet serial) sketch (thanks to authors!) on an arduino mega.

    I've taken inspiration and ideas from a number of threads so thank you all for that. Any comments / questions / dire warnings would be gratefully received... Thanks!
    • Like Like x 3
  2. Foo

    Foo New Member

    Joined:
    Dec 16, 2017
    Messages:
    4
    Location:
    UK
    Balance:
    190Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    DC motor, Arduino
    Making some progress..

    The bottom frame is ready:

    IMG_20171231_183357.jpg

    and the alu panels are mostly cut and drilled.

    The steel parts have been plasma cut, drilled, welded and painted (I'm not much good at any of the above!):

    IMG_20171226_173713.jpg IMG_20171226_173647.jpg IMG_20171231_175836.jpg

    I removed the brake and fitted the wheel hub to the motor:

    IMG_20171223_144849.jpg

    And then fitted the flex coupler and the hall pot with a temporary pot mount for testing:

    IMG_20171231_175746.jpg

    Here's the 3d printed pot mount that I'll use when the motor is in place:

    IMG_20171231_183417.jpg

    Hooked up the electronics as per the diagram above (minus the MOSFET for now):

    IMG_20171231_175953.jpg

    and I can drive the motor from the SMC3 utils. I get a little bit of overshoot and a small reverse in response to step changes - I'm hoping that once the motor has some load on it this will improve...?

    A little bit more cutting / drilling / testing to do but I think I have all the necessary bits now so I'm hoping I can get the rig moving before too long..

    Happy new year!
    • Like Like x 3
  3. Foo

    Foo New Member

    Joined:
    Dec 16, 2017
    Messages:
    4
    Location:
    UK
    Balance:
    190Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    DC motor, Arduino
    A bit more progress..

    Bottom frame is ready:

    IMG_20180103_232033.jpg

    Motor and 3d printed pot mount in place:

    IMG_20180103_232144.jpg

    Here's one of the casters I'll be using:

    IMG_20180103_232201.jpg

    .. and here's one of the pillow blocks:

    IMG_20180103_232217.jpg

    Almost there... Hopefully I'll have time to attach them to the top frame and get it up and running this weekend..
    • Like Like x 1
  4. Foo

    Foo New Member

    Joined:
    Dec 16, 2017
    Messages:
    4
    Location:
    UK
    Balance:
    190Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    DC motor, Arduino
    There's still lots of tidying up to do but it's getting there..

    IMG_20180115_195408.jpg

    The front bearing(s) (I'll cut the rod to size eventually):

    IMG_20180115_195530.jpg

    Here's a look at the motor / lever arm / linkage:

    IMG_20180115_195618.jpg IMG_20180115_195717_1.jpg

    With the hardware getting there, I set about making some modifications to SMC3-SPS - I wanted to be able to control the MOSFET that switches power to the SYREN and I figured I might as well use a hardware UART for talking to the SYREN given that I have a mega, which has 4 of them..

    I ended up pretty much rewriting it.. Right now, the modified version only supports 1 motor (that's all I have) but it has the following:
    • Timer-interrupt driven PID loop
      • ensures that it runs at a fixed frequency
    • Free-running ADC with interrupts
      • pot position read as fast as possible, whilst the cpu is free to do other things
    • Changes to PID algorithm
      • Derivative and integral adjusted appropriately for PID period
      • Suppression of integration when proportional will saturate output
      • Filtered derivative to reduce derivative noise, removal of now-redundant Ks
    • Hardware UART for serial input and output to SYREN
    • Digital output for switching power to SYREN
    • Serial pass-through mode for connecting DeScribe via the arduino
    • Removal of pwmMin and the output discontinuities it creates
    This made things a lot better (the derivative noise was pretty bad) and easier to tune. I was using SMCUtils and stole some of motor 2's controls / commands to switch the MOSFET gate and enable/disable passthrough for DeScribe but it wasn't very neat and I wanted to visualise the contributions of each of the terms in the PID calculations...

    So I knocked together my own version:

    smcutils.PNG smcutils-graph.PNG

    I applied for a simtools DIY license but it hasn't arrived, I'm impatient and I only really drive in iRacing so, in the DIY spirit, I also knocked up something to read telemetry and send commands to the arduino.

    My first stab was simply to send a target position based on the slip angle of the car, with some deadzone to account for tyre deformation. Predictably, it didn't pan out great - the initiation of slides was ok but as the slip angle returned towards zero, the rig would return to center, which made me want to counter-steer the other way and resulted in a mess.

    High-passing the setpoint would have been an improvement but I went a slightly different way..

    Ideally, if we had infinite rotation, the rig would rotate when we slide and then settle at the new angle. But given that you only notice acceleration (particularly with a VR headset on), I added an option to the arduino code that overrides the maximum output when the target is the center position. If that's set appropriately, the rig accelerates when you slide and then moves back to center at an approximately fixed velocity, which you don't feel. This made a big improvement and it started feeling quite natural.

    I had one more issue; sending absolute position to the arduino resulted in 2 problems: 1) if you slide, correct and then slide more the rig rotation/acceleration for the 2nd slide is smaller than it should be since the rig is already close to the requested angle and 2) a tankslapper is very exaggerated because the rig rotates more than it should when you swap a positive angle for negative or vice versa.

    To deal with this, I made the arduino code calculate a relative setpoint based on the current position if it was either on it's way back to center or if the sign of the slip angle reversed. This seems to work well but I imagine some improvements are possible..

    Anyway.. Apologies for the wall of text, here's the obligatory video.. It's the iRacing 911 GT3 cup car around Spa. My attire is because the rig is in the garage and it's very cold, the squeaky noise is my throttle pedal..!



    I'll tidy up the code and make it available soon in case anyone is interested in it..
    • Like Like x 1