1. 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!
  2. 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
  3. 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

Showroom 2DOF + traction loss using Brushless DC motors

Discussion in 'DIY Motion Simulator Projects' started by John Snell, Sep 16, 2021.

  1. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I'm in the beginning stages of extending my sim racing rig with the addition of 2DOF + traction loss.

    I've got a simple proof of concept running with wiper motors, arduino, and SMC3, and live for speed, so that I could get my head around some of the concepts.

    And I've got a lot of parts, with still more on the way, some steel, and a home welder. I like to keep things compact if possible.

    The main issue I've faced so far is not realising that the motors I purchased were Brushless DC Motors, and instead of simple brushed motors. This has caused me some concerns but I think I'm making progress there.

    But to start with, attached is my DIY rig as the starting point. I like that it's compact, I only use VR, but it's got to go up higher :)
    IMG_2982.jpg
    Last edited: Sep 16, 2021
  2. Ads Master

    Ads Master

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
  3. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Next is the proof of concept using the SMC3 code, Arduino UNO, BTS7960 motor drivers, and wiper motors from a Toyota van. It was tested using SMC3Utils v1.01.exe, and eventually Simtools and Live for Speed.

    I got a lot of information here:
    https://www.xsimulator.net/communit...3dof-motor-driver-and-windows-utilities.4957/

    But it still took me a while to figure things out, and a lot longer to get going than it should have due to another reason. I could get one motor to operate using SMC3Utils v1.01.exe, but not both.



    I eventually realised that due to the way the everything is connected with metal (except for a wooden insert in the aluminium tubes), there is actually a very poor short circuit from one motor to the other when they are operating in opposite directions. Poor or not, a short circuit is a bad thing. The attached photo show's where I used a steel cutting blade and solved the whole problem.

    IMG_3063small.jpg

    I'm not sure how I will deal with the final equipment mounted on a steel rig but that's for another day.

    EDIT: Just found this thread about isolating ground on Wiper motors. Would have saved myself some time if I'd found that earlier, and would definitely be useful if I planned to use the wiper motors on the final setup:
    https://www.xsimulator.net/community/faq/wiper-motor-mandatory-ground-isolation.25/
    • Like Like x 1
    Last edited: Sep 19, 2021
  4. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Now for the parts I have and plan to use in the final build (will it really be final??):

    - a 22mm (shaft diameter) universal joint

    - I ordered some hall effect angle sensors but the seller couldn't supply and cancelled the order. Will revisit later and use pots in the meantime.

    - a pillow block bearing for the front of the rig to rotate around for traction loss.

    - and Three DC motors with 50:1 wormgears...

    Yes, maybe they are not the ideal motors, and maybe I should have researched more before I got them, but they are what they are and I hope to get them working. And to me they are things of true beauty :)

    The motors are 0.7Nm, 210w, 24v Brushless DC motors with built in hall sensors, and 50:1 wormgears.

    IMG_3131.jpg

    Upon realising that these are 3 phase DC motors (what??), and my proof of concept with H-Bridges was not going to be useful, I had to find another way to control these motors.

    So I ordered three inexpensive ZS-X11D1 brushless DC motor controllers, which I hope/plan to get working with the PWM signal coming from the Arduino.

    bldcdriver.JPG

    Through difficulty in finding much information on these, and being too keen to try things out without first understanding what I was doing, I have destroyed one of them already, but had some success with the second one and I feel like it's heading in the right direction.
    • Like Like x 1
  5. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    So understanding the wiring of the motor drivers has been a learning experience. As mentioned I've burned out one motor driver already. That just means a delay until I can get another one delivered (at least a month), but luckily still have 2 more.
    IMG_3126.jpg
    First, the order of the motor 3 phase wires needs to match the order of the hall sensor wires. The photo below seems to indicate that this is not the case, but in fact the colored hall sensor wires are soldered, just on the edge of the photo (see second photo), to ones which match order of the motor wires. So Yellow-Blue-Green in the same order on both.
    IMG_3134 1.jpg IMG_3142.jpg

    Second, the tiniest connectors ever for PWM input! The PWM from the Arduino is the red wire going into the board, and black is ground from the Arduino.
    IMG_3136.jpg

    Third, more tiny connectors! Here is where you need to solder a jumper to tell the motor driver to use PWM mode. The jumper pin holes are beneath the capacitor on one side of the board, and you need to remove the heat sink on the other side to be able to solder it. I have the red and blue wires twisted together just out of the photo. Will replace those 2 wires with a single short jumper wire.
    IMG_3129.jpg

    Lastly, this is the motor running from SMC3Utils (in sinewave mode) via the Arduino. The motor changes speed, but doesn't yet change direction as it should. The motor driver needs a pin to be grounded (I think) for reverse direction. This is my next issue to solve, and I think will require some tweaks to the Arduino code.

    • Like Like x 1
    • Informative Informative x 1
    Last edited: Sep 17, 2021
  6. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Well, it didn't go well over the weekend. I tried two different ways to change the motor direction.
    1./ Use the Arduino output pin that already goes high/low based on direction
    2./ Used a mechanical relay to ground the reverse direction pin on the motor controller. I thought this would be very safe as I'd previously grounded that pin physically by holding a ground wire on the pin itself.

    In both cases the motor reversed as I hoped, but did not sound good... made a sort of grinding sound, for say 30 seconds, and then it stopped completely. So now I have now burnt out all 3 of my motor drivers.

    I had attached the motor to the wormgear by then, so could that be it? Unfortunately I didn't have an ammeter attached to see if a lot more current was being drawn.

    I now need to research replacements, do I get the same ones?... probably not. The main issue is the time it takes to get more here.

    In the meantime I'll get started on the physical part of the build, as I have some steel in my garage ready to go.
  7. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Some good news!

    OK, I was pretty frustrated at my own stupidity for burning out all of my motor drivers.

    This morning I decided to have another go, and discovered that 2 of my driver boards are still working after all (I'm surprised!), and I may be able to repair the third one faster than getting a new one.

    I started to wonder why my motor ran poorly and drew a lot more current when running in reverse. Could it be that my hall sensor wiring didn't actually match the phase wiring after all. I tried swapping motor phase wires. Nothing helped except that now it ran poorly and drew high current in the forward direction. A clue!

    Back to the drawing board, I started afresh with a different motor. Connected the hall sensor wires in a slightly different order, and BINGO! SUCCESS!

    It now runs smoothly in both directions, drawing the same current. I am able to run the motor using SMC3utils, and reverse the direction using an Arduino output pin. This pin seems to pulse high, rather than stay high/low based on direction as I require, but I'll hopefully figure that out soon.
    • Like Like x 2
  8. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    So, now some not-so-good news.

    I now have the BLDC motors running in both directions, using SMC3Util with the Arduino providing PWM & Direction to the motor drivers. I thought/hoped this would work but there are serious issues which may require a completely different approach.

    Comparing the same setup between my wiper motors proof-of-concept (with h-bridge drivers) and the BLDC motors (with ZS-X11D1/ZS-X11H driver).

    The wiper motors setup does a pretty good job where the green Feedback follows the blue Target quite well:
    SMC3 settings on Wiper.JPG

    The BLDC motors setup does a better job. The Feedback follows the Target with great accuracy as shown on left half of the sceen-shot below.
    SMC3 settings on BLDC.JPG

    Unfortunately, while the accuracy is good, it's not useable as the motor is stop/starting or forward/reversing continuously trying to get meet the target. This is clearly not good, but somewhat funny!



    So, I will revisit the way I am using the motor direction output in case I can find a better solution. Many times I have wished I had an oscilloscope, including now! Otherwise I think I need to look for significantly different way to do this, and will probably start to look in depth at the way @pmvcda (FlyPT) achieved the control he needed using similar BLDC motors in this thread here:
    https://www.xsimulator.net/community/threads/flypt-6dof-brushless-diy-actuators.10799
    • Like Like x 1
    Last edited: Sep 28, 2021
  9. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Been doing some design before I start cutting steel. This is the traction loss frame so far, but things may change. The wheels are from roller-blades and will sit within the 38mm square section, two at the pivot end and two at the seat end.

    The pivot point in this case is to the rear of my pedals (behind where my ankles sit)
    bottomlayers.JPG


    EDIT: Update below for a number of reasons, including so that there is space for the motor cranks/arms to operate below the lowest point of the upper frame and above the floor, but not hit the lower frame when the unit swings left/right.
    motion rig frames.JPG


    Can anyone suggest the ideal left/right angle should I be aiming for? At the moment it's 8 degrees (100mm left and 100mm right) but wondering if it should be more?

    EDIT: I've found the following on this subject:
    https://www.xsimulator.net/community/threads/how-much-movement-in-drift-axis.6837/
    https://www.xsimulator.net/community/faq/traction-loss.174/

    While there's useful information in those posts, I still haven't found information about traction loss angle. Distance left/right seems irrelevant to me without knowing distance from pivot point and therefore the most important thing that you will feel - angle. I don't have enough time to spend reading every forum so may have missed something. For now I think I'll continue with 100mm shift either way.

    Thanks
    Last edited: Oct 12, 2021
  10. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    After far too long in Sketchup, I finally got into the garage and made one of the wheel holders for the rear sideways movement for the traction loss.

    This section will become part of the frame itself, welded in at the correct angle (hopefully) for the frame to turn about the pivot point bearing at the front.

    IMG_3205.jpg

    3 more to go before I can make some real progress on the frame :-(
    • Like Like x 2
  11. ikesimuladores

    ikesimuladores New Member

    Joined:
    Nov 16, 2020
    Messages:
    13
    Location:
    Brasil
    Balance:
    124Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    you can share ino code and arduino wiring connection with drivers and bldc
  12. cfischer

    cfischer Active Member Gold Contributor

    Joined:
    Sep 7, 2015
    Messages:
    283
    Location:
    Colorado
    Balance:
    1,999Coins
    Ratings:
    +198 / 0 / -0
    Do you still have the relay in the mix for your direction pin? Sounds like probably not but if you do that might cause a delay in the signal that messes with the motor performance.

    Other than that it looks like maybe a pid loop needs to be tuned?
  13. hoyang

    hoyang handyman

    Joined:
    Dec 14, 2017
    Messages:
    48
    Occupation:
    Bricoleur
    Location:
    France
    Balance:
    890Coins
    Ratings:
    +22 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    your tracking problem may be due to your smc3Utils setting. tried with a lower frequency (Fpwm) because your controller works from 50hz to 20khz, I had this problem with my bldc controllers. you also have to adjust the min and max pwm (for me it's 48 and 255)
  14. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi @cfischer
    Thanks so much for looking at this, as I'm really quite stuck and unsure what to do next.

    In fact I do still have the relay in the mix but I was getting the same result when using a direct direction output from the arduino. Tuning the PID loop? I assume you mean by updating settings in SMC3Util? If so I'm not sure I can make much progress, as I think I've tried everything, but I will certainly give it all another go (and definitely without the relay)

    Thanks again
  15. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I'll definitely revisit those settings. Really appreciate your advice @hoyang !!
  16. cfischer

    cfischer Active Member Gold Contributor

    Joined:
    Sep 7, 2015
    Messages:
    283
    Location:
    Colorado
    Balance:
    1,999Coins
    Ratings:
    +198 / 0 / -0
    Unfortunately I havent used the SMC3 software before but it looks like tuning could be the problem based on my general experience tuning pid loops for motor control. A quick google search shows this page which appears to walk you through tuning the pid loop as well as other variables. Have you tried going through these details?

    https://github.com/SimulatorMotorController/SMC3Utils
  17. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    [Edit] Post deleted as I was corrected by @hoyang below. No point in leave incorrect information here.
    Last edited: Oct 15, 2021 at 08:06
  18. hoyang

    hoyang handyman

    Joined:
    Dec 14, 2017
    Messages:
    48
    Occupation:
    Bricoleur
    Location:
    France
    Balance:
    890Coins
    Ratings:
    +22 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    in fact the green line is the monitoring line of your engine and the blue line is the one to follow, it is normal for your relay to click on the black circles if there is no more engine monitoring.

    the motor reversal will be done on each side of the green line and no blue line (example: blue ball under the green line clockwise, blue ball above the green line anti-clockwise)
  19. hoyang

    hoyang handyman

    Joined:
    Dec 14, 2017
    Messages:
    48
    Occupation:
    Bricoleur
    Location:
    France
    Balance:
    890Coins
    Ratings:
    +22 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    I also use relays on my project to control the inversion of my motors but they are not connected to my bldc controllers but to three-phase contactors.

    https://www.xsimulator.net/communit...ss-arcade-game-style.11764/page-2#post-221440

    but relay clicked constantly to respect the follow line, I noticed that my motors go too fast and exceeded the line to follow constantly, the problem came from the pwm frequency of smc3. I think you had the same problem as me. but I could be wrong.
  20. John Snell

    John Snell New Member

    Joined:
    May 31, 2021
    Messages:
    27
    Balance:
    183Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Of course you are correct @hoyang! I had completely the wrong idea there, and it's obvious now that you point it out. Thank you for saving me a lot of wasted time.

    So now I'm back to square one unfortunately. As my motor/arduino tries to follow the target curve (say a sinewave) the feedback crosses the target line and the motor then reverses to bring it back to towards the target. Going in reverse it then crosses the target line again and once again the motor reverses. It kind-of makes sense that it continually changes direction and it certainly follows the target line very well.

    There must be a better way though :-( Time to do more research in PID control systems I think.

    I will also experiment with the PWM frequency, but I'm sure I've tried all options before on that.