592,316 active members*
5,777 visitors online*
Register for free
Login
IndustryArena Forum > OpenSource CNC Design Center > Arduino > Start / resume on 3018 control board
Results 1 to 13 of 13
  1. #1
    Join Date
    Sep 2024
    Posts
    6

    Start / resume on 3018 control board

    Is there anyway to reprogram the control boards that come with the cheap 3018s to use one of the limit switch inputs on the controller to create a physical start/resume button?

    The thing I am trying to achieve is to insert an M0
    code in between each G1 code, so that the machine will move to a position, pause,and then move to the next position when the resume switch is triggered from non CNC portion of the machine.

    I know Arduino has a separate input for this, but if I can repurpose the 3018 boards it will make it cheaper and easier to do since I'm repurposing the majority of part from the 3018 anyway.

  2. #2
    Join Date
    Mar 2015
    Posts
    437

    Re: Start / resume on 3018 control board

    Technically it can but it you need to know the processor and pinout of the board. The safest way is to use the source code supplied with the board. Upload that without modifications and check if all is still working. If not, you have a real problem. If it is working, you can start modifying the supplied software.

    If there no source code supplied with the board, you have to find out what board brand/type/version you have. A picture of the board showing brand/type/version could help.
    You could connect the arduino serial monitor to monitor the USB output at boot. That will give some info for board and brand.
    The gcode sender you are using may have a built in serial monitor that shows some info.

    If you can't find out the brand/type/version of the board, buying a new board is an option. Than you have to rewire the new board and that can be difficult.

  3. #3
    Join Date
    Sep 2024
    Posts
    6
    The model number on the board is 102363g_y297-220606. What I've found so far says it's a woodpecker camxtool. Inside the manual is came with says woodpecker on the picture of the board but it's also a picture of slightly different board, go figure.

    I was able to upload sainsmart firmware to the board using their download and everything seems to be working fine in UGS.

    I'm lost on the hex file stuff. I opened the hex file in an online viewer and it's just binary Im guessing. I assume I need to obtain source code, make the change I want to make and then compile my own hex file from that?

  4. #4
    Join Date
    Mar 2015
    Posts
    437

    Re: Start / resume on 3018 control board

    Quote Originally Posted by Jelandis View Post
    I'm lost on the hex file stuff. I opened the hex file in an online viewer and it's just binary Im guessing. I assume I need to obtain source code, make the change I want to make and then compile my own hex file from that?
    Yes, that is the way to go.

    According to the saint smart website, they use a grbl 1.1x firmware. According to the usage terms of grbl firmware, they must supply the source code of their firmware. Send them an email and ask where you can download their grbl source codes.

  5. #5
    Join Date
    Mar 2015
    Posts
    437

    Re: Start / resume on 3018 control board

    It could be your (Arduino uno compatible) board is running a plain unmodified Grbl version. You could backup your current settings and upload the latest grbl firmware. If then your board doesn't function properly, you could upload the last working firmware. If the latest grbl software is working, you have the source code to modify. Make a backup of your current settings because they can be overwritten by new firmware.
    https://github.com/gnea/grbl

  6. #6
    Join Date
    Sep 2024
    Posts
    6
    I was poking around in the files a little bit but I don't even know what I would change. The CPU map defines the limit pins and start cycle pin, other than that the limit files are the only other places I saw any mention of limit switches. The limit switches are digital, start cycle is analog, so I'm at a loss at this point.

    If the 328 was a dip I think the easiest solution would be to hardwire directly to the pins but it's the quad package. And I don't think there are any pads for those pins on the board.

  7. #7
    Join Date
    Mar 2015
    Posts
    437

    Re: Start / resume on 3018 control board

    All Limit pins must be on the same port. All other pins (door, Abort, etc) also. If you want/need to solve it in source code, you have to change the code that handles the limit pin(s) to do something else when activated.

    In the file limits.c you find this code
    ISR(LIMIT_INT_vect) // DEFAULT: Limit pin change interrupt process.
    and the lines
    if (limits_get_state()) {
    mc_reset(); // Initiate system kill.
    This is where you could change the behavior of a limit pin.

    Another solution would be to connect an XBox controller and map one of the xbox controller keys to a function key and map that function key to cycle start/stop in UGS.

    https://github.com/winder/Universal-...d-and-joystick

    https://www.youtube.com/watch?v=-lQQHDMLB8k

    https://www.youtube.com/watch?v=5PjfRAFjaRE

  8. #8
    Join Date
    Sep 2024
    Posts
    6
    We're well beyond my capabilities at this point. Im going to have to learn some c programming basics before I go any further. I don't really understand the architecture how things go together.

    Having the port requirement means I would have to eliminate functionality to all the limit pins to move a control pin to the digital pins? That's my best guess anyway.

    The play station controllers are cool but wouldn't help in this situation. Really all I need for the machine I want to build is 2 axes and the resume switch.

  9. #9
    Join Date
    Mar 2015
    Posts
    437

    Re: Start / resume on 3018 control board

    Having the port requirement means I would have to eliminate functionality to all the limit pins to move a control pin to the digital pins?
    No, you can use an analog port just as a digital port. But if the analog pin's aren't available on the board, you still need to use a limit pin for that extra function. For that you have to filter out the limit pin change processing for the limit pin that is assigned to start/stop the program. This will make the probe detection a bit slower and so a bit less accurate. Also detecting a limit pin hit will be slower. I guess, the extra processing time will be 10 to 30 micro seconds.
    Modifying the grbl code is not easy and surely not a beginners task.
    The play station controllers are cool but wouldn't help in this situation
    You are using UGS so a play station controller or (extra) numeric keypad could be used to start/stop/pause/etc the program.

    You could solder a wire on the processor pin. It is an Atmega328 xxx. On the chip you can find the actual type and in the datasheet the A1/A2 pin (PC0 / PC1).

  10. #10
    Join Date
    Sep 2024
    Posts
    6
    So this is basically what I want to do, I have a sewing machine to which I will attach my 2 axis CNC contraption.
    I want to place a pause between each line of code, when the sewing needle comes up all the way I want it to hit a switch to trigger the next movement. Running from ugs, or preferably from the SD card in the offline controller if possible.

    Homing and limits aren't necessary, I can zero the machine manually before turning it on, the axes will have a very small range of motion in the sewing area.

    Sainsmart replied saying their boards use an unaltered version of grbl. So thats some good news.

    I'm going to put it all together with a CNC shield for now and see if it's going to work out the way I want.

  11. #11
    Join Date
    Mar 2015
    Posts
    437

    Re: Start / resume on 3018 control board

    when the sewing needle comes up all the way I want it to hit a switch to trigger the next movement.
    If you want grbl to pause/resume, than that switch must be pressed manual because it has to be released before the next switch is pressed.

    If I under stand it right, you want to change the stitch length/width by CNC. If so, consider controlling the stitch motor by the third axis. Than you have "full" control.
    An MKS TinyBee board has 5 steppers (actual 4 axis) and that board can run FluidNC or GrblHAL firmware. FluidNC can load a gcode file from flash ram at the press of a button. There are more cheap 5 axis stepper controllers based on a grbl kind of firmware.

  12. #12
    Join Date
    Sep 2024
    Posts
    6

    Re: Start / resume on 3018 control board

    I wanted it to be an attachment I could put on and take off the machine easily so I don't want to control the needle that would make it a full conversion not easy to switch back and forth. Basically an embroidery machine but for repetitive small tasks like buttonholes and bartacks. there's already an embroidery machine project out there that has the needle controlled by a stepper motor.

    I found the pins on the 3018 board and it works I would just have to do some micro soldering.

    I mocked everything up with an Arduino and some 3d printed parts and it works the way I want. I'm going to have to work out a good clamping method for the fabric. Ultimately I'm putting it on hold for the time being, maybe a winter project.

    Fluidnc is great. I run a 6xcnc on my router. If I was just building one of these fluidnc is definitely what I would be using but I wanted to make it a cheap and easy project that people could do to have access to a pattern sewing attachment since there's nothing out there that isn't a dedicated machine that cost multiple thousands of dollars.

  13. #13
    Join Date
    Mar 2015
    Posts
    437

    Re: Start / resume on 3018 control board

    I wanted to make it a cheap and easy project that people could do to have access to a pattern sewing attachment
    I don't think it will get much cheaper than using an Arduino and a CNC shield. Without the shield, an ESP32 will beat the Arduino price wise. The ESP32-S works great and has a build-in debugger but is not yet supported by FLuidNC. I also couldn't find a grblHAL port for the ESP32-S.

    I mocked everything up with an Arduino and some 3d printed parts and it works the way I want
    Good to hear you got things working. I hope you will finish the project successfully.

    Regards Huub

Similar Threads

  1. CNC 3018 stepper motor/control board issues
    By greendragonsegg in forum Chinese Machines
    Replies: 0
    Last Post: 04-23-2021, 09:56 AM
  2. 3018 cnc controller board, fuse blown
    By momemarian in forum Chinese Machines
    Replies: 1
    Last Post: 03-30-2019, 01:16 PM
  3. Replies: 51
    Last Post: 05-15-2013, 10:23 AM
  4. Replies: 3
    Last Post: 11-21-2012, 01:49 PM
  5. Start/Resume button
    By ccemc2 in forum LinuxCNC (formerly EMC2)
    Replies: 3
    Last Post: 11-22-2010, 05:22 AM

Tags for this Thread

Posting Permissions

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