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

6DOF Prototype using small dc motors

Discussion in 'DIY Motion Simulator Projects' started by Gustavo Massaneiro, Jun 3, 2018.

  1. Gustavo Massaneiro

    Gustavo Massaneiro New Member

    Joined:
    May 8, 2018
    Messages:
    14
    Location:
    Brazil
    Balance:
    77Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, 4DOF, 6DOF
    Hello Folks,

    I'm building a prototype of 6DOF simulator using dc motors and rotary encoder instead of regular pots/hall effect sensors. I’m using the SMC3 software as a reference, and building my own software based on the SMC3, but just for 2 motors and 2 rotary encoders, also using freeRTOS with tasks and a nodeJS server that receives the SimTools UDP packets and send through the serial port to Arduino Uno.

    My Setup:

    · 6x Small DC motors (3-6v)

    · 6x Rotary Encoders (KY-040)

    · 3x L298N boards (H-bridge)

    · 12x Mini kossel spherical joints
    · 3x Arduino Uno
    IMG_8632.JPG

    I’m planning to use just one pc to handle everything, pc settings:

    · Intel i7 7700K @ 4.5 ghz

    · AsRock z270 PRO4

    · 8gb Corsair Vengeance DDR4 @ 3000 mhz

    · Gigabyte GTX 1070 8gb

    · 2x 128gb SSD Samsung Pro 840 @ Raid0

    · Logitech G27 Gaming Wheel

    · Stockcar Cockpit for G27
    IMG_8634.JPG

    I’ve updated the SMC3 software to use the rotary encoder instead of the pots.

    Here is the info regarding the rotary encoder: http://henrysbench.capnfatz.com/hen...es-ky-040-arduino-rotary-encoder-user-manual/


    The Rotary Encoder has a total of 30 rotations, it means 30 rotations = 360 degrees

    1024/30 = 34.13 per rotation on a total range of 0 – 1020 for 360 degrees

    Limiting the rotary encoder rotation to 180 degrees: 1024/15 = 68.26 per rotation on total range of 0 – 1020 for 180 degrees.


    The feedback seems to be working fine with the rotary encoder, but it seems that the dc motor gearbox has a lot of slack, something is wrong:
    upload_2018-6-3_16-1-53.png


    Now testing the Axis1a using the SimTools Output Testing:
    upload_2018-6-3_16-2-25.png


    I would like to have your opinion about the feedback using the rotary encoder, what is wrong? The code is attached.
    Also, I need to use something to get the current position of the rotary encoder after power on/down, some type of calibration based on the min/max angles, maybe using 2 sensors for min/max angle to calibrate the rotary encoder and go to center position.


    Code used for the rotary encoder:

    initEncoder(MOTORA_CLK, MOTORA_DT);

    //Feedback1 = analogRead(FeedbackPin1);
    Feedback1 = encoder.currentValue;

    Attached Files:

    • Like Like x 1
    Last edited: Jun 3, 2018
  2. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,897
    Location:
    London
    Balance:
    11,610Coins
    Ratings:
    +458 / 9 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF

    What type of motors do you use ? Do they have a gearbox ?
  3. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,574
    Occupation:
    Retired
    Location:
    Brisbane Australia
    Balance:
    28,370Coins
    Ratings:
    +2,844 / 39 / -0
    My Motion Simulator:
    AC motor, Motion platform
    Yes, he has a gearbox on his small motors (see his first picture - gearbox in yellow). I'm not surprised that they have some slack :). You could use limit switches and some code for initial calibration.
  4. Gustavo Massaneiro

    Gustavo Massaneiro New Member

    Joined:
    May 8, 2018
    Messages:
    14
    Location:
    Brazil
    Balance:
    77Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, 4DOF, 6DOF
    Last edited: Jun 4, 2018
  5. Gustavo Massaneiro

    Gustavo Massaneiro New Member

    Joined:
    May 8, 2018
    Messages:
    14
    Location:
    Brazil
    Balance:
    77Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, 4DOF, 6DOF
    My rotary encoder direction was inverted, it was causing initial failure of the software with invalid feedback values.. And I thought the problem was the L298N board :(
    The range of SimTools axis is just 100-923, why? Shouldn't be 0-1024?
    I'm planning to use Optic Sensors TCRT5000 as limit switches, I will test the min range of them and check if they work as expected.

    First test of the motor after some regulations:
    • Like Like x 1
  6. Gustavo Massaneiro

    Gustavo Massaneiro New Member

    Joined:
    May 8, 2018
    Messages:
    14
    Location:
    Brazil
    Balance:
    77Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, 4DOF, 6DOF
    I bought 2 monster motor shields, lets see if I have lucky with them.

    The first board has poor soldering on the chips and a short circuit ping soldering on one of the chips. Also I can't even read the chips info.
    The second board looks better, I can read the chips info and the soldering is better.
    I will test the second board and re-solder some pins of the first board.

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]

    Attached Files:

    Last edited: Jul 3, 2018
  7. marco cristopulos

    marco cristopulos New Member

    Joined:
    Apr 30, 2021
    Messages:
    23
    Balance:
    139Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    Can u help with connection h bridge l298n to arduino, i am complete noob and try to find how a lot time and cant find