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 FlyPT - 6DOF Brushless DIY Actuators

Discussion in 'DIY Motion Simulator Projects' started by pmvcda, Aug 29, 2017.

  1. robjos1

    robjos1 Member

    Joined:
    Jun 17, 2018
    Messages:
    38
    Occupation:
    Flying about
    Location:
    United Kingdom
    Balance:
    281Coins
    Ratings:
    +23 / 0 / -0
    My Motion Simulator:
    6DOF
    So I thought i'd managed to get to the bottom of this but still having issues sadly.

    My motor is connected in the reverse sense with a belt drive. When powering on currently this happens for the calibration:
    1: Moves to Maximum position limit switch
    2: Moves to Minimum position limit switch and stops

    If connected to mover then:
    3:Moves in the incorrect direction down over the min position limit switch - instead to up to the central position.

    Basically its reversed somehow and should be going to min first then max. I have tried swapping:
    #define UP HIGH
    #define DOWN LOW
    This does make it move down first but it ignores the minimum limit switch and runs to lower hard stop as its looking for the max one.

    I have also tried removing the "-" in this line:

    ledcWrite(actuator[n][PWM_CHANNEL], 0);
    actuator[n][MAXIMUM_POSITION] = -actuator[n][CURRENT_POSITION] / 2; <<<<<
    actuator[n][MINIMUM_POSITION] = -actuator[n][MAXIMUM_POSITION];
    actuator[n][CURRENT_POSITION] = actuator[n][MINIMUM_POSITION];
    actuator[n][FOUND] = true;
    found++;

    I note as well the values in mover are reversed. When connecting a simple 1DOF direct to the actuator a value of -100 makes it go up and 100 down.

    I realise I could rewire the actuator to swap the switches around but I have followed the updated schematics and im wondering if I will encounter future issues with the actuator being reversed.
  2. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,261
    Location:
    Portugal
    Balance:
    9,831Coins
    Ratings:
    +1,295 / 13 / -0
    My Motion Simulator:
    6DOF
    Yes, SeatTime just pointed me the error in the direct this morning.
    Give me some time (minutes), and will look better at your hardware problem.
  3. robjos1

    robjos1 Member

    Joined:
    Jun 17, 2018
    Messages:
    38
    Occupation:
    Flying about
    Location:
    United Kingdom
    Balance:
    281Coins
    Ratings:
    +23 / 0 / -0
    My Motion Simulator:
    6DOF
    Take as much time as you need, your help is always massively appreciated :)
  4. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,261
    Location:
    Portugal
    Balance:
    9,831Coins
    Ratings:
    +1,295 / 13 / -0
    My Motion Simulator:
    6DOF
    I'm looking at it now. I'm a bit lost also :confused:
  5. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,261
    Location:
    Portugal
    Balance:
    9,831Coins
    Ratings:
    +1,295 / 13 / -0
    My Motion Simulator:
    6DOF
    @robjos1 ,
    Remember me the values you got for maximum and minimum.
  6. robjos1

    robjos1 Member

    Joined:
    Jun 17, 2018
    Messages:
    38
    Occupation:
    Flying about
    Location:
    United Kingdom
    Balance:
    281Coins
    Ratings:
    +23 / 0 / -0
    My Motion Simulator:
    6DOF
    So with the HIGH/LOW reversed the motor starts moving down for calibration (but its looking for max). I manually press the MAX limit switch and the motor reverses. It goes up until I activate the MIN limit switch. This outputs the values
    Actuator 0: Minimum=-212 Maximum=212

    If I connect mover the actuator completes the calibration and then returns to the midpoint as it should - Issue being that its reversed. I am getting a little bit of pulsing between two phases on the motor when at rest - can I tune the PID manually in the code?

    Can do a video if it would help
  7. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,261
    Location:
    Portugal
    Balance:
    9,831Coins
    Ratings:
    +1,295 / 13 / -0
    My Motion Simulator:
    6DOF
    You could make a video.
    Do you have any load on the motor?
    You can change the pid values in the code.

    I'm looking at the code to see what to change, to make the actuator move the right way
  8. ERGUN OZYURT

    ERGUN OZYURT Heximax Gold Contributor

    Joined:
    Nov 29, 2019
    Messages:
    9
    Location:
    Turkey
    Balance:
    - 91Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF
    Hi, this is great project. Thanks for sharing your experince with us.

    You said in previous post "automatic pid value" on esp32. Can you share idea behind that ? And may be some Pseudocode ?

    Thanks
  9. robjos1

    robjos1 Member

    Joined:
    Jun 17, 2018
    Messages:
    38
    Occupation:
    Flying about
    Location:
    United Kingdom
    Balance:
    281Coins
    Ratings:
    +23 / 0 / -0
    My Motion Simulator:
    6DOF
    No load on the motor. Its being run from a fairly low power supply but seems to run it ok for testing.

  10. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,261
    Location:
    Portugal
    Balance:
    9,831Coins
    Ratings:
    +1,295 / 13 / -0
    My Motion Simulator:
    6DOF

    Just a basic auto tune

    I'm preparing a specific source in Mover for this type of actuator, like I had in the old program.
    We could adjust pid live.
    The auto tune would be based in the readings we get from the actuator position, compared to requested position, and would be more to compensate for weight.
    It would need a sequence of tests with the user sitting in the rig.
    We just want to reach destination has fast as possible, and don't go over it, and avoid oscillation, all this could be tested with that sequence, or could even work totally automatic with normal use.
    We would just set the desired maximum speed.
    This could also help in having all actuators moving in synch, that was somehow achieved by automatic speed calculation in the old program.
    In a hexapod, moving to a specific pose, some actuator cá move 200mm, while others, just 50mm. To make them reach destination at the same time, speed was automatically calculated from the feedback received from the actuator.
    I can move the actuators just with speed, instead of position, by receiving their position as feedback.
    Two way communication.

    Sorry. I'm on the phone and there might be errors in the text...
  11. Gabor Pittner

    Gabor Pittner Active Member Gold Contributor

    Joined:
    Oct 25, 2018
    Messages:
    181
    Location:
    Szekesfehervar Hungary
    Balance:
    1,163Coins
    Ratings:
    +83 / 0 / -0
    My Motion Simulator:
    6DOF
    It sounds good, Im looking forward to it. :rolleyes: You mentiond before about the different PID control when actuators going up and down. Now because of the rig load, actuators are going down faster than going up. As you said its very comlicated to make in the code. How do you see now? :cool:
  12. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,261
    Location:
    Portugal
    Balance:
    9,831Coins
    Ratings:
    +1,295 / 13 / -0
    My Motion Simulator:
    6DOF

    Simpler :p
    • Like Like x 1
  13. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,261
    Location:
    Portugal
    Balance:
    9,831Coins
    Ratings:
    +1,295 / 13 / -0
    My Motion Simulator:
    6DOF

    I'm so sorry, got other things in the way and forget to come back to your problem.
    I could not get near the rig to make some tests, but from what I see, changing directions should be enough:

    Replace this:
    #define UP HIGH // Define to set up direction as HIGH
    #define DOWN LOW // Define to set down direction as LOW

    with:
    #define UP LOW
    #define DOWN HIGH

    I know you already have done it, but it should be enough.
    If you get the calibration correct, you can change this code to make it drive the right direction:

    change from:
    // Apply changes to motor controller
    // =================================
    if (actuator[n][SPEED] > 0)
    {
    ledcWrite(actuator[n][PWM_CHANNEL], actuator[n][SPEED]);
    digitalWrite (actuator[n][DIRECTION_PIN], UP);
    }
    else
    {
    ledcWrite(actuator[n][PWM_CHANNEL], -actuator[n][SPEED]);
    digitalWrite (actuator[n][DIRECTION_PIN], DOWN);
    }

    to:

    // Apply changes to motor controller
    // =================================
    if (actuator[n][SPEED] < 0)
    {
    ledcWrite(actuator[n][PWM_CHANNEL], actuator[n][SPEED]);
    digitalWrite (actuator[n][DIRECTION_PIN], UP);
    }
    else
    {
    ledcWrite(actuator[n][PWM_CHANNEL], -actuator[n][SPEED]);
    digitalWrite (actuator[n][DIRECTION_PIN], DOWN);
    }

    In the end, I think you have the switches swapped
    • Like Like x 1
  14. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,261
    Location:
    Portugal
    Balance:
    9,831Coins
    Ratings:
    +1,295 / 13 / -0
    My Motion Simulator:
    6DOF
    Updated the post with the code in the first page.
    Now with the latest version and comments updated for Mover.
    Also prepared to post a new code version for PID calculation in the PC. (soon)
  15. benmax

    benmax Active Member Gold Contributor

    Joined:
    Oct 15, 2013
    Messages:
    161
    Balance:
    1,303Coins
    Ratings:
    +50 / 0 / -0
    My Motion Simulator:
    2DOF
    Hi Flypt ,
    Made some turns on my sim rig yesterday and no errors with data sent ( Thanos board , esp32 board ), but one moment Mover frozen . No problem on my sim rig , last position frozen and switch off to go back to start position .
    I had to close Mover with task manager , app frozen but not seen into task manager that Mover won't respond .
    It's maybe my PC , I don't know .
    Cheers
    Edit : just watched new release Mover 2.9.7 , will give a try an report
  16. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,261
    Location:
    Portugal
    Balance:
    9,831Coins
    Ratings:
    +1,295 / 13 / -0
    My Motion Simulator:
    6DOF
    Did you press the Output hotkey?
    Happened to me using a wireless keyboard.
    You can set it in the options.
    Latest version allows you to do it with joystick buttons also. But there's a bug that makes the setup loose the hotkeys info.
    I will publish a new build today with than one solved and some other small problems.
  17. benmax

    benmax Active Member Gold Contributor

    Joined:
    Oct 15, 2013
    Messages:
    161
    Balance:
    1,303Coins
    Ratings:
    +50 / 0 / -0
    My Motion Simulator:
    2DOF
    What is the Output hotkey ? where did you setup this ?
    And yes I have a wireless keyboard
    Ok thanks
  18. hexpod

    hexpod http://heXpod.xyz

    Joined:
    Apr 18, 2016
    Messages:
    842
    Location:
    berlin
    Balance:
    5,338Coins
    Ratings:
    +246 / 3 / -0
    My Motion Simulator:
    DC motor, 6DOF
    It’s default combination to activate sources or connecting to the controllers. Alt-O Alt-S. You find them under options. The question is if you didn’t pressed those unitentonally.
    • Like Like x 1
  19. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,261
    Location:
    Portugal
    Balance:
    9,831Coins
    Ratings:
    +1,295 / 13 / -0
    My Motion Simulator:
    6DOF
    In the options, you can set a hotkey to start/stop sources and another to start/stop outputs.
    By default it's Alt+S and Alt+O

    In the last version, besides keyboard, you can also set joystick buttons (with bug, does not store preference in setup)

    So if you inadvertently pressed the key, it stops the output and goes to park position
  20. benmax

    benmax Active Member Gold Contributor

    Joined:
    Oct 15, 2013
    Messages:
    161
    Balance:
    1,303Coins
    Ratings:
    +50 / 0 / -0
    My Motion Simulator:
    2DOF
    Ok thanks to clarify this !
    I don't think that the problem comes from hotkeys , as I said Mover frozen , unable to do something , Mover wouldn't responding .