DIY arduino circuit boards optimized for electronic indexing head

Discussion in 'Software and Programming' started by TorontoBuilder, Jan 20, 2015.

Help Support HMEM by donating:

  1. Mar 13, 2015 #81

    TorontoBuilder

    TorontoBuilder

    TorontoBuilder

    John

    Joined:
    Jan 4, 2013
    Messages:
    357
    Likes Received:
    82
    I got all my PCB boards delivered...
    .
    I'm thrilled with the results with the minor exception that I forgot to re-size the stepper driver headers when I selected cheaper chinese driver instead of the pololu one.

    Not a big problem, I'll just use the more expensive pololu driver on those boards.

    I've made 5volt switching power supply boards, current sensing boards, op amp boards to expand the current sensing scale, keypad board boards and the main arduino boards.

    I also had foam cutter circuit board made up too, so I can make foam patterns for lost foam casting.

    Tomorrow I'll start soldering everything together.

    photo (5).jpg

    photo (6).jpg

    photo (7).jpg

    photo (8).jpg

    photo (9).jpg

    photo (10).jpg
     
    Scott_M likes this.
  2. Mar 13, 2015 #82

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    Looking great! I wanna see it dividing ...
     
  3. Mar 14, 2015 #83

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    TorontoBuilder

    Just an idea for you seeing you have to adjust your board layout design. What about including a header that presented the signals for 2 more Stepper drivers?

    Then design a daughterboard for the additional stepper drivers to mount to.

    The reason I suggest this is that the way my software has turned out, it supports multiple devices (both rotary and linear) and defines separate step and direction pins for each device. There are opportunties to control different devices from the same controller.

    This idea would preserve your compact footprint yet allow people to wire in a power feed linear drive or other device if they wanted to.

    Or use it as the basis for a GRBL CNC controller...... maybe.
     
    TorontoBuilder likes this.
  4. Mar 14, 2015 #84

    TorontoBuilder

    TorontoBuilder

    TorontoBuilder

    John

    Joined:
    Jan 4, 2013
    Messages:
    357
    Likes Received:
    82
    They will be done...
     
    rodw likes this.
  5. Mar 16, 2015 #85

    Scott_M

    Scott_M

    Scott_M

    Well-Known Member

    Joined:
    Apr 13, 2013
    Messages:
    251
    Likes Received:
    76
    Location:
    Medina, Ohio USA
    Wow TB

    They look great !

    Keep us posted.

    Scott
     
  6. Mar 16, 2015 #86

    TorontoBuilder

    TorontoBuilder

    TorontoBuilder

    John

    Joined:
    Jan 4, 2013
    Messages:
    357
    Likes Received:
    82
    Hi Rod,

    I'm working on re-configuring the main board to accept more stepper boards (each via its own header and larger carrier board)

    I've laid out a stepper carrier board with screw terminals for the motor VIN & GND as well as a screw terminal for the 2B, 2A and 1B, 1A output. I've also added an onboard 100uF capacitor.

    Now its decision time, since we need to overcome some design issues, pin limitations etc, as well as consider whats already available on the market.

    There are several cnc shields that allow use of 3 or 4 stepper drivers and GRBL language. They range from cheap 3 motor versions with plugin Nano and a single motor capacitor to 4 motor versions with individual caps for each stepper driver and fully optimized for cnc use.

    I can arrange the board to be low profile & compact with 2 stepper drivers, Or I can layout the main board to accept stepper daughter boards oriented vertically, with the compromise of adding 1.25" to the height, but can accommodate 3 or maybe even 4 stepper boards.

    The additional steppers will each require 2 more digital pins... will we have enough if using standard LDC connections?

    Reviewing the pin utilization this is what I think your sketch uses, please correct me if I am wrong:

    LCD using digital pins 4, 5, 6, 7,8, 9,

    I cant recall what you did with DIR & STEP since I recall that you had conflicts with Freetronics using D3 for PWM control of the backlight on the lcd shield. You're using D2 and ??

    A0 for keypad

    I think we can at least easily add another stepper motor using pins D11, D12... IIRC one of the two pins needs to be PWM and D11 meets that requirement.

    By my reckoning we're out of pins unless use serial LCD display...

    or I may have read somewhere about serial configuration of stepper drivers or the ability to share a common STEP pin. Does that sound familiar?

    If you wanted more than two steppers we need to free up digital pins and I think that serial LCD display is easiest method to achieve that.

    Please people let me know what you think...

    step daughter.png
     
    Last edited: Mar 16, 2015
  7. Mar 16, 2015 #87

    TorontoBuilder

    TorontoBuilder

    TorontoBuilder

    John

    Joined:
    Jan 4, 2013
    Messages:
    357
    Likes Received:
    82
  8. Mar 17, 2015 #88

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    John, you got the pins right and yes, I recently noticed the Freetronics backlight pin can be moved. The reason why they use pin 3 is that it supports PWM so the backlight can be dimmed. On another pin, you loose the dimming capability but my sketch is not dimming the display anyway so it won't matter.

    I'm using pins 1&2 for the stepper which is not ideal as the hardware interrupt pins conflict. These might be needed if you wanted to add a rotary encoder.

    Don't forget you can use the remaining 5 analog pins for digital I/O so you have heaps of pins. It would be good to keep the Freetronics analog display pins free.

    It would be good if the code base had a single #define that selected between a digital or analog display.

    Personally I don't think we need to worry too much about CNC compatibility with other shields. If thats what people want, they'll probably buy a dedicated grbl shield or a TinyG 4 axis. These both replace the Arduino bootloader and you need the Atmel AVRRISP (Which I have) or equivalent to program and you won't need a display. Just keep a PWM pin free for spindle speed and bring all spare pins (including the analog LCD PINS) out to a header for custom displayless applications.

    I got my linear controller version out into the shed last night, some bugs but I'll report on the other thread.
     
  9. Mar 17, 2015 #89

    TorontoBuilder

    TorontoBuilder

    TorontoBuilder

    John

    Joined:
    Jan 4, 2013
    Messages:
    357
    Likes Received:
    82
    So how about a board w/ support for three stepper drivers?

    I'd find it useful to have one rotary controller and two linear controllers that could drive steppers attached to my milling machine table x & Y axis's.

    I wasn't aware that analog pins could be used as digital I/O pins.

    I dont see a digital pin 1 on the nano... I'm attaching a pic with the nano pin outs and a much more detailed pdf

    Since I'm redesigning the board now is the time for changes. For ease of compatibility with your sketch would you tell me what pins two to connect to the traces going to the stepper DIR and STEP connectors for each of 3 stepper drivers? But remember I dont think I have a D1

    View attachment nanopdf.pdf

    2015-03-17_1335.jpg
     
  10. Mar 17, 2015 #90

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    Confusing isn't it?

    Pins 0 and 1 are RXD and TXD as shown in the PDF. These can be used a a serial port but are still able to be used as digital pins.

    Pins 2&3 are wired to the hardware interrupts so maybe they should not be used for a stepper as they probably should be reserved for a rotary encoder if you want to try ykur hand at hobbing.

    The good news is that it does not matter which pins you choose to use for steppers as my software sketch is configurable at the device level. Eg.when adding a new device you specify which pins to use for step and direction and the data is stored in EEPROM. The code could be modified so if it sees an empty EEPROM, it creates 3 devices and set them to your chosen defaults. Currently, it is only creating 1 device When it sees an empty EEPROM.

    Also make sure you present the step and direction pins for each stepper somewhere so you can use external steppers. But I think you will allow for that anyway. Im out of time But will see what grbl uses.
     
    TorontoBuilder likes this.
  11. Mar 17, 2015 #91

    TorontoBuilder

    TorontoBuilder

    TorontoBuilder

    John

    Joined:
    Jan 4, 2013
    Messages:
    357
    Likes Received:
    82
    THX! Rod

    Much clearer...

    Yep I also intended to have male header pins to access every pin if desired. I didnt realize how you were using eeprom very cool.

    Hobbing is on my list of wants so yes I'll keep pins open

    So let me see whats what...
     
    rodw likes this.
  12. Mar 18, 2015 #92

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    John, what pins are you using for your SPI LCD display? I'm wondering if you just don't put a Spi driver chip on your board and then people can add the LCD display to the chip like this?
    http://playground.arduino.cc/Main/LiquidCrystal This hardwires in the backlight.

    That would standardise the display to 10, 11, and 13. Keep 0&1 free for serial port, 2&3 free for an encoder, keep port 9 free for spindle PWM output. and your 3 steppers could be on 4&5, 6&7, and 8&12. Port A0 for keyboard,. The remaining analog ports free for user features. Check that would work first though!
     
  13. Mar 18, 2015 #93

    TorontoBuilder

    TorontoBuilder

    TorontoBuilder

    John

    Joined:
    Jan 4, 2013
    Messages:
    357
    Likes Received:
    82
    I have a bunch of 12C serial adapters that use pins SCL, and SDA leaving all my digital pins avaiulable. These adapters are $1.50 CAD on ebay so I think it's best option since its cheap, fairly well supported and only uses 2 pins.

    !REVISED BELOW!

    I'll now be using the following pairs for the steppers: 6&7, 8&10, 11&12
     
    Last edited: Mar 20, 2015
  14. Mar 18, 2015 #94

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    and the display is on Analog pins A4 & A5?
     
  15. Mar 18, 2015 #95

    TorontoBuilder

    TorontoBuilder

    TorontoBuilder

    John

    Joined:
    Jan 4, 2013
    Messages:
    357
    Likes Received:
    82
    Correct. On the Nano A4 & A5 are serial pin SDA & SCL
     
    rodw likes this.
  16. Mar 19, 2015 #96

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    Ordered a couple of SPI interfaces and LCD displays ex Hong Kong. They'll take 2-3 weeks.

    I thought I'd just clarify that my sketch only supports one device at a time. You have to swap devices (eg. Load another device out of the EEPROM via the menu) to drive a different stepper. That won't really be to much of a drama with a single linear interface as its unlikely you'd want a linear drive and a rotary drive at the one time. Driving X&Y might get a bit annoying.
     
  17. Mar 19, 2015 #97

    TorontoBuilder

    TorontoBuilder

    TorontoBuilder

    John

    Joined:
    Jan 4, 2013
    Messages:
    357
    Likes Received:
    82
    thx for the clarification... one at a time is fine... there remain many uses for such a controller.
     
    rodw likes this.
  18. Mar 19, 2015 #98

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    And of course, you could write your own multi stepper code.....
     
  19. Mar 19, 2015 #99

    TorontoBuilder

    TorontoBuilder

    TorontoBuilder

    John

    Joined:
    Jan 4, 2013
    Messages:
    357
    Likes Received:
    82
    haha touche...

    Once I have one good controller up and running I'll try to do just that. But first I need to get rotary controller into production to make gears for an etching press I have been planning to make for almost a decade...
     
  20. Mar 20, 2015 #100

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    At least you didn't rebuff with a comment about me making my own board! The earlier sketches will be a good framework for other projects.
     

Share This Page