Welcome to Our Community

Some features disabled for guests. Register Today.

Has anyone tried the Arduino Nano for control?

Discussion in 'Controller Boards' started by Metalguru, Jul 18, 2016.

  1. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    Anyone? Anyone?

    The reason I'm asking is that I found these on Amazon:

    61r46hxuCZL._AA200_.jpg

    This would be the cat's *** for controller for cnc machines. The Nano seems to use the same processor and has actually a couple more I/O's. This would be a really compact solution.
     
  2. Kyo

    Kyo Veteran
    Staff Member Builder Resident Builder

    Joined:
    Feb 27, 2014
    Messages:
    673
    Likes Received:
    702
    Yes sir, Myself and @Robert Hummel both use the nano in projects for cnc control. I have not used one directly off the pins however usually on some form of board or hat. Here is a photo of the laser board Robert makes and the Protoneer hat I run. The Nano is a excellent Arduino choice for cnc control with grbl.
     

    Attached Files:

    #2 Kyo, Jul 18, 2016
    Last edited: Jul 18, 2016
  3. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    So the programming interface and windows drivers are the same? And GRBL runs fine on them?

    I use Xloader to load GRBl into an Uno with a screw terminal shield, not usually the Arduino interface.

    And, I use external stepper drivers like these to control the motors, I can get up to 3A from them:

    51p+RNNCg2L._SY355_.jpg
    I just use the output pins from the Arduino to drive the inputs to these drivers, which are all optoisolated.
     
  4. Kyo

    Kyo Veteran
    Staff Member Builder Resident Builder

    Joined:
    Feb 27, 2014
    Messages:
    673
    Likes Received:
    702
    Yeah you should be able to use the atmega328p nano the same as you do the uno (not sure about the atmega168 nano's I don't have any of those ) . My windows 7 machine auto installed the correct drviers when I first plugged in my nano.

    Grbl runs great on the nano, No complaints!

    I tend to use the IDE more so then other options. From what I recall of Xloader I believe the nano needs the baud rate set to 57600 vs the 115200 needed for the Uno when you flash the grbl hex file .
     
    #4 Kyo, Jul 18, 2016
    Last edited: Jul 18, 2016
  5. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    Cool. Thanks so much, Kyo.
     
  6. Kyo

    Kyo Veteran
    Staff Member Builder Resident Builder

    Joined:
    Feb 27, 2014
    Messages:
    673
    Likes Received:
    702
    no problem. :thumbsup:
     
  7. RogerBritt

    Builder

    Joined:
    Aug 4, 2016
    Messages:
    1
    Likes Received:
    0
    Hi...as per my experience if the load is not more then you can go for the Nano board. Otherwise it is not recommended.
    As you are saying here about the CNC machines so i ll not prefer the Nano board.

    circuit board assembly house
     
    #7 RogerBritt, Aug 6, 2016
    Last edited: Aug 30, 2016
  8. Christian Knüll

    Builder

    Joined:
    Mar 1, 2014
    Messages:
    27
    Likes Received:
    34
    Hi,

    Nano and UNO are interchangeable - if something works with an Uno it almost always works with a Nano, too.
    GRBL and also the Estlcam machine controller work well with it.

    Only significant differences:
    • The bootloader is different reducing total memory by 1.5kB (usually no issue).
    • And the USB / serial chip is different -> requires a different driver.

    I personally prefer the Nano - it is smaller, the pins use a even, breadboard compatible grid spacing and the clones are dirt cheap (~$5)

    Christian
     
  9. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    hey Kyo, when you use a Nano, are the pins for the limit switches different than with the Uno?

    I'm having a weird problem where the homing doesn't work properly. All the axes and control works properly, but when I do a Home, the z moves up normally, but then whichever of X or Y axis gets to the home switch first stops the homing cycle. It never completes on the last axis. Does not give homing error.

    I am using GRBL 0.9j, and the Uno shows pins 9,10, and 12 for the x,y,z limits, but the diagram for the Nano shows 9,10,11. Which is it?

    MG
     
  10. Kyo

    Kyo Veteran
    Staff Member Builder Resident Builder

    Joined:
    Feb 27, 2014
    Messages:
    673
    Likes Received:
    702
    I don't use limit switches but it is my understanding with grbl 0.9 z-limit and pwm pins have been swapped.

    If PWM is enabled pins would be D12 (Z), D10 (Y), D9 (X) (D11 being used for PWM )
    If PWM is not enabled pins would be D11 (Z), D10 (Y), D9 (X) ( D12 being used for Spindle enable )

    Perhaps a software issue? do you have just homing switches installed? Are hard limits disabled?
     
  11. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    Yes, only homing is enabled, hard limits are disabled. What do you mean if PWM is enabled? I was not aware you could change it. I don't recall seeing any setting for PWM in the GRBL settings window. I thought only GRBL V0.8 and lower used your bottom pinout, V0.9 used the top pinout...

    The machine worked previously with an Uno, now I have tried 2 different Nanos and have the same problem with both. Homing switches are prox sensor types. I am going to go back to the Uno and see if it works again.

    I also noted that the 5V seems pretty low when using the Nano. It's only about 4.6V. Wondering if the LED's on the optoisolators for the stepper drivers are drawing too much current and pulling the supply voltage down. Seems to function correctly, though.

    This is the diagram I found for the Nano:

    [​IMG]

    Note that it shows this pinout even for GRBL V0.9, which has pins 11 and 12 swapped on the Uno... But, it is suspect because it does not show PWM for the spindle pins...

    Thanks Kyo.

    PS: How Can You Live Without Homing?????
     
  12. Kyo

    Kyo Veteran
    Staff Member Builder Resident Builder

    Joined:
    Feb 27, 2014
    Messages:
    673
    Likes Received:
    702
    pmw is enabled by default in GRBL 0.9 the pin out you posted is wrong for the version (v0.9j) you are running. Z limit is on d12 not d11. Not sure why he has it labeled for 0.8 and 0.9 the pin out is correct for 0.8 only.

    Here is the correct nano Pinot for 0.9j
    [​IMG]

    I always return the spindle to machine zero after a job and then jog over to my matirial and set my part zero manually before a job. Don't miss what I never had hahaha.

    I will load GRBL 0.9j on a spare nano and steal some limit switchs from one of my printers after work tonight and do some bench tests.
     
  13. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    Yeah, that's actually the way I had it wired up (0.9j diagram). I just wasn't sure because of the diagram I had showing good for 0.9 versions.

    In any case the Z limit works fine, its only x and y that do not work properly. As far as I can see, the sensors work, the board works, GRBL Panel has full functionality, they just don't work as a team...
     
  14. Northernboy

    Builder

    Joined:
    Feb 8, 2016
    Messages:
    26
    Likes Received:
    15
    For your homing limits switches, add 0.01uF capacitors as close to the Nano input pins. I had some homing issues on my machine and did that and worked awesome after that.
    I've been running a cheap China Nano interfacing a Gecko G540 with no issues.
     
    Anthony Bolgar likes this.
  15. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    Thanks Northernboy, I'll give that a try. What part of the Great White North are you in?

    I did find the issue with low 5V on the Nano, it has a diode between the USB 5v and the board 5v, hence the voltage drop. It was not caused by too much load on the board. I would have to use a separate external 5V to fix this.

    I want to do a "motherboard" for the Nano and incorporate the low pass filters for all the inputs, 12V (for prox limit sensors) and 5V supplies, and connectors for the stepper drivers to cut wiring time. Perhaps a relay for coolant and an output for spindle control SSR as well.

    MG
     
    Anthony Bolgar likes this.
  16. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    Northernboy, That worked like a charm. A 0.1uF cap on each input line fixed the problem completely.

    Thanks, Mang!
     
    Anthony Bolgar likes this.
  17. Northernboy

    Builder

    Joined:
    Feb 8, 2016
    Messages:
    26
    Likes Received:
    15
    Glad that worked for you. Also Metalguru I'm in Northern Ontario.
    I use a SSR for my spindle control, it's simple and works good. For my coolant/lube I have another Arduino Mini that does timed on/off control to a 12v peristaltic pump that injects WD-40 in an air purge that cleans the debris. Keeps the cut clean and lubed and doesn't mist. Works awesome for milling aluminum.
     
  18. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    Cool, I'm in Calgary.

    I just bought one of these aspirator type coolant misters off Ebay. It uses air pressure to suck up lube so you don't need a pump. Any chance you could send me your Arduino schematic and code for the mister controller? Or better yet, post it up on the Forum...
    [​IMG]
    Does the SSR work properly with the PWM output from the Arduino? I assume you are using GRBL 0.9. I suppose you could just generate the g-code with router speed always set to maximum...

    MG
     
  19. Northernboy

    Builder

    Joined:
    Feb 8, 2016
    Messages:
    26
    Likes Received:
    15
    Once I got all the bugs worked out I was going to post it. I was going to go with an aspirating mister but thought it would mist more than inject drops of lube n didn't want a mess. Right now I'm using Adafruits pump which seems to slip once n awhile. So I might design my own pump using mini wheels and a stepper motor. This is a pic of what I have made up for now.

    For the SSR and PWM, I'm using a Dewalt router so the SSR is for AC power and PWM won't work as far as I know. PWM works for a DC motor or signal to a speed controller.
     

    Attached Files:

  20. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    OOOooo, fancy, LCD display and everything...

    Right, but you are using the PWM output on the Arduino to control the SSR, no? D11 in the diagram above?
     
  21. Northernboy

    Builder

    Joined:
    Feb 8, 2016
    Messages:
    26
    Likes Received:
    15
    The display and controls for the pump I recycled from another project I had but makes adjustments easier.

    For the spindle I am using 0.9i SSR is connected to D12 which is spindle enable and my z-axis limit is connected to D11. When I made my board I followed the Uno layout. I'll have to check if PWM is enabled or not but it's working like that. I can check later to see if it is. If you PWM for the SSR putting the value to the max would turn on the SSR as well.
     
  22. Northernboy

    Builder

    Joined:
    Feb 8, 2016
    Messages:
    26
    Likes Received:
    15
    I just verified my config.h and PWM is disabled.
     
  23. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    I'm confused. If you are using GRBL 0.9, you should have the pinout shown in the second photo above, which has the spindle PWM on D11 and Z axis limit on pin D12. From the info on GitHub, all 0.9 versions have PWM enabled and use this pinout.
    And config.h? Are you compiling your own code? That might explain it...
     
  24. Kyo

    Kyo Veteran
    Staff Member Builder Resident Builder

    Joined:
    Feb 27, 2014
    Messages:
    673
    Likes Received:
    702
    You can also use pin D13 to turn the spindle on / off via relay using M commands. M03 on / M04 off.. or recompile grbl to turn off pwm here is Chamnit's Post Here
    DIY3D covers using D13 pin well in his Video.
     
  25. Northernboy

    Builder

    Joined:
    Feb 8, 2016
    Messages:
    26
    Likes Received:
    15
    Here is link showing pin outs without PWM and with PWM. Same pin definitions are used on the Nano.

    Connecting Grbl · grbl/grbl Wiki · GitHub

    I have the GRBL library in Arduino and download it from there. I had another machine that I started with GRBL 0.8 and when I went to 0.9 I had to disable PWM to keep the pinout the same as 0.8.
     
  26. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    Thanks Kyo, Northernboy, that explains it.

    It's sometimes difficult to grasp this stuff for us non programmers, recompiling the code never even crossed my mind.

    MG
     
  27. Northernboy

    Builder

    Joined:
    Feb 8, 2016
    Messages:
    26
    Likes Received:
    15
    Sorry Metalguru didn't mean to confuse you.
    But glad it's all cleared up now.
     
  28. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    548
    Hi Guys:

    I have been using Arduino Nanos on all my machine builds for 2 or 3 years now, and using Xloader to load GRBL onto the board. Been working fine, quick and much easier than the Arduino IDE. Also, I use the clone boards with the CH340 USB-SER so the Arduino IDE doesn't recognize them without jumping thru hoops.

    Recently I bought 5 more board off of Amazon, and they won't program. Did something change with the AT MEGA 328? Or some other change recently? I bought boards in October, they worked fine, I bought these in April from the same manufacturer and they won't upload GRBL...

    MG
     
  29. Giarc

    Giarc OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Jan 24, 2015
    Messages:
    3,015
    Likes Received:
    1,679
    MG,

    I had the same problem with a nano a while back. There is two nano versions on the IDE. I can't remember what differentiates them. I am not at my computer, but will update this as soon as I can check
     
    #29 Giarc, Jul 18, 2020
    Last edited: Jul 18, 2020
  30. Giarc

    Giarc OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Jan 24, 2015
    Messages:
    3,015
    Likes Received:
    1,679
    I had to choose the Old Boot loader. Not sure how this affects xloader - if at all. I only had the problem after updating my IDE which was a couple years old. It had me pulling what was left of my hair out for a couple hours.
    Arduino.png
     
    #30 Giarc, Jul 18, 2020
    Last edited: Jul 18, 2020

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice