Stepper motor control panel for linear actuators

Поделиться
HTML-код
  • Опубликовано: 21 ноя 2024

Комментарии • 62

  • @ramizyabac3256
    @ramizyabac3256 11 месяцев назад +1

    In fact, you have shared the most used and needed information. :) Those who exchange this for high prices will be very angry with you :) As a Muslim, I hope you will be as materially and spiritually happy as the total happiness of the people who benefit from this video.

    • @CuriousScientist
      @CuriousScientist  11 месяцев назад

      Wait until you see the rest of my channel. :)
      I wish you the same!

  • @isidoromaich7226
    @isidoromaich7226 3 года назад

    Awesome demonstration 👍
    The fly said: maybe this device is modifiable to add a linear sensor or an encoder to the shaft to get a closed loop system

    • @CuriousScientist
      @CuriousScientist  3 года назад +1

      Thank you very much! I think the fly was suspecting something... :) I will actually add an AS5048A sensor to this actuator. I just need some time to draw and print a bracket for the circuit and write some code for the closed loop control. But I will definitely make this happen!

  • @CheekyLeoGames
    @CheekyLeoGames 3 года назад

    I'm just halfway into this video but this is exactly what I needed to know. Thanks a lot!

    • @CuriousScientist
      @CuriousScientist  3 года назад +1

      I am happy to hear it. I will keep expanding and improving this code and control panel, so make sure you check back regularly.

    • @CheekyLeoGames
      @CheekyLeoGames 3 года назад +1

      @@CuriousScientist Great to hear that! I definetly will!

  • @zeegrey3447
    @zeegrey3447 3 года назад +1

    Great video, looking forward to watch. Thanks for the time and effort.
    Appreciate it.

    • @CuriousScientist
      @CuriousScientist  3 года назад

      Hi! Thank you very much! I hope you will like it!

  • @patdowling5
    @patdowling5 3 года назад +1

    Looking forward to watching this, your videos are fantastic and no doubt this will be the same

    • @CuriousScientist
      @CuriousScientist  3 года назад

      Thank you very much! I hope you will like it. Don't forget to check back occasionally as I add more and more features to this control panel.

  • @davidgray9242
    @davidgray9242 Год назад

    Surperb presentation, really well explained

    • @CuriousScientist
      @CuriousScientist  Год назад

      Thank you very much! It is encouraging to read such comments!

  • @andrewdonald2770
    @andrewdonald2770 3 года назад

    Excellent CS! Thanks for sharing

  • @justinbell937
    @justinbell937 2 года назад +1

    This is great! Thank you!

  • @davidnicol9359
    @davidnicol9359 Год назад +1

    Hi there...Love your content . Where are you located ? Do you ever collaborate on projects ?

    • @CuriousScientist
      @CuriousScientist  Год назад

      Hi and thanks! I am located in Scandinavia. I haven't really done any collabs so far, but I worked on several private projects/assignments related to the content I publish here on RUclips.

  • @ScottWeverka
    @ScottWeverka 9 месяцев назад +1

    Hello, I am a newbie learning code and was playing around with your code and was wondering how I would go about converting Milimeter to imperial in the code. I live in the US, and I would like my tinker project to display imperial. Any help would be highly appreciated.

    • @CuriousScientist
      @CuriousScientist  9 месяцев назад +1

      Hi! It's the same way as you would do it on paper. Multiply the millimeters by 0.0394, so you get the result in inches. Or you can substitute the pitch with the imperial unit (I guess you use TPI over there) and then get the result in inches directly. Both could work.

    • @ScottWeverka
      @ScottWeverka 9 месяцев назад

      @CuriousScientist thank you for your feedback. I have watched a few of your videos and wanted to let you know you're doing an amazing job, and thanks for sharing your incredible talent.

    • @CuriousScientist
      @CuriousScientist  9 месяцев назад

      Thank you! I am trying my best.

  • @waleedanjum6966
    @waleedanjum6966 5 месяцев назад

    Thank you very much for making such informative videos.
    I am having a hard time getting it done for me. The library for nokia N5110 is not working appropriately.
    I didn't see anything on screen except the light.
    I don't know why may be the N5110 display is bad. However, I ordered it from your link. And can you please also let me know about pins of rotary encoder which one is clk , Dt, and switch as the one which I got has pins S1, S2, and key.

    • @CuriousScientist
      @CuriousScientist  5 месяцев назад

      Hi! If you use the exact same procedure as I did; same parts, same libraries, same code (my code), then it should work. Regarding the rotary encoder, it does not matter which is the CLK and which is the DT pin. If you swap them, you will only get the opposite behaviour, but nothing gets damaged. You can flip the wires and do everything as usual. S1 and S2 are CLK and DT and the key pin is the SW (switch).

    • @waleedanjum6966
      @waleedanjum6966 5 месяцев назад

      Thanks and one more question .
      Stm32 does not have any function to digitalPinToInterrupt in the following line. attachInterrupt(digitalPinToInterrupt(RotaryCLK), RotaryEncoder, CHANGE);

    • @CuriousScientist
      @CuriousScientist  5 месяцев назад

      What's the question?

    • @waleedanjum6966
      @waleedanjum6966 5 месяцев назад

      I got an error that stm32 blue bill does not understand digitalPinToInterrupt as its defined before in the following line of code.
      attachInterrupt(digitalPinToInterrupt(RotaryCLK), RotaryEncoder, CHANGE);

    • @CuriousScientist
      @CuriousScientist  5 месяцев назад

      Probably a bracket ("{" or "}") is missing somewhere. Check the code.

  • @ScottWeverka
    @ScottWeverka 9 месяцев назад

    So i did a little research and found that AccelStepper with distance 1.0.4 is in millimeter distance. Is this where the code would be to convert from mm to imperial? Like i said, I'm a newbie and bound and determined to figure this out. Hopefully with a little bit of help😊

    • @CuriousScientist
      @CuriousScientist  9 месяцев назад

      Sorry but I have no idea about what you're talking about. Accelstepper doesn't use mm units, only steps are used.

  • @aleperez9262
    @aleperez9262 3 года назад

    amazing job man! just a question, is possible to convert everything from steps to mm?

  • @shashikantgupta611
    @shashikantgupta611 2 года назад

    Hi Pal !! Your video series related to stepper motor is really helpful. I need to complete a project using a linear actuator based on the NEMA 23. The project contains keeping the sliding part at 20 mm from the other end (making it Home) and giving it a stroke length ranging from 1 mm to 20 mm. And in every stoke length, the frequency of reciprocating motion of the sliding part can also vary ranging from 1 Hz to 10 Hz. Can you plz let me know if it is possible to achieve this way of motion?

    • @CuriousScientist
      @CuriousScientist  2 года назад +2

      Hi! You didn't mention anything about the load scenarios... But, to cover 20 mm while oscillating with 10 Hz sounds reasonable. But you need to consider load, acceleration, inertia...etc.

    • @shashikantgupta611
      @shashikantgupta611 2 года назад

      @@CuriousScientist there will be a 3d printed attachment on the top part. the weight will be possibly 100 gm max. the attachment is supposed to perform reciprocating motion(different stroke lengths with different frequencies) and also to hit a wall against it. the wall will be fixed at the other end of the linear actuator.

  • @CheekyLeoGames
    @CheekyLeoGames 3 года назад

    I have a question concering the LimitSwitchPressed() function you are using. For my realisation I found it easier to use the attachInterrupt() and then trigger a stopMotor() function as you did in your old homing video. When I now trigger it, with the stopMotor() function defined as below, then after triggering it stops immediately (that I want) entering another command it still proceeds to decelerate (where it left off) and then turns around and goes to the value selected. Would you happen to know how I can make it so that it does not "decelerate" since that is quite pointless?
    And another question is, if there would be a away to implement the while from the LimitSwitchPressed() into the attachInterrupt() based function. I don't seem to get it to work unfortunately, playing with the setup and the digitalRead 0 or 1 values.
    void LimitSwitchPressed() {
    if (digitalRead(pinCrash) == 0) { //0 or 1, depends on the wiring!
    if (millis() - previousInterrupt > 300) {
    stepper.stop(); //"soft" stop - decelerates to 0.
    previousInterrupt = millis();
    //Alternatively we can make it to go to a specific place:
    //stepper.moveTo(0); //This goes back to absolute 0, which is technically the homing
    }
    while (digitalRead(pinCrash) == 0) { //0 or 1, depends on the wiring!
    stepper.setSpeed(500);
    stepper.runSpeed();
    }
    //stepper.setCurrentPosition(0); //Set the new position to zero
    }
    }
    void stopMotor() { //Function activated by the pressed microswitch
    runallowed = false; //Disable running
    Serial.println("Stopped by crash sensor.");
    stepper.stop();
    stepper.disableOutputs(); //Disable power
    Serial.print("Current position: ");
    Serial.println(stepper.currentPosition());
    //stepper.setCurrentPosition(0); // reset position
    }

    • @CuriousScientist
      @CuriousScientist  3 года назад

      As long as you use the run() function it will decelerate. Read the documentation of the AccelStepper library. Try to put a runToPosition() command right after the stop() command, it should help. You should not run anything in the ISR(). Just switch a flag and do the task in the loop() based on the flag's (a bool variable) status.
      Also, please not that I am not a free consulting service. I cannot keep solving the questions.

    • @CheekyLeoGames
      @CheekyLeoGames 3 года назад +1

      @@CuriousScientist First of all, thank you I will check it out. Secondly, I understand and it was not really intended that way, more of a discussion that any viewer of this video could answer. I did not plan on asking other questions or expect them to be (fully) answered.

  • @danhellgren5671
    @danhellgren5671 2 года назад

    How fast can this thing be? I am playing with the idea of making an inverted pendulum. But maybe stepper motor and ballscrew isnt fast enough for that?

    • @CuriousScientist
      @CuriousScientist  2 года назад

      I don't know, but it depends on different things. Your question is a bit underdetermined. What acceleration is needed? How much load do you want to put on it...etc?

  • @ScottWeverka
    @ScottWeverka 9 месяцев назад

    Thanks!

  • @shehrozetahirkhan9329
    @shehrozetahirkhan9329 2 года назад

    I am facing a problem while using this code. I pasted the exact code in the arduino IDE, include the N5110 library but when I try to compile the sketch, it returns an error everytime saying that, "N5110_SPI.h: no such file or directory." Can anyone please help me out?

    • @CuriousScientist
      @CuriousScientist  2 года назад

      Based on the error message, you don't have the library installed. It should be installed in your Arduino/libraries folder. Including the library doesn't matter if there's nothing to include.

  • @howardbealeau
    @howardbealeau Год назад

    This seems to be your earliest video where you have used STM32F103C8T6 Blue Pill and have described the code in detail. I'm just wondering whether you used the Arduino IDE to upload the code to the Blue Pill and whether you also used the STM32 ST-LINK Utility as you described in another video "STM32F103C with ST-Link and STM32duino, simplified!" (ruclips.net/video/saolJ_7E7hc/видео.html). How would it be different if you had only used the STM32CubeIDE with the ST-Link V2 dongle?

    • @CuriousScientist
      @CuriousScientist  Год назад

      Hi!
      Typically, when you buy a Blue Pill, they come with a pre-installed bootloader. That means that you can directly connect to them via USB and upload the software from Arduino IDE. I was not using the ST-Link in this case.
      The video that you are referring to is a guide for those who want to install the bootloader on the Blue Pill, or for those who want to program the microcontroller with the ST-Link. The bootloader is just a convenience which allows us to upload our code to the circuit through a USB connection.
      Regarding your last question, I would say that it would be _entirely_ different. The CubeIDE uses a totally different syntax (HAL), so even the code would be totally different. You would need to write everything from scratch. Programming-wise, you just need to connect the 3.3 V, GND, IO and CLK to the board and upload it using the ST-Link. It is simple.

    • @CuriousScientist
      @CuriousScientist  Год назад

      Hi! Both MCUs came with bootloader, so I could program them via USB. Once again, from an oversimplified perspective, the bootloader is only a convenience for us users that allows us to upload our code via USB. We do not need the bootloader to upload the code to the microcontroller. You can use the ST-Link and upload the code directly with the ST-link.
      In the Part 8 of my coil winder video series I show how to configure the IDE to be able to use the ST-Link to upload code to the microcontroller. Then I also used the ST-Link to get that code on the MCU.

    • @howardbealeau
      @howardbealeau Год назад +1

      @@CuriousScientist Sorry, I must have missed that bit, i.e. "how to configure the IDE to be able to use the ST-Link to upload code", in Part 8 of the Coil Winder video series. However, I did find other videos on this topic which also describe the need to set the Arduino IDE Upload method to "STM32CubeProgrammer (SWD)", among the other things.
      The need to run STM32CubeProgrammer with the ST-Link connected to a USB port is explained in some of those other videos. They say that STM32CubeProgrammer just needs to be opened and then closed.
      I think I saw one video where STM32CubeProgrammer was able to CONNECT to a target (STM32F103C8 blue pill/STM32F401CCU6 black pill?) which was connected to a ST-LINK V2. However I have not been able to replicate that (CONNECTING to a STM32F401CCU6 black pill using STM32CubeProgrammer and ST-Link V2). It does not seem to matter though, because Arduino IDE is still successful uploading code (to a STM32F401CCU6 black pill) via the ST-Link V2 when the upload method is set to "STM32CubeProgrammer (SWD)".

  • @robertorusso6899
    @robertorusso6899 11 месяцев назад

    very noisy controller, you better use TMC2209, silent step

  • @robertorusso3192
    @robertorusso3192 3 года назад

    very noisy motor. you should use TMC2208 you will get a much better performances from the motor and also less space used by the driver .

    • @CuriousScientist
      @CuriousScientist  3 года назад

      Wrong. I was using low microstepping value (I think, I used 400 steps/turn or something like that) which is of course noisy. I could've used 1600 or 3200 steps/turn which would've rendered the motor almost entirely silent. Additionally, my table also amplifies all kinds of vibrations which you could also hear. Finally, your suggestion is bad, because the TMC2208 is rated for 1.4 A continuous current whereas this stepper motor is rated for 3 A. Also, the TMC2208 is more expensive. :)

  • @jorgeleandrostovar
    @jorgeleandrostovar 3 месяца назад

    Boring