New Machine Build CNC Indexer (Arduino based)

Page 1 of 3 123 LastLast
Results 1 to 20 of 53

Thread: CNC Indexer (Arduino based)

  1. #1
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default CNC Indexer (Arduino based)



  2. #2
    Member
    Join Date
    Aug 2005
    Location
    United States
    Posts
    158
    Downloads
    0
    Uploads
    0

    Default

    Looks great.

    Will the details of the hardware and software be available or is this a proprietary item?



  3. #3
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default

    Hi arvidj,

    Thank you.
    Details to come (hardware and software). I'm working on the diagram, and pictures.

    Wagner



  4. #4
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default

    Diagram:

    Diagram.jpg

    Wagner

    Last edited by WmCnc; 07-01-2013 at 01:49 PM.


  5. #5
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    52
    Downloads
    0
    Uploads
    0

    Default

    Looking really good and looking forward to the source sketch.



  6. #6
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default

    A little bit about the mechanics:

    4thAxis 012 Data.JPG

    Tank you lakeside53. The code is at home. Please wait til tomorrow

    Wagner



  7. #7
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default

    Here is the software:

    Indexer.zip

    \Indexer\Indexer.ino.........The main code
    \Libraries\Wlcd................Modified version of LCD4Bit
    \Libraries\Wstepper..........My striped down version of AccelStepper

    Wlcd is a modified version of LCD4Bit; includes code for activating cursor, create custom characters and digital read keys.

    Wstepper is a rewrite, stripped down version of AccelStepper. Contains the minimum to control the stepper motor with acceleration and deceleration.

    My thanks to the people who created the original libraries.

    Wagner

    Attached Files Attached Files


  8. #8
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default

    First thing when running the code, you must set the configuration.

    Steps/Rev: 200.........Stepper motor, number of steps per revolution
    MicroStep: 8............Stepper controller, number of micro steps
    Reductn: 72.............Total gear train reduction
    MxVl(°/M): 1200........Maximum velocity in degrees per minute
    Acc(°/s²): 20...........Acceleration in degrees per second per second
    Bcklsh(°): 0..............Backlash compensation in degrees

    Wagner



  9. #9
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default

    Screens:

    Screens.jpg

    Wagner



  10. #10
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    52
    Downloads
    0
    Uploads
    0

    Default

    Thanks. I'll try to build it in the next couple of days. It looks straight forward but it always does when someone else does all the hard work!

    Are you using WINAVR? What version?



  11. #11
    Member
    Join Date
    Aug 2005
    Location
    United States
    Posts
    158
    Downloads
    0
    Uploads
    0

    Default

    Thanks very much for the code and the hardware layout.

    A quick look at the code suggests it is well done and well commented.

    I have a Nano and an LCD lying around and will give it a try. I don't have a Stepper Driver handy but can at least put the LCD and keypad thru its paces.



  12. #12
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default

    Thank you arvidj and lakeside53 for your comments

    [IMG][/IMG]

    More pictures:
    Cnc Index - Control Photos by WmCnc | Photobucket
    CNC Indexer - Mechanics Photos by WmCnc | Photobucket

    Don't forget in the first run to go thru the config screens. Use the left/right keys to select digit and the up/down to increase/decrease values.

    lakeside53 - No I don't use WINAVR.

    Wagner



  13. #13
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    52
    Downloads
    0
    Uploads
    0

    Default

    In case I have problems, what compiler/make or other system do you use?



  14. #14
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    52
    Downloads
    0
    Uploads
    0

    Default

    A suggestion : there are some of us that will piece this together, but many more that would be intimidated by anything to do with compiling C etc.. If you could upload the hex file, it may help.



  15. #15
    Member
    Join Date
    Aug 2005
    Location
    United States
    Posts
    158
    Downloads
    0
    Uploads
    0

    Default

    lakeside53,

    You may want to take a look here ... Arduino - HomePage ... to see what the arduino is all about and the tools that are available for it. I think you will find that there is no need for a hex file. You need know nothing about C to paste the supplied code into the IDE, select verify\ compile from the menu, then upload from another menu.

    Of course this assumes you actually have an arduino attached via USB to your PC, but there was an implied PC-to-micro controller programming environment in the hex file availability question.

    I guess I lied about how easy it would be to get it to work. You will also need to read the "How to install a library" part of the arduino IDE instructions, but that should only add 10 minutes to the learning curve an is something you'd need if you choose to do any additional arduino programming.

    But there is no programming necessary as all of the code was in the zip file so it really is just cut-n-paste or open files.



  16. #16
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    52
    Downloads
    0
    Uploads
    0

    Default

    Thanks.

    I've been using the Ardunio UNO for a while. I'm currently running grbl on a system similar to what was just posted, but for an entirely different use (using a rotary "table" while controlling DSLR to automatically take high quality 360 degree photos of tiny objects). Grbl is supplied via github as source, and hex for those that don't want to build it.

    My concern was for a handful of other overs on HSM There has been a few threads over there - and a hex file would really simplify it for some (and others of course want the sketch!). Some guys just want to use the end product, and have no interest or aptitude for the journey.

    BTW.. after a couple of minor hiccups with the libraries loaded twice (my fat fingers combined with misleading error messages!) and the IDE hanging (weird), it built fine under 1.0.5. I can't test it yet though as my lcd is still on the way.

    Last edited by lakeside53; 07-03-2013 at 01:40 AM.


  17. #17
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default

    Good morning to all,

    For this project I've only used the Arduino environment.
    The folder "Indexer" must be copied to your sketch folder and the lib folders "Wlcd and Wstepper" to your sketch\libraries folder.
    After that, just use the Verify or, if you have the Uno connected, the Upload buttons.

    In my instalation:

    \Arduino
    ........\Wagner
    ..............\Indexer
    .................Indexer.ino
    ..............\libraries
    ..................\Wlcd
    ......................Wlcd.h
    ......................Wlcd.cpp
    ..................\Wstepper
    ......................Wstepper.h
    ......................Wstepper.cpp

    Anyway, this morning I've figured out where to find the generated hex file, and here it is:

    Attached Files Attached Files


  18. #18
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    52
    Downloads
    0
    Uploads
    0

    Default

    Finally.. I just received the lcd sheild. No motor connected yet but that will happen tomorrow. I set the configuration to suit my system.

    The code built fine (with Arduino 1.0.5) , but I seem to have a problems with both Jog and Continuous modes.

    In Jog the up/down keys do not adjust the Jog degrees; the left/right seem attempt operation, but of course it was at zero jog so no increment of displays.

    In Continuous the left or right keys start operation, but there is no way to stop other than pressing the reset switch on the lcd shield.

    I did see on the schematic that you use D11/D12 for Continuous mode. Is there anything I need to do on the lcd to enable these for the Duo?

    Before I dig into the sketch, can you please verify the code you uploaded is what you intended? And.. have I missed something in operation?


    BTW... one small modification I'll need to make - the reduction gear parameter expects an integer... before any pulley or other gearing, mine is 1: 26.8512 due to the planetary gearbox.

    Last edited by lakeside53; 07-12-2013 at 02:36 AM.


  19. #19
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    52
    Downloads
    0
    Uploads
    0

    Default

    OK.. an update. I uploaded the hex file you posted and JOG started working fine because of the default value of 000.001, but Continuous mode still can't be interrupted except with a hard reset.

    BUT there is a bug with JOG that may have been the root cause of my initial report of Jog not working. - step down the jog increment below 000.001 (i.e. 000.000) it will not wrap to 100.000 and you can not step it back up again from zero.. Once at 000.000 jog appears not to work. Easy fix.

    in f41()

    case KDW:
    Cnf.dJog/=10;
    if(Cnf.dJog<=0) // was originally if(Cnf.dJog<0)
    Cnf.dJog=100000;

    A suggestion.. add a version number to your initial display to help discussion and bug tracking.

    Last edited by lakeside53; 07-12-2013 at 10:55 AM.


  20. #20
    Registered WmCnc's Avatar
    Join Date
    Jun 2013
    Posts
    24
    Downloads
    0
    Uploads
    0

    Default

    Hi lakeside53,

    Yes, you have found a bug. The code should be (Cnf.dJog<=0); thank you.

    The Continuous mode needs the digital inputs D11 and D12 connected (hardwired) on the keypad. See the diagram on post #4 and the picture:



    The Gray and Orange wires connects the keys to digital inputs.

    And the reason is that during continuous mode, the code must check if the key is still pressed, and at the same time generate pulses for the motor at maximum speed. The original way to read the keys on the LCD is analogRead() on pin A0 (all the keys are connected here, via divider resistors); But analogRead is very slow; if used in this case, the motor would not reach max speed.

    So I've decided to connect the left and right keys to digital inputs and use digitalRead() on continuous mode. digitalRead is almost instantaneous.

    If you don't want to connect the wires on your shield, change the line of code #1188 as follows:


    if(mod<3)
    while(stp.Run());
    else
    {
    while(lcd.getkey()) // was while(lcd.digkey())
    stp.Run();
    stp.Stop();
    while(stp.Run());
    }
    stpgon=stp.Gone();


    I will think about the issue of the reduction rate, and get back to you later.


    Wagner



Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

CNC Indexer (Arduino based)

CNC Indexer (Arduino based)