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

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 Member

    Joined:
    May 31, 2021
    Messages:
    63
    Balance:
    190Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi all.

    Small update. As you know, I've been using Brushless DC motors/drivers with an ESP32 controller.

    I got the traction loss part working but it didn't really feel like positive/strong movement with my weight in it, and my other 2 motors seemed not strong enough for the 2dof movement.

    I knew that the motors were not drawing anywhere near their rated current, but I didn't know why. Then this morning, I found something which possibly should have been obvious.

    While building it, I followed a suggestion not to use level shifters on the output of the ESP32 controller, and it made sense at the time... a digital ON = ON whether it's 3.3v or 5v, and the printed circuit boards allowed them to be bypassed. Somehow though, that seems to have been the problem. For reference, the post (which seems NOT a good idea for me anyway) is here:
    https://www.xsimulator.net/communit...hless-diy-actuators.10799/page-38#post-217746

    This morning I added two level shifters taking the output PWM signal from 3.3v to 5v, and the difference is very noticeable, with much more positive movement as shown below.



    Now I can start to re-test the 2dof motors, and finally have some hope that I can make some progress there as well.

    cheers
    • Like Like x 1
    • Informative Informative x 1
  2. John Snell

    John Snell Member

    Joined:
    May 31, 2021
    Messages:
    63
    Balance:
    190Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hate to say it but I'm getting very near breaking point with what I've been trying for so long to get working. It seems to be just one problem after another due to the technology I'm trying to use. I think my next move may have to be something quite different from what I've been attempting to do so far.

    Current problem... I've built 4 controller boards so far. Same equipment, PCBs off the same production run, but they are oh so different!

    Current board status:
    #1 this died early on and is no longer recognized by Windows to be able to upload sketches
    #2 my good one, and worked well until yesterday (but only 2 of 3 ports worked). Now has same status as #1
    #3 calibrates motors perfectly, but when connected to FlyPT Mover the actuators jerk randomly
    #4 runs the motors nicely during calibration but totally ignores the calibration limit switches

    IMG_3840 (1).jpg
    I don't get it :(
    Last edited: May 31, 2022
  3. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,141
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    148,541Coins
    Ratings:
    +10,902 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Hate to say it but that sounds like manufacturing quality control issues, perhaps bite the cost bullet and consider consumer grade hardware.
  4. John Snell

    John Snell Member

    Joined:
    May 31, 2021
    Messages:
    63
    Balance:
    190Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Not sure what "consumer grade hardware" means really. Do you mean get the PCB's printed at a different reputable factory? Slightly tempted to do it myself on some hobby stripboard. Or get an esp32 controller direct from espressif.com? Or are you meaning I should buy some proven electronics such as Thanos controllers or other (suggestions welcomed)?
  5. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,141
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    148,541Coins
    Ratings:
    +10,902 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    As far as I am aware SMC3 does not natively support brushless motor drivers.
  6. hoyang

    hoyang handyman

    Joined:
    Dec 14, 2017
    Messages:
    91
    Occupation:
    Bricoleur
    Location:
    France
    Balance:
    1,319Coins
    Ratings:
    +86 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    courage to you, electronics is strewn with pitfalls, it takes a lot of courage and perseverance your project will eventually succeed and work. I also use bldc brushless motors, I had to modify several things over the months for this to work properly.
    I think you should recheck your electronic board to see if your connections between the components are good, a weld or a track can quickly create problems.
  7. hoyang

    hoyang handyman

    Joined:
    Dec 14, 2017
    Messages:
    91
    Occupation:
    Bricoleur
    Location:
    France
    Balance:
    1,319Coins
    Ratings:
    +86 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    If that can help you.
    have you used shielded electrical wire for your motor connections (hall effect sensor and limit switch)
    some parasite can quickly disturb all. I use cat 5 ethernet cable for the electronic interrupt connection.

    have you tried your motors without the seat platform to see if it's a weight or crank problem.
    the brushless very quickly stops working if too much force is needed.
  8. John Snell

    John Snell Member

    Joined:
    May 31, 2021
    Messages:
    63
    Balance:
    190Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Thank you for your reply @hoyang I appreciate it a lot and you have given me some hope, and don't worry I would not give up :)

    I've checked the circuit boards with a magnifying glass but of course I can retest and use a continuity meter next time.

    Questions for you though... do you use SMC3 (with MODE1) with BLDC motors and an arduino? If so do you use a modified or standard arduino sketch? If you have modified the sketch, could you share your sketch with me?

    In a previous post on my thread you mentioned:
    "I found how to avoid engine monitoring overruns adjust kp = 10 ki = 0 kd = 0 ks = 1 then increase kp point by point for a good follow-up without overshoot. if pwmmin and pwmmax are correct there are no more problems."

    But I didn't realise that you were using BLDC motors, so it can be done!

    In fact I have got it running with SMC3 earlier today with some similar values. It seems the motor driver I am using is more accepting of the SMC3 PWM. I will be VERY happy to remove a lot of complexity but doing it that way. It still needs quite a lot of adjustment though to be smooth, and I think I can find ways to do that in the arduino sketch. Did you take the values mentioned above from smc3utils and hard code them in the arduino sketch?

    [EDIT] after a quick check it seems like the values from SMC3utils are stored in the arduino
    EEPROM so no need to edit the sketch [/EDIT]

    Thanks again mate
    John
    Last edited: Jun 3, 2022
  9. hoyang

    hoyang handyman

    Joined:
    Dec 14, 2017
    Messages:
    91
    Occupation:
    Bricoleur
    Location:
    France
    Balance:
    1,319Coins
    Ratings:
    +86 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    yes I use SMC3 well with bldc motors.
    you have to modify smc3.ino a bit to adapt it to the motor controller.
    smc3 thus serves as a command interface (direction [dir], speed [pwm], activation command [en]) as long as the motor controller can read the commands.

    Yes kp ks ki kd are saved in the eprom of the arduino so no need to modify this one in the code, they must be adapted according to the motors, I have different values on my 3 motors.

    I have to find my first code to modify and I will send it to you.

    the link if you want to see my project.
    https://www.xsimulator.net/community/threads/diy-2-dof-traction-loss-arcade-game-style.11764/
    • Like Like x 1
    Last edited: Jun 3, 2022
  10. John Snell

    John Snell Member

    Joined:
    May 31, 2021
    Messages:
    63
    Balance:
    190Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I'm still on the hunt for an improved way to drive the BLDC motors, and have a new plan...

    Two posts above I mentioned a different Arduino sketch I'd worked on which improved smoothness and was quieter, but it still wasn't perfect and for now I've switched back to a near standard SMC3 sketch provided by @hoyang. Here it is running Epic Roller coaster (which actually is epic with the movement!).


    The result is still a bit too much noise from the motors themselves and quite jerky movement (maybe there's nothing I can do about that).

    [EDIT]: Well here's something I didn't know, and it makes the following question redundant.
    The Arduino does not have a built-in digital-to-analog converter, but it can pulse-width modulate (PWM) a digital signal to achieve some of the functions of an analog output. So the Analog output of an Arduino is actually digital !! I will try using a cheap PWM to voltage converter board on the output of the Arduino PWM pin to see if it helps but I am less confident.
    [/EDIT]

    Question:
    So I remembered that my 8015A motor drivers can accept either a PWM signal, or a 0-5V signal. So why am I trying to adjust an Arduino sketch to send PWM to a motor driver whose job it is to do just that, when I should just update the SMC3 Arduino sketch to output 0-5V instead, and let the motor driver control the motor.

    Before I start working on the sketch, does anyone know of an existing SMC3 Arduino sketch that outputs 0-5V instead of PWM?

    Thanks a lot
    Last edited: Jul 1, 2022
  11. hoyang

    hoyang handyman

    Joined:
    Dec 14, 2017
    Messages:
    91
    Occupation:
    Bricoleur
    Location:
    France
    Balance:
    1,319Coins
    Ratings:
    +86 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    i use this as pwm to 0-5v converter
    DollaTek PWM Voltage Module...

    Attached Files:

  12. hoyang

    hoyang handyman

    Joined:
    Dec 14, 2017
    Messages:
    91
    Occupation:
    Bricoleur
    Location:
    France
    Balance:
    1,319Coins
    Ratings:
    +86 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    I think a 0 - 5v conversion on the arduino will still be pwm ( analogWrite(pin,val); val = 0 to 255 ).
    I think that the jerks you have are due to the speed of your motors (small overshoot or sudden braking).
  13. John Snell

    John Snell Member

    Joined:
    May 31, 2021
    Messages:
    63
    Balance:
    190Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Thanks @hoyang. I have already placed an order for exactly the same PWM to voltage module :)
  14. Kenshiro27

    Kenshiro27 Active Member

    Joined:
    Apr 16, 2021
    Messages:
    162
    Balance:
    26Coins
    Ratings:
    +66 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    nice work, clean and compact:thumbs
    • Like Like x 1
  15. John Snell

    John Snell Member

    Joined:
    May 31, 2021
    Messages:
    63
    Balance:
    190Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Well I tried the pwm to 0-5v converter and it made no difference at all. Still the same amount of clicking noise from the motors. Luckily I have a use for it elsewhere.
  16. John Snell

    John Snell Member

    Joined:
    May 31, 2021
    Messages:
    63
    Balance:
    190Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    So, some changes and some success I think!

    Back in May I posted how I could not get any consistency out of the ESP32 motor controllers, and had to change my strategy altogether. The original plan was to use the hardware in this thread:
    https://www.xsimulator.net/community/threads/flypt-6dof-brushless-diy-actuators.10799/

    At that time I moved to using an Arduino with SMC3. With the motor controllers accepting PWM or voltage I figured that they would act a lot like a standard DC motor reacting to changing input voltage and direction. I was mostly correct although maybe a little more jerky.

    There was quite a lot of loud clicking noise coming from the motors. @hoyang helped with a tweaked Arduino sketch and I was able to tune out much of the noise. BUT I could not get rid of a dipping or maybe an oscillation in my right actuator. While driving along a straight road, or flying in a straight line, my right front actuator kept going down/up. agghhh

    I wondered if it was due to sloppiness in the analogue potentiometers and decided to re-program my spare ESP32 to return accurate position information from the motor hall sensors directly to the Arduino. In doing so I found the original problem with them :)

    The motors are run from a 24v power supply. The circuit diagram below shows the 5 wires from the motor hall sensor connect back to the ESP32.
    FLYPT Wiringv2 again.png
    Two of those wires carry +/- and they connect back to the Vin/Gnd on the ESP32. It may be unique to my motors but they have 24v on them. What!!... but the max Vin for an ESP32 is 12v. So, putting 24v on a 12v device, it's no wonder that the ESP32 boards were getting very hot in parts (the voltage regulator), that two of them burnt out completely, and generally they were acting very very unpredictably.

    The solution is as simple as removing the positive hall sensor wire, highlighted in the diagram above. It still allows the motor hall sensor positioning to be read, and so far appears to have solved the problem completely.

    So I've re-done all the wiring for a second time, remounted the min an max actuator magnetic switch (I hope they last) calibration sensors:
    IMG_4372.jpg

    I've gone back to the FlyPT ESP32 controllers and associated code and the BLDC motors seem to be running noticeably better. There is no sound from the motors at all, they run smoothly (there will always be a little graininess in a BLDC motor), and best of all no more unexplained actuator dipping!!

    There's still an issue starting up and connecting the FlyPT Mover output reliably as it often goes haywire during connection and tries to self destruct. I really need a solution for that still, and maybe as simple as a clear start-up sequence that I can carefully follow. Fingers crossed on that one.

    [EDIT] No more issues connecting! I got a new ESP32 and put together my 5th board (yep 5). This time of course I had fixed the issue, where previously 24v was being put on the Vin, and for the first time... it connects to the software without issue and works with perfectly (so far). VERY HAPPY. Will be wiring in the that rear traction loss motor connected to the today :) [/EDIT]

    I still have to re-do the rear traction loss motor, a ton of fine tuning, try out motion compensation (mainly for traction loss I think), and then fly some planes and race some cars.
    • Informative Informative x 1
    Last edited: Sep 11, 2022
  17. John Snell

    John Snell Member

    Joined:
    May 31, 2021
    Messages:
    63
    Balance:
    190Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I've done a bit of a tidy up (although in this photo I see there's still some work to do with cable ties under the pedals).

    The power supply and the motor drivers are now under the seat in front of the universal joint, and the control box for the Simucube OSW is under the rear. There is more of a gap at the back than it appears and there is still room for the rig to pitch up/down. It is much more self contained now and only requires mains power and a single USB connection.

    I've also rebuilt the DIY steering wheel, mainly to replace the ghastly 3d printed paddle shifters which were held together with a total of 7 cable ties in the end. There are two steering wheel spacers, miniature controller boards, and paddle shifters from aliexpress. The paddle shifters seem to be really nice quality

    The seatbelts are attached to the lower, non-moving, frame and to a certain extent this acts as a seatbelt tensioner as they pull tight when the front of the rig pitched down. The belts need to be fairly tight (like in a race car) for this to work though.

    IMG_4551v2.jpg
    • Like Like x 3
    Last edited: Oct 18, 2022
  18. John Snell

    John Snell Member

    Joined:
    May 31, 2021
    Messages:
    63
    Balance:
    190Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I have a small amount of play/slop in the (wormgear) gearboxes, which I think this is fairly common. Its not bad but at times there can be a small clunk as the actuators go from one direction to the other. I notice that DOF Reality sell dampers (which appear to be motorbike steering dampers) to combat that, and also some awesome looking SFU gearboxes to replace the wormgears completely.

    I decided to try something different, and which I have at home, in the form of trampoline springs that are set up to bend as the actuators move. They should apply a little more dampening as the actuators approach their movement limits, and less at other times. I've only done one side so far but I think it has added a level of smoothness.

    The video shows the prototype working. My next step is to make a purpose built bracket so that it looks pretty.

  19. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,141
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    148,541Coins
    Ratings:
    +10,902 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    A small about of backlash is normal: https://www.xsimulator.net/community/faq/wormdrive-backlash.293/

    A little bit of preloading by changing the balance point may help. The longer the lever CTC the more noticeable the backlash.
  20. John Snell

    John Snell Member

    Joined:
    May 31, 2021
    Messages:
    63
    Balance:
    190Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Thanks @noorbeast. I had considered preloading as a possible solution but TBH I then completely forgot about it, so a good reminder! I'm pretty sure it's not that well balanced already, but more favouring the rear (so the rig is pulling up on the front actuators rather than adding weight), so its certainly worth me doing a little trial and error and see how much improvement can be made.
    cheers
    • Like Like x 1