Arduino Rotary Table for Dummies

Discussion in 'Machine Modifications' started by bmac2, Apr 24, 2017.

Help Support HMEM by donating:

  1. Apr 27, 2019 #321

    kquiggle

    kquiggle

    kquiggle

    Well-Known Member

    Joined:
    May 29, 2012
    Messages:
    358
    Likes Received:
    107
    Noitoen - It's certainly possible to add a stop function from a programming point of view, but there are two problems with this.

    The first problem is that the AccelStepper.h function which works best with stepper motors is a "blocking" function - there is no option to insert code to check for a stop button.

    The second problem is that while there are other AccelStepper.h non-blocking functions which can be used in a while loop, inserting a check for a button press into the loop introduces a delay which adversely affects stepper motor function. This is especially true if checking for a keypad press because a keypad scan takes a long time (in computer terms). This option is implemented for the continuous run mode, but it results in greatly reduced maximum motor speed.

    It may be that using an interrupt would resolve this issue, but I have not had time to try this yet.

    Finally, I suppose the main reason I did not implement a stop function for index mode is that I did not really see a need for it. This may be because my main use for the indexer is to cut gear teeth, so the index moves are relatively small and are generally completed before I would have time to hit a stop button anyway. IS there a need for a stop button in index mode that I am not seeing?
     
  2. Apr 28, 2019 #322

    SailplaneDriver

    SailplaneDriver

    SailplaneDriver

    Well-Known Member

    Joined:
    Nov 27, 2017
    Messages:
    75
    Likes Received:
    15
    Gender:
    Male
    Occupation:
    Retired Electrical Engineer
    Location:
    Woodinville, WA
    I am implementing a separate emergency stop that will be wired directly into the stepper controller. In my case, the rotating table has a 90:1 gear ratio. It can take quite a while until the stepper stops depending on the number of divisions or angle input which is why I was asking for a stop button, preferably one of the keypad buttons. The intent would be to halt the current operation and go back to some prior menu level. When I was testing the unit for positional accuracy I found it easier to power down and reset the unit rather than wait for it to make 90 revoutions when I had input incorrect data and asked for 360 degrees. That is why I brought up the issue. It certainly is not a necessity and definitely should not be used for an emergency stop. E-stop should always be performed at as close a point to the driven load as practical.

    Thanks again for posting such a useful program.
     
  3. Apr 28, 2019 #323

    kquiggle

    kquiggle

    kquiggle

    Well-Known Member

    Joined:
    May 29, 2012
    Messages:
    358
    Likes Received:
    107
    SailplaneDriver - thanks for the clarification. You said that you are wiring an emergency stop into the stepper controller - what is the benefit of this as opposed to just using a power off switch?
     
  4. Apr 28, 2019 #324

    SailplaneDriver

    SailplaneDriver

    SailplaneDriver

    Well-Known Member

    Joined:
    Nov 27, 2017
    Messages:
    75
    Likes Received:
    15
    Gender:
    Male
    Occupation:
    Retired Electrical Engineer
    Location:
    Woodinville, WA
    I plan on shutting off the stepper controller directly either by killing its power or logic input; the logic input is easier on the contacts. A general power shutoff can work depending upon where you do it. If at the input to the power supply you still have stored energy in the capacitors which will allow continued operation for some period. Contacts have to be suitably rated and any DC "kickback" has to be addressed.
     
  5. Apr 28, 2019 #325

    weir-smith

    weir-smith

    weir-smith

    Bruce W-S Project of the Month Winner

    Joined:
    Jan 30, 2015
    Messages:
    42
    Likes Received:
    37
    Occupation:
    Retired
    Location:
    Perth Western Australia
    If you require an emergency stop, then purchase a miniature emergency stop button and wire it between +5 volts and the other side to the +enable (EN) connection on the stepper controler board. The -EN needs to be commoned up with the -ELK and -DIR.

    When operated, the stepper stops instantly and will restart once the stop button is released.

    Bruce W-S
     
  6. Apr 28, 2019 #326

    strannik2

    strannik2

    strannik2

    New Member

    Joined:
    Dec 19, 2018
    Messages:
    3
    Likes Received:
    1
    Gender:
    Male
    Location:
    UA
    Добрый день!
    Нарисуйте пожалуйста полную схему подключения всех компонентов по версии (Arduino_Rotary_Table_Control_2019_V2-Rev4.69B.ino) и можно ли подключить Microstep Driver 8060 + Nema 34 8.6 Nm
    (
    Good day!
    Please draw the complete wiring diagram of all components at version (Arduino_Rotary_Table_Control_2019_v2-Rev4.69B.ino) and can I connect 8060 Microstep Driver + Nema 34 8,6 Nm)
     
    Last edited: Apr 28, 2019
  7. Apr 28, 2019 #327

    animal12

    animal12

    animal12

    Member

    Joined:
    Feb 27, 2018
    Messages:
    9
    Likes Received:
    0
    my stepper motor is a 8 wire , will i work with this ?
    tks
    animal
     
  8. Apr 29, 2019 #328

    weir-smith

    weir-smith

    weir-smith

    Bruce W-S Project of the Month Winner

    Joined:
    Jan 30, 2015
    Messages:
    42
    Likes Received:
    37
    Occupation:
    Retired
    Location:
    Perth Western Australia
    To Strannik2 and Animal12

    The connection of an emergency stop is very simple and can be tried easily by simply connecting the -EN to either
    - Clk or - Dir. Connect a wire to +5 volts then initiate the rotary table and while the stepper is moving, touch the five volts to the + EN and the stepper will instantly stop and remain stop until the +5 volts is removed.

    The enable control, is a logical gate that controls the clock and direction signals into the controler circuit.

    The input signals to the stepper controller are independent of the output circuit that drives the stepper. Therefore, it doesn't matter if the controller is 4 wire, 6 wire or 8 wire.

    I can post a diagram of how its wired tomorrow if required. The purpose of the emergency stop is to stop movement of the rotary table instantly because something seriously wrong has happened.

    This happened to me about two weeks ago when machining the little end of a connecting rod, the tool started to extract itself from the collect. I had only tightened it by hand when I was interrupted, then when I went back to what I was doing proceeded without further tightening.

    BruceWS
     
  9. Apr 29, 2019 #329

    kquiggle

    kquiggle

    kquiggle

    Well-Known Member

    Joined:
    May 29, 2012
    Messages:
    358
    Likes Received:
    107
    BruceWS - Am I correct in thinking that the while the emergency stop will stop the stepper motor from moving, the Arduino will continue to run it's program with the result that when the motor comes back on the Arduino will no longer "know" the correct table position?
     
  10. Apr 29, 2019 #330

    SailplaneDriver

    SailplaneDriver

    SailplaneDriver

    Well-Known Member

    Joined:
    Nov 27, 2017
    Messages:
    75
    Likes Received:
    15
    Gender:
    Male
    Occupation:
    Retired Electrical Engineer
    Location:
    Woodinville, WA
    Sounds like you had the issue I was concerned about. I've got a mushroom head E-stop switch in hand. I'll locate it nest to the stepper motor for easy and quick access. Thanks for confirming the controller board pins, saves me looking them up.
     
  11. Apr 29, 2019 #331

    SailplaneDriver

    SailplaneDriver

    SailplaneDriver

    Well-Known Member

    Joined:
    Nov 27, 2017
    Messages:
    75
    Likes Received:
    15
    Gender:
    Male
    Occupation:
    Retired Electrical Engineer
    Location:
    Woodinville, WA
    strannik2, go back to the beginning of this thread. There are complete instructions including pictures with wiring shown and materials list.
     
  12. Apr 29, 2019 #332

    Dusty3v0

    Dusty3v0

    Dusty3v0

    New Member

    Joined:
    May 6, 2018
    Messages:
    1
    Likes Received:
    0
    I have not read this thread of looked at the code. Having said that: One should have 2 stop buttons. A true emergency stop with cuts the power and a switch connected to an arduino input which will cause the code to enter a loop waiting for the switch to be reset. This 'should' not be difficult to code. And perhaps it already exists.
     
  13. Apr 29, 2019 #333

    strannik2

    strannik2

    strannik2

    New Member

    Joined:
    Dec 19, 2018
    Messages:
    3
    Likes Received:
    1
    Gender:
    Male
    Location:
    UA
    [QUOTE = "weir-smith, post: 323695, member: 20776"] Страннику2 и Животному12

    Подключение аварийного останова очень просто, и его можно легко проверить, просто подключив -EN к
    - Clk или - Dir. Подсоедините провод к +5 Вольт, затем запустите поворотный стол и, пока движущийся шагер, коснитесь пяти вольт до + EN, и шаговый двигатель мгновенно остановится и останется остановленным, пока не будет удалено +5 Вольт.

    Элемент управления разрешением - это логический элемент, который управляет тактовыми сигналами и сигналами направления в цепи контроллера.

    Входные сигналы в контроллер шагового двигателя не зависят от выходной цепи, которая управляет шаговым двигателем. Следовательно, не имеет значения, является ли контроллер 4-проводным, 6-проводным или 8-проводным.

    Я могу опубликовать диаграмму того, как это будет проводиться завтра, если потребуется. Целью аварийной остановки является немедленное прекращение движения поворотного стола, потому что произошло что-то серьезное.

    Это случилось со мной около двух недель назад, когда обрабатывая маленький конец шатуна, инструмент начал извлекать себя из коллектора. Я затягивал его только рукой, когда меня прерывали, а затем, когда я вернулся к тому, что делал, продолжал без дальнейшего затягивания.

    BruceWS [/ QUOTE]
    Спасибо!
    Скажите пожалуйста,а по такой схеме подключения драйвер будет работать? (
    Thank you!
    Tell please,and according to such scheme of connection the driver will work?)
     

    Attached Files:

  14. Apr 30, 2019 #334

    weir-smith

    weir-smith

    weir-smith

    Bruce W-S Project of the Month Winner

    Joined:
    Jan 30, 2015
    Messages:
    42
    Likes Received:
    37
    Occupation:
    Retired
    Location:
    Perth Western Australia
    I have attached the wiring diagram for fitting a Stop Switch for anyone who is interested. Further, I have had a discussion with a friend where it was pointed out that such a switch was not an Emergency Stop (poor use of words) rather it is a stop switch to which I concur.
    To answer a previous question, yes the program continues to run to complete the step. Therefore, you would need to start the machining from the last position. To holt the program as such, you would need to implement an interrupt which has been previously described. To my mind, the only time you would need to stop the machining process is when something has gone wrong and the most common thing is that the work piece has moved as a result of the cutting pressure or similar. This is particularly common when machining an odd shaped casting which is difficult to hold. If the job has moved, your back to resetting it up if it is practicable and starting again. I cut a keyway in the gear blank when cutting gears so that I always have a reliable reference.
    The only benefit of a stop switch, is that it is quick to operate rather than use the keypad to enter the required command. Just my thoughts.

    Bruce W-S
     

    Attached Files:

    Imre karoly likes this.
  15. Apr 30, 2019 #335

    strannik2

    strannik2

    strannik2

    New Member

    Joined:
    Dec 19, 2018
    Messages:
    3
    Likes Received:
    1
    Gender:
    Male
    Location:
    UA
    Спасибо!
    Как с совместимостью драйверов?
    (
    Thank you!
    How about driver compatibility?
    )
     

    Attached Files:

    • O.jpg
      O.jpg
      File size:
      62.6 KB
      Views:
      392
    Imre karoly likes this.
  16. Apr 30, 2019 #336

    weir-smith

    weir-smith

    weir-smith

    Bruce W-S Project of the Month Winner

    Joined:
    Jan 30, 2015
    Messages:
    42
    Likes Received:
    37
    Occupation:
    Retired
    Location:
    Perth Western Australia
    All stepper drivers in terms of their digital input connections, are the same eg En, Cl and Dir. The microstep range can vary as can the output connections eg 4 wire, 6 wire and 8 wire.

    Bruce
     
    Imre karoly likes this.
  17. Jun 3, 2019 #337

    lmeb83

    lmeb83

    lmeb83

    New Member

    Joined:
    Jun 3, 2019
    Messages:
    3
    Likes Received:
    0
    Gender:
    Male
    Location:
    US
     
  18. Jun 3, 2019 #338

    lmeb83

    lmeb83

    lmeb83

    New Member

    Joined:
    Jun 3, 2019
    Messages:
    3
    Likes Received:
    0
    Gender:
    Male
    Location:
    US
    Bruce,
    I am using an HBS860H Hybrid servo drive and I am having issues with the rotation of the stepper. It rotates to the same direction. I am pretty sure I am not wiring it correctly.
    I have tried different connections but haven't been successful.
    This is the code I am using.
    Thank you,
    Miguel
     

    Attached Files:

  19. Jun 4, 2019 #339

    DzhusUA

    DzhusUA

    DzhusUA

    New Member

    Joined:
    Jun 4, 2019
    Messages:
    1
    Likes Received:
    0
    Gender:
    Male
    Location:
    KYIV, UKRAINE
    Hi friends! I am new in this forum!
    One Ukrainian gay makes version 2 of this module:
    01.4_.jpg.cdb39fc9192ed2f8cc546ceddc8eefb0.jpg 000.jpg.054264cc56a4e66c61faca96b0c921e2.jpg 02.jpg.21bd2ee1a07d80a645fe688802bce9e4.jpg
    Make a video and ready to noncommercial seel them on world way!
    I hope you describe to channel and liked his video:
    Best Regards!
     
  20. Jun 5, 2019 #340

    weir-smith

    weir-smith

    weir-smith

    Bruce W-S Project of the Month Winner

    Joined:
    Jan 30, 2015
    Messages:
    42
    Likes Received:
    37
    Occupation:
    Retired
    Location:
    Perth Western Australia
    Miguel

    I have had a look at what you are doing and one of us is confused however please note the following:-

    The code you are using includes the use of the Arduino Nano so I will assume this is so. The output pins that have been declared in the Sketch pgm are digital outputs 12 for Step (Pul) and 13 for Direction (Dir) and you also need a ground connection to the Nano.

    Your controller is the HBS860H which used Pul for Step (e.g. the pulses that drive the stepper) and Dir for direction. If you look up the connections in the manual for PNP sourcing control and have some basic understanding of electronics, you will see that the interface on the HBS Driver are optical coupled. That is, current will only flow one way so reversing the connections has no effect except that nothing will happen.

    The Pul or step is a series of pulses which the Nano counts. Each pulse drives the stepper forward (or reverse depending on the state of Dir signal ). Each step is equivalent to a micro step.

    The Dir signal (pin 13 on the Nano) will be either + 5 volts (approx) or 0 volts. This signal simply instructs the controller as to the direction of the stepper motor. It simply phase shifts the stepper outputs that causes the stepper motor to reverse direction.

    So to get your stepper wired correctly, do the following:-

    1. Connect pin 12 (Step) of the Nano to PUL + on the Driver.

    2. Connect pin 13 (Dir) of the Nano to DIR + on the Driver.

    3. Connect ground of the Nano to PUL -, Dir - on the Driver e.g. just loop between - Dir and - PUL and then back to the ground on the Nano. Note, there is only (I think) one ground connection on the Nano which you also need for the display, so you may need to join this wire.

    So providing the Sketch works, your system should now work.

    Bruce W-S
     

Share This Page