28BYJ-48 Stepper Motor Project ?

Discussion in 'Welcome to the DARK side' started by Colin_W, Feb 4, 2021.

  1. Andy_Sollis

    Andy_Sollis Staff Member Moderator

    Messages:
    3,894
    Likes Received:
    3,621
    Joined:
    Aug 4, 2018
    I’ve got an O gauge 4 gate NSR crossing I designed and printed but never really got any further - maybe I could re visit. My original idea was 1 servo and chains (much like the real thing) but it’s a stalled project.
     
  2. Andy_Sollis

    Andy_Sollis Staff Member Moderator

    Messages:
    3,894
    Likes Received:
    3,621
    Joined:
    Aug 4, 2018
    Is that at half step.. I came across a way you could really slow them down and it’s not notchy.
     
  3. Colin_W

    Colin_W Full Member

    Messages:
    230
    Likes Received:
    95
    Joined:
    Nov 19, 2016
    It's full step Andy and the gates are direct drive. If I get chance I may look at the half stepping.
    Col
     
    Andy_Sollis likes this.
  4. Keith M

    Keith M Staff Member Moderator

    Messages:
    4,446
    Likes Received:
    2,902
    Joined:
    Dec 16, 2015
    I got a working 4 gate crossing by using the MERG 'Servo 4' kit with 4 of the cheap SG90 servo's Andy. Setting it up is a faff, but I do have a setting box now, which I didn't have originally, so it's much easier now.
    Keith.
     
    Andy_Sollis likes this.
  5. Colin_W

    Colin_W Full Member

    Messages:
    230
    Likes Received:
    95
    Joined:
    Nov 19, 2016
    Just to close this topic, as I said before all my points are being driven by 28BYJ-48's and are controlled by wireless Push Button and/or JMRI DCC++. The system seems robust and operates quietly and at any speed from prototypical to pretty fast depending on the speed potentiometer .
    The other part was an 'O' gauge level crossing experiment which turned out not too bad.
    This was the original:
    IMG_20210420_092206493.jpg

    These were the 3D parts for the final assembly:
    IMG_20210420_092142480.jpg
    And the drive shafts on the motors.
    IMG_20210420_092947314.jpg
     
    jakesdad13, paul_l and Andy_Sollis like this.
  6. Colin_W

    Colin_W Full Member

    Messages:
    230
    Likes Received:
    95
    Joined:
    Nov 19, 2016
    And finally the unit in operation.


    Col
     
    Keith M, paul_l and Andy_Sollis like this.
  7. Andy_Sollis

    Andy_Sollis Staff Member Moderator

    Messages:
    3,894
    Likes Received:
    3,621
    Joined:
    Aug 4, 2018
    Love The crossing.

    you mention about it finding it’s limits at the power up. How does it do that? Some kind of sensor?
     
  8. Colin_W

    Colin_W Full Member

    Messages:
    230
    Likes Received:
    95
    Joined:
    Nov 19, 2016
    No Andy, if you look at the picture of the two motors and drive shafts, on the top one left hand side you can see a stub, it hits a physical stop. The motor stalls and that is why the gate shakes at that point. socket1.JPG
    This is the underside of the base plate.
    Plug1.JPG
    and this is the shaft, it can only rotate just over 90 deg.
    After the motor stalls it just drives back and forward the set number of steps.

    Col
     
    paul_l and Andy_Sollis like this.
  9. Andy_Sollis

    Andy_Sollis Staff Member Moderator

    Messages:
    3,894
    Likes Received:
    3,621
    Joined:
    Aug 4, 2018
    Hmm. Not sure I like the idea of setting a stop point for a stepper motor by stalling the gears. Think I’d rather have had some feedback like a hall detector or a push switch to mark the zero. Only need one at one side. Then just work the steps out to how far you need to move to. More risk of knackering a gearbox - but suppose they are not expensive.

    but it looks good. I’ll give you that! :thumbs:
     
  10. paul_l

    paul_l Staff Member Administrator

    Messages:
    9,848
    Likes Received:
    5,902
    Joined:
    Dec 5, 2015
    Very effective Colin, both the model and the control.

    Are you adding interlocking or output signals from the unit to either stand alone signals or to a signal controller ?

    Do that and I think you'd have a very saleable project.

    Paul
     
  11. Colin_W

    Colin_W Full Member

    Messages:
    230
    Likes Received:
    95
    Joined:
    Nov 19, 2016
    Hi Andy, these motors are very weak, it's not like stalling a Neema 17. Where they are used in normal operation on things like air conditioning vents etc they have to be able to stall. When I did current checks there is no increase in current between a running motor and a stalled one. Also there are no electrical contacts in the motor, all that happens is the arduino sends pulses via the driver chip which is also 5 volts. Once it has stalled then it drives back and forward 552 steps and doesn't stall again unless it becomes jammed. They are also turned off between each operation. I suspect this is how they are used in the louver vents, I can't see them setting up sensors every time one gets stuck and if one did jam and the motor was permanently trying to run up and down then they have to be able to stall safely. There is also no excessive heat but like all stepper motors they feel slightly warm. Steppers are designed to hold a load in position under power which is effectively stalling and they can get fairly hot in operation (big ones 100-110 deg on their cases). If you stick a lever on the shaft of one of the 28BYJ-48's and stop it you'll feel how easily they stall :lol:. The only weak part is as you say the gears but they handle it ok on both the crossing and in the point motors I have built (so far).
    As always thanks for bouncing the comments off me :thumbs: really appreciate them.
    Nice little article here https://lastminuteengineers.com/28byj48-stepper-motor-arduino-tutorial/


    Col
     
  12. Colin_W

    Colin_W Full Member

    Messages:
    230
    Likes Received:
    95
    Joined:
    Nov 19, 2016
    Hi Paul, there are still several in/out pins on the arduino so it wouldn't be a problem to setup signals etc.. as for selling not really sure I want to go down that route. Time consumption getting pcbs made, just don't know.
    Thanks for kind comments mate.
    Col
     
    Andy_Sollis likes this.
  13. Andy_Sollis

    Andy_Sollis Staff Member Moderator

    Messages:
    3,894
    Likes Received:
    3,621
    Joined:
    Aug 4, 2018
    Ah.. I thought they were run off an Arduino board.
    I have an O gauge 4 gate system to finish one day. At the moment the gates are chain linked, but never got around to fastening up the servo to turn them.
    Then I have the 4 road stop blocks to fathom..although I think I may have a solution on that one.
    Thanks for the info on the stalling. How does it set a zero from a stall? I have to set it by a magnet on my turntable, and then it still goes out due to the gearbox backlash.
     
  14. Colin_W

    Colin_W Full Member

    Messages:
    230
    Likes Received:
    95
    Joined:
    Nov 19, 2016
    Hi Andy, I drive the motor 600 steps which is greater than it's complete travel range so it bumps into the end stop.
    This is done in the 'void setup()' then I stop the motor by pulling all the pins low.The magnetic system you use is just the same as an end stop but done electronically. The motor can now be driven the correct distance for a quarter (90 deg) turn 552 steps or driven back again -552 steps for each gate. I'll dig out the code for you tomorrow, not heading to the shed tonight :lol:. It's not complicated once you see it.
    Col
     
    Last edited: Apr 26, 2021
    Andy_Sollis likes this.
  15. paul_l

    paul_l Staff Member Administrator

    Messages:
    9,848
    Likes Received:
    5,902
    Joined:
    Dec 5, 2015
    Hi Colin

    Congrats on Pic of the Week - a great set of projects, and the Level crossing is impressive

    Paul
     
  16. Andy_Sollis

    Andy_Sollis Staff Member Moderator

    Messages:
    3,894
    Likes Received:
    3,621
    Joined:
    Aug 4, 2018
    Ok..
    Makes sense.. look forward to the sketch.

    well done on pic of the week!
     
  17. Colin_W

    Colin_W Full Member

    Messages:
    230
    Likes Received:
    95
    Joined:
    Nov 19, 2016
    Thanks guys, nice surprise :tophat:
     
  18. Colin_W

    Colin_W Full Member

    Messages:
    230
    Likes Received:
    95
    Joined:
    Nov 19, 2016
    Hi Andy, uploaded the file hope this works. You should be able to download it?
    Col
     

    Attached Files:

    Andy_Sollis likes this.
  19. Colin_W

    Colin_W Full Member

    Messages:
    230
    Likes Received:
    95
    Joined:
    Nov 19, 2016
    Thanks Paul, maybe one day I'll actually build this layout I have in here :lol:
     
  20. York Paul

    York Paul Staff Member Moderator

    Messages:
    5,816
    Likes Received:
    6,870
    Joined:
    Aug 20, 2017
    Hi Colin, congrats on POTW with a nice level crossing which is very impressive.:tophat::tophat::thumbup:
     

Share This Page