585,581 active members*
3,841 visitors online*
Register for free
Login
Page 1 of 3 123
Results 1 to 20 of 54
  1. #1
    Join Date
    Jun 2013
    Posts
    24

    CNC Indexer (Arduino based)

    Just finished:



    Arduino UNO

    Wagner

  2. #2
    Join Date
    Aug 2005
    Posts
    158
    Looks great.

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

  3. #3
    Join Date
    Jun 2013
    Posts
    24
    Hi arvidj,

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

    Wagner

  4. #4
    Join Date
    Jun 2013
    Posts
    24
    Diagram:

    Attachment 190476

    Wagner

  5. #5
    Join Date
    Jan 2008
    Posts
    52
    Looking really good and looking forward to the source sketch.

  6. #6
    Join Date
    Jun 2013
    Posts
    24
    A little bit about the mechanics:

    Click image for larger version. 

Name:	4thAxis 012 Data.JPG 
Views:	39 
Size:	82.9 KB 
ID:	190496

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

    Wagner

  7. #7
    Join Date
    Jun 2013
    Posts
    24
    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

  8. #8
    Join Date
    Jun 2013
    Posts
    24
    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
    Join Date
    Jun 2013
    Posts
    24
    Screens:

    Click image for larger version. 

Name:	Screens.jpg 
Views:	22 
Size:	84.5 KB 
ID:	190588

    Wagner

  10. #10
    Join Date
    Jan 2008
    Posts
    52
    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
    Join Date
    Aug 2005
    Posts
    158
    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
    Join Date
    Jun 2013
    Posts
    24
    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
    Join Date
    Jan 2008
    Posts
    52
    In case I have problems, what compiler/make or other system do you use?

  14. #14
    Join Date
    Jan 2008
    Posts
    52
    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
    Join Date
    Aug 2005
    Posts
    158
    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
    Join Date
    Jan 2008
    Posts
    52
    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.

  17. #17
    Join Date
    Jun 2013
    Posts
    24
    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:

  18. #18
    Join Date
    Jan 2008
    Posts
    52
    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.

  19. #19
    Join Date
    Jan 2008
    Posts
    52
    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.

  20. #20
    Join Date
    Jun 2013
    Posts
    24
    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

Similar Threads

  1. Arduino Modbus?
    By wbrandsmeier in forum Mach Software (ArtSoft software)
    Replies: 1
    Last Post: 02-01-2014, 07:47 PM
  2. Arduino + tb6560 + cd rom cnc machine help
    By joetemus in forum Community Club House
    Replies: 5
    Last Post: 11-28-2013, 04:56 AM
  3. EMC with Arduino for USB I/O?
    By sansbury in forum LinuxCNC (formerly EMC2)
    Replies: 23
    Last Post: 05-05-2012, 09:27 PM
  4. Interfacing an Arduino-based pendant
    By sansbury in forum Mach Software (ArtSoft software)
    Replies: 4
    Last Post: 12-07-2011, 04:40 PM
  5. Arduino
    By LTP in forum CNC Machine Related Electronics
    Replies: 0
    Last Post: 02-11-2011, 10:26 AM

Posting Permissions

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