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

3DOF stepped motors

Discussion in 'Ready, set, go - Start your engines' started by gaboff_k, Aug 21, 2023.

  1. gaboff_k

    gaboff_k Member

    Joined:
    Nov 8, 2022
    Messages:
    32
    Balance:
    120Coins
    Ratings:
    +8 / 0 / -0
    Hello!

    I'm going to make a 3dof rack for flight simulators on Nema 34 12Nm stepper servos and 1:50 worm gears on Sim tools or FlyPT.

    Now the prototype is at the final stage, I found finances, I picked up all the equipment. Everything is ready to start the project.

    There are only doubts and concerns regarding the operation of stepper motors. Actuators on them are actively produced at home and work great. I haven't done it but my buddy does it with 220mm of travel on the ST90 and it's cool. Thank you Lebois for opening up this world for the masses.

    As far as I managed to study the issue, stepper motors are capricious, they can lose positioning. Theoretically, this is solved by buying Thanos. But this makes the project very expensive. In addition, microstepping can be felt at low speeds and they sag heavily in torque at high speeds.

    I don’t want to assemble on DC motors, as I have already suffered with encoders, couplings and other things. And this decision is probably yesterday.

    Actually, if you can figure out the settings, then I'll figure it out. The only question is how this solution (with stepper motors with a gearbox) will work efficiently and effectively?

    Is it worth it to start? Or the decision to do on DC motors is the only one that works correctly so far. Perhaps my fears are unfounded and the solution on gearboxes will work just as well as actuators and an inexperienced user will not notice any difference.

    In general, I decided to ask the advice of professionals before clicking on the Buy button.

    Thank you! 6.jpg
    • Like Like x 1
    Last edited: Aug 21, 2023
  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,395
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    150,025Coins
    Ratings:
    +10,993 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Have a chat with @Lebois, who started with steppers then moved on the servos, about the pros, cons and control of steppers.
    Last edited: Aug 21, 2023
  3. gaboff_k

    gaboff_k Member

    Joined:
    Nov 8, 2022
    Messages:
    32
    Balance:
    120Coins
    Ratings:
    +8 / 0 / -0
    Thanks for the advice. Posted by Lebois private message
    Last edited by a moderator: Aug 21, 2023
  4. adgun

    adgun Active Member

    Joined:
    Jan 28, 2008
    Messages:
    532
    Occupation:
    mechanic
    Location:
    Netherlands
    Balance:
    5,769Coins
    Ratings:
    +137 / 4 / -0
    Whit a 12nm stepper and i 50 gearbox you get 600nm on gearbox .you need a big strong one
    Big steppers dont make much rpm and with a i 50 gearbox youre sim whil be to slow
    regards Ad
  5. gaboff_k

    gaboff_k Member

    Joined:
    Nov 8, 2022
    Messages:
    32
    Balance:
    120Coins
    Ratings:
    +8 / 0 / -0
    I guess you're right.

    I usually make calculations when the engines are already rotating).



    1000rpm (nominal value)/50 (gearbox value)=20rpm
    20rpm/60sec=0,33rps

    Since we only use a maximum of 180 degrees from 360, we get almost 1.5 seconds to move the thrust from one extreme position to another. And this is at the maximum speed of rotation of the engine shaft..

    Yes, it's really not enough, even for air.

    If the principle of my calculations is correct, then a 1:20 gearbox may well be enough, where:
    1000/20=50rpm /60/2 = 0.4 seconds for shaft movement.

    Are the calculations correct?
  6. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,395
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    150,025Coins
    Ratings:
    +10,993 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Conventional community wisdom suggests between 150-700mm/s is required for good motion: https://www.xsimulator.net/community/faq/speed-needed-for-good-motion.218/
  7. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,946
    Location:
    London
    Balance:
    11,904Coins
    Ratings:
    +479 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    The problem with a stepper motor is it can't be controlled using PID

    It has to go from a to b and move every step one at a time.

    With pid you can accelerate fast and slow down at the destination. The positioning feedback does not slow down the operation
  8. Lebois

    Lebois (maybe I am wrong, but who knows...)

    Joined:
    Dec 10, 2018
    Messages:
    352
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    2,559Coins
    Ratings:
    +209 / 2 / -0
    My Motion Simulator:
    2DOF
    Hi. I wouldn't recommand using steppers... As you said, you will feel the steps no matter what you do.

    Honnestly, going from the stepper-based SRT100 to the servo-based SRT80 was like going from a G29 to a Simucube in term of smoothness...
    Plus servo can be really fast...

    I would go for steppers if it cut the price half, and couldn't afford more.
    • Agree Agree x 2
  9. gaboff_k

    gaboff_k Member

    Joined:
    Nov 8, 2022
    Messages:
    32
    Balance:
    120Coins
    Ratings:
    +8 / 0 / -0

    Thank you for the answer! Alas, I didn't have enough patience to wait for this answer. Therefore, all the purchased equipment has already arrived from China. Brings the local metal processing plant. I am waiting for the finished frame and all the details of the rods and fasteners from day to day. Well, there is nowhere to retreat. I will try to run what I have. The trouble is that, not being an expert, I believed that a servo motor (stepper) and a AC Servo motor are the same thing). This misconception cost me $500.
    The main thing is that this solution (with stepper servos) should work. So far, codes and firmware are a dark forest for me. As for micro-steps... I think that if you don't turn on the expert's moshion mode, but enjoy moshion as such, and even in VR, then you can completely survive microstages. But, this is how I console myself).Thanks!

    Attached Files:

  10. gaboff_k

    gaboff_k Member

    Joined:
    Nov 8, 2022
    Messages:
    32
    Balance:
    120Coins
    Ratings:
    +8 / 0 / -0
    Hi all!

    I continue to create my 3Dof platform. Mechanically everything is more or less normal. But there are obvious problems with the firmware and configuration.

    I really don’t want to understand the codes deeply. And it itself works with simple DC at 24. The greater the current, the faster the shaft rotates. +- one way, -+ the other. Fairy tale. But you can’t figure out steppers without 100 grams.

    Now I installed the firmware from @Lebios, which he wrote when he made his 2dof on Nema34 and HBS86h steppers. In FlyPT pose, rig was made from basic presets. I spent a long time studying how this program works. I installed a Logitech g940 joystick as a source and sent data to the Arduino.

    Now I’m at the stage when the stand reacts to the displacement of the joystick axis and the motors begin to rotate quickly and noisily uncontrollably. Something with feedback. Perhaps the same disease as on DC, if you set the movement of the shaft and encoder in one direction. Endless pursuit of the destination.

    I can say that the steppers are extremely noisy, but powerful. At least at low speeds and reinforced by gearing, they lift my 68kg with great ease. True, I’ll soon install another upper part of the 30kg+ rack and we’ll see.

    In general, there will be successes, I will be happy to share.

    Thank you!

    Attached Files:

    • Like Like x 1
  11. gaboff_k

    gaboff_k Member

    Joined:
    Nov 8, 2022
    Messages:
    32
    Balance:
    120Coins
    Ratings:
    +8 / 0 / -0
    https://youtube.com/shorts/WJWLfQb2QoU?si=8oIQcgZ8iurbmhtg

    Hello everyone

    I apologize in advance for the translator's mistakes.

    I'm tired of dealing with my stoppers. I will never contact them again.

    Now I'm stuck at the arduino coding stage. I corrected the Lebois code, since his code, which he wrote for HBS860 and the Nema34 stepper motor,
    refused to work at all. But the engines work extremely slowly, even with the largest step mode. Logic suggests that simply redirecting data from the serial in the form of Pulse to the drivers is not logical. But what exactly is the error and how to fix it, my competencies are not enough.
    You probably need to convert Target to Dex and send it to the engine as int Target. I've almost broken my head. Help with advice, please.


    #define RelayPin A0
    #define STEPS 10


    #define StepPin1 2
    #define DirPin1 5
    #define StepPin2 3
    #define DirPin2 6
    #define StepPin3 4
    #define DirPin3 7

    #define pulseDelay 6
    #define directionDelay 1

    byte buffer = 0 ;
    byte buffercount = 0 ;
    byte commandbuffer[6] = {0, 0, 0, 0, 0, 0};

    unsigned m1Target = 0, m2Target = 0, m3Target = 0;
    unsigned m1Position = 0, m2Position = 0, m3Position = 0;
    int dir1 = 1, dir2 = 1, dir3 = 1;
    byte dirChange = 0;
    bool noData = true;
    bool servoEnabled = false;
    int pulseWidth = 10;

    void setup() {
    Serial.begin(500000);

    pinMode(StepPin1, OUTPUT);
    pinMode(DirPin1, OUTPUT);
    digitalWrite(DirPin1, HIGH);

    pinMode(StepPin2, OUTPUT);
    pinMode(DirPin2, OUTPUT);
    digitalWrite(DirPin2, HIGH);

    pinMode(StepPin3, OUTPUT);
    pinMode(DirPin3, OUTPUT);
    digitalWrite(DirPin3, HIGH);

    pinMode(RelayPin, OUTPUT);
    enableServo();

    }

    void loop() {
    SerialReaderB();
    moveMotorB();
    }

    void SerialReaderB() {
    Data bits : 10 bits, Parity : None, stop bits : 1
    while (Serial.available()){
    if (buffercount == 0)
    {
    buffer = Serial.read();
    if (buffer != 'P') {

    buffercount = 0;
    } else {
    buffercount = 1;
    }
    }
    else // if(buffercount>=1)
    {
    buffer = Serial.read();
    commandbuffer[buffercount-1] = buffer;
    buffercount++;
    if (buffercount >= 7) {
    m1Target = commandbuffer[0] * 256 + commandbuffer[1];
    m2Target = commandbuffer[2] * 256 + commandbuffer[3];
    m3Target = commandbuffer[4] * 256 + commandbuffer[5];
    buffercount = 0;
    m1Target = m1Target * 2;
    m2Target = m2Target * 2;
    m3Target = m3Target * 2;
    break;
    }
    }}
    }



    void moveMotorB() {
    directionManagerB();
    singleStepB();
    }

    void directionManagerB() {
    if ((m1Target < m1Position) && (dir1 == 1)) {
    digitalWrite(DirPin1, LOW);
    dir1 = -1;
    dirChange = 1;
    }

    if ((m1Target > m1Position ) && (dir1 == -1)) {
    digitalWrite(DirPin1, HIGH);

    dir1 = 1;
    dirChange = 1;
    }

    if ((m2Target < m2Position) && (dir2 == 1)) {
    digitalWrite(DirPin2, LOW);
    dir2 = -1;
    dirChange = 1;
    }

    if ((m2Target > m2Position ) && (dir2 == -1)) {
    digitalWrite(DirPin2, HIGH);
    dir2 = 1;
    dirChange = 1;
    }

    if ((m3Target < m3Position) && (dir3 == 1)) {

    digitalWrite(DirPin3, LOW);
    dir3 = -1;
    dirChange = 1;
    }

    if ((m3Target > m3Position ) && (dir3 == -1)) {
    digitalWrite(DirPin3, HIGH);
    dir3 = 1;
    dirChange = 1;
    }

    if (dirChange == 1) {
    delayMicroseconds(directionDelay);
    dirChange = 0;
    }
    }

    void singleStepB() {

    if (m1Target != m1Position) {
    digitalWrite(StepPin1, HIGH);
    delayMicroseconds(pulseWidth);
    m1Position += dir1;
    }
    else{digitalWrite(StepPin1, LOW);}

    if (m2Target != m2Position) {
    digitalWrite(StepPin2, HIGH);
    delayMicroseconds(pulseWidth);
    m2Position += dir2;
    }
    else{digitalWrite(StepPin2, LOW);}

    if (m3Target != m3Position) {
    digitalWrite(StepPin3, HIGH);
    delayMicroseconds(pulseWidth);
    m3Position += dir3;
    }
    else{digitalWrite(StepPin3, LOW);}


    if(m1Target == m1Position){
    digitalWrite(StepPin1, LOW);
    return;
    }

    if(m2Target == m2Position){
    digitalWrite(StepPin2, LOW);
    return;
    }

    if(m2Target == m2Position){
    digitalWrite(StepPin3, LOW);
    return;
    }
    }

    void enableServo(){
    digitalWrite(RelayPin, LOW);
    servoEnabled=true;
    }
    void disableServo(){
    digitalWrite(RelayPin, HIGH);
    }

    [/CODE]

    Thanks!

    Attached Files:

    Last edited: Oct 13, 2023
  12. Lebois

    Lebois (maybe I am wrong, but who knows...)

    Joined:
    Dec 10, 2018
    Messages:
    352
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    2,559Coins
    Ratings:
    +209 / 2 / -0
    My Motion Simulator:
    2DOF
    @gaboff_k you should have a look to manipulation port to replace digitalwrite with faster solution.
    which steppers are you using ?
  13. gaboff_k

    gaboff_k Member

    Joined:
    Nov 8, 2022
    Messages:
    32
    Balance:
    120Coins
    Ratings:
    +8 / 0 / -0
    I use 86HB250-156B motors and HBS860H drivers. In your codes, I still didn’t understand what control via PSU means, so pin A0 is not displayed anywhere. That is, I only have pul+ and dir+, pul- and dir- connected on the ground. Also, I did not understand what servo = enable means. After re-reading a number of articles, I realized that a closed-loop servostepping motor does not transmit data from the encoder, but the very presence of the encoder does not allow the motor to skip steps. That is, even with installation settings, the motor shafts will not take the correct position if the last session was completed incorrectly. But this should be enough if you return the platform to the parking lot every time. Is it so?
  14. Lebois

    Lebois (maybe I am wrong, but who knows...)

    Joined:
    Dec 10, 2018
    Messages:
    352
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    2,559Coins
    Ratings:
    +209 / 2 / -0
    My Motion Simulator:
    2DOF
    yes. Each time to cut the power when the rig is parked
  15. gaboff_k

    gaboff_k Member

    Joined:
    Nov 8, 2022
    Messages:
    32
    Balance:
    120Coins
    Ratings:
    +8 / 0 / -0



    Hi all!

    We have a saying in Russia:
    “If I knew the purchase, I would live in Sochi.” This means: If you knew the answers to all the questions in advance, many difficulties could be avoided. In any case, no matter how well everything is planned and calculated, in the end, new problems and errors will emerge with each new solution.
    This time it was new for me:
    1. Stepper servos;
    2.3dof;
    3. FlyPT.

    Of the good ones, I either bought 100 parts or ordered them from production. Most of the manufactured parts are made on CNC machines, and the cardan shaft crosspieces are milled on a milling machine (for an external retaining ring). The only thing is that I had to take the upper part of the rack from my old 2dof platform, since I was let down by the deadlines at the factory. I'll get it a little later. In the meantime, the RUD and RUS are screwed to the chipboard boards.

    I had two main goals:
    1. Try your hand at designing a 3dof platform (with the obligatory presence of Heave), which would be intended primarily for flight simulators;
    2. Work with powerful engines.

    What conclusions can I draw from the results:
    1. I will never mess with stepper motors. The steps feel very good. I did not take into account that powerful steppers have a fairly low number of revolutions, so I mistakenly chose 25:1 gearboxes. Therefore, with a large number of steps (with a smooth move), the rods moved by 30 percent of the calculated stroke, and with a small number of steps, the movement resembled the work of a jackhammer. In the end I settled on 10000 on the driver, 16 bits in flyPT and gain up to 3.000. If I had gone with, say, 10:1 rather than 25:1 gearboxes, the rack would have run twice as smoothly and I'd have had twice as much tuning options. The consolation is that when flying in a helicopter or airplane, the steps resemble the grinding of metal under overload, which adds to the feeling of being in the cockpit).
    2. The second and important point is noise. Halfway through the project, I had to move the rack from home to the office because my wife was drilling me every time I started the engines. And only this allowed me to solve problems normally, without waiting for all the neighbors to wake up or go to work. True, in the office I went around to my neighbors and asked if the slight vibrations behind the wall were bothering them).
    3. I realized that if I want my level as a DIYer to grow, then I simply have to understand codes, at least understand the general principles of programming. So I spent a lot of time studying the documentation. Moreover, the situation contributed: nothing worked. Now I can sketch out the lightweight firmware myself. Getting the new rack to work was like putting together a level 5 puzzle. At first you spend an hour rotating it and don’t understand anything. That is, nothing works and it is not clear what to do. Then something happens by chance. Crooked and wrong. Then you spend time making sure it works correctly, at least one thing. At the same time, you find something else that is not working properly. And so on step by step. As a result, by the time of the assembly process you already have full control of all the details. We can move on.

    And then I want to put this platform on a pedestal with a engine that will simulate the YAW axis. Then I want to make a platform for two people with two PCs, to simulate a pilot and navigator. Then I want to make a 360 degree stand with heave support. But all this will (or will not) happen later. In the meantime, I am happy with my small successes.

    Thanks to all!
    • Like Like x 2