Menu

drv8825hw203 - rotation direction and rotation issue

2021-08-31
2021-09-06
  • Alistair samson

    Alistair samson - 2021-08-31

    hi,
    I got the M-MT-F-BT DRV8825-HW203 PCB printed from JLPCB, and assembled it.
    i'm having two issues.
    with the pushbuttons, the motor turns only clockwise.
    i've checked continuity to D3 from the DIR pin of the DRV8825 board, that's fine. soldered it again anyway.
    no change.
    I also noticed that one button does not get it to turn, i have to press the other button, and then this one. it then turns for around the same duration as the other one and then stops. its like a counter is incrementing and decrementing, which is odd.
    the video below shows that. if I press the black button without pressing the red, it doesn't turn. if I press the red, then the black, it turns for roughly the same duration. it also shows the steppers pulsing rotation.

    https://youtube.com/shorts/EuOBP9Z0Uns?feature=share

    i've turned down the pot on the 8825 board all the way down, tried increasing it, just gets worse.

    i'm using the "Nema 17 Stepper Bipolar L=33mm w/ Gear Ratio 27:1 Small Planetary Gearbox" from omc-stepperonline.
    used the firmware myFP2_DRV8825HW203_312

    I could not find the diode HER208, so used a substitute. could that have anything to do with the movement?
    not sure what else I need to check.
    I don't have an osc scope, but have a multimeter.

    Also noticed the pinout for the drv8825 board is slightly different with the motor output pins. pic attached shows the new one

    Thanks
    Alistair

     

    Last edit: Alistair samson 2021-08-31
  • brownrb

    brownrb - 2021-09-01

    Hi
    Before getting to the moving issue
    - those buttons are basically useless (imho) - there is so much contact bounce and not making contact when pressed - pdf rates these as not use. Instead pdf recommends the 12mm waterproof ones not because they look nice, but because they work so much better.

    I personally wish I had never included the push buttons because of the headaches they give.
    And speed of the motor is gonna be very slow when moving because it is geared.

    To test the motor you are better off using the windows app and remove the faulty buttons out of the equation

    Normally, a motor that only goes in one direction ends up being one of two things
    1. Motor delay is wrong
    see https://www.youtube.com/watch?v=d5wK81s87Lg

    1. The wiring is wrong - your multimeter will come in handy
      see https://drive.google.com/drive/folders/1e-MC3jVSdDC397zONZg1E6qWz6-qn4dM?usp=sharing

    Let me know what you find

     
  • Alistair samson

    Alistair samson - 2021-09-01

    hi,
    I tried it with software, and it still only turns in one direction.
    I actually like the pushbutton idea, i have another one with an L293dmini on a moonlite, where my laptop is inside, and I went out to adjust something, and used the buttons to move the drawtube back in, or when I'm setting up before so have found it pretty handy. as for why the black button stops after the same time, its pretty likely the position is back to zero, i saw that with the software.

    Still can't figure out the issue is with the direction.
    I'm using the pcb, it has a track between dir and pin3, i've tested continuity on the dir pin from the top of the driver board to the top of the arduino. no issues there, so that rules out soldering.
    i have tested resistance of the coil pair on the motors, matched that to pin pairs 1a/1b and 2a/2b.

    With the delay, I set it to slow, and with the software, I tested from the default delay of 12000 to 8000. movement is still very rough.

    thanks

     
  • brownrb

    brownrb - 2021-09-03

    The voltage on the DIR pin of the 8255 driver chip determines the direction.
    I would test the voltage on that pin, first in one direction, then the other direction, using the windows application. If the voltage stays the same requardless of direction of move - there is a short somewhere on your board.

    I would put a magnifying glass on the underside of the pcb with a brigh light to make sure there is no shorting of the DIR pin to any other pin, as well as the digital pins d2, d3, d4

    In all likelyhood there is a short.

     
  • Alistair samson

    Alistair samson - 2021-09-05

    hi,
    I checked the voltage on the DIR pin of the 8825 board, it goes to 5v when I move in one dir, goes to 0 in the other direction. still rotates only in one direction.
    just to confirm, does each coil pair go to 1a/1b, and 2a/2b of the 8825 board respectively?
    I'll keep checking.
    Thanks

     
  • brownrb

    brownrb - 2021-09-06

    H Alistair

    Ok
    Nema 17 Stepper Bipolar L=33mm w/ Gear Ratio 27:1 Small Planetary Gearbox
    Is therea reason why a PG27 motor? The speed will be very very slow due to the gearing, I explain this below. Another cause of motor missing steps etc is also delay time. If too low it becomes very erratic.

    Yes, the stepper motor wires get connected to the 1A/1B and 2A/2B pins.

    WITH POWER OFF

    With the stepper motor disconnected,
    Verify Pin1A DRV8825
    1: connect to Pin1A and measure the resistance to the RS232 panel mount socket. It should be connected to pin 1 of thr rs232 socket (and measure as low resistance.

    2: Next leave the Pin1A probe connected and measure the resistance to Pin1B pin of DRV9925. It should be high resistance. Then Pin2A and then Pin2B. There should be high resistance. If there is a low on the on any of these you have a short on the PCB

    Verify Pin1B DRV8825
    3: Connect to Pin1B and measure the resistance to the RS232 panel mount socket. It should be connected to pin 2 of the rs232 socket (and measure as low resistance.)

    4: Next leave the Pin1B probe connected and measure the resistance to Pin1A pin of DRV9925. It should be high resistance. Then Pin2A and then Pin2B. There should be high resistance. If there is a low on the on any of these you have a short on the PCB

    Verify Pin2A DRV8825
    5: Connect to Pin1B and measure the resistance to the RS232 panel mount socket. It should be connected to pin 3 of the rs232 socket (and measure as low resistance.)

    6: Next leave the Pin2A probe connected and measure the resistance to Pin1A pin of DRV9925. It should be high resistance. Then Pin1B and then Pin2B. There should be high resistance. If there is a low on the on any of these you have a short on the PCB

    Verify Pin2B DRV8825
    7: Connect to Pin2B and measure the resistance to the RS232 panel mount socket. It should be connected to pin 4 of the rs232 socket (and measure as low resistance.)

    8: Next leave the Pin2B probe connected and measure the resistance to Pin1A pin of DRV9925. It should be high resistance. Then Pin1Band then Pin2A. There should be high resistance. If there is a low on the on any of these you have a short on the PCB

    If you have a multimeter, set it to low resistance, and measure two wires - looking for a low resistance value between two wires. When you find them that is one pair of the wires.
    There should be low resistance between black and green, and low resistance between red and blue.

    If that is the case,
    Black wires to RS232 plug pin 2
    Green wires to RS232 plug pin 1
    Blue wires to RS232 plug pin 3
    Red wires to RS232 plug pin 4

    Then use a multi-meter to make sure, working with just the stepper motor and its rs232 pin connector, you will measure
    On rs232 plug pin1
    You will measure low resistance to pin2 (27 ohms)
    Pins 2 and 4 will be high resistance

    On rs232 plug pin2
    You will measure low resistance to pin1 (27 ohms)
    Pins 2 and 4 will be high resistance

    On rs232 plug pin3
    You will measure low resistance to pin4 (27 ohms)
    Pins 1 and 2 will be high resistance

    On rs232 plug pin4
    You will measure low resistance to pin3 (27 ohms)
    Pins 1 and 2 will be high resistance

    If at any time you get a reading that is not exoected to need to stop and fix the issue(wire soldered to wrong pin, connector loose, short on underside of PCB etc) before proceeding to the next step.

    With that done, load the test program (in the tests folder when the formware zip file is extracted)
    DRV8825HW203_Test
    Because your stepper is a very high geared motor - change these lines
    for ( int lp = 0; lp < 200; lp++ )
    to this
    for ( int lp = 0; lp < 5370; lp++ )

    because the stepper motot has 5370 steps per 360 (one full turn)
    Now - with Nano reprogramed with DRV8825HW203_Test
    Connect 12V so the motor can move.
    And please do not expect the motor running at 60rpm, it may take at least a minute or move to move one rotation.

    The NEMA connects to a gearbox. The output of the gearbox is the shaft you see.
    So for every 5370 steps the motor takes, the output shaft moves 1 revolution.
    Put another way, every pulse of the motor moves the output shaft 0.067 degrees

    Now a NEMA has a limit on how fast it can be pulsed.
    Please bear with me on this.
    Lets say we can pulse a standard NEMA at around 50 steps per second.
    So if we did that, pulsing the NEMA motor at 50 steps for second.

    If we wanted one full revolution of the output shat would require 5370 steps,
    so 5370 steps / 50 = is about 107 seconds, 1m 47s to do one full revolution of the output shaft.

    The number of pulses we can generate is based on the motor speed delay time associated with that speed.
    So the ball park number is around 1m 47s to do a full revolution of the output shaft (at full steps)

    And no, trying to step the NEMA faster quickly (by reducing the motor speed delay) reaches a place where the NEMA stops stepping.

    And using stepmode of 1/2, 1/4. 1/8 only makes matters much much worse. This is why I recommend to full step a NEMA PG27

    So if everything got to this point -

    I would not expect great results: There are two more steps that follow this which are

    Adjust DRV9925 voltage via the little pot like in the video

    Adjust the motor speed (please note decreasing the value tries to send more pulses per second)
    So with a geared motor a delay value of around 8000 for fast speed is required.
    motor delays for medium and slow speeds are higher. The highest motor speed value is around 15000. So ifthe motor was stepping ok on a fast delay speed of 9000, I would probably set the medium speed delay value to 12000 and the low speed to 15000.

    You are barely going to notice the motor moving on slow speed.

    let me know how it goes

    Cheers
    Robert

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.