Welcome to Our Community

Some features disabled for guests. Register Today.

Question about custom firmware

Discussion in 'Controller Boards' started by that-jim, Mar 6, 2021.

  1. that-jim

    that-jim Journeyman
    Builder

    Joined:
    Apr 19, 2020
    Messages:
    143
    Likes Received:
    148
    I am wondering if someone could help me find directions for making custom firmware for the black box. Specifically I want to set up grbl with the USE_SPINDLE_DIR_AS_ENABLE_PIN option. I have installed the arduino ide and found the config file and uncommented the option I want to use.

    Do i use the Arduino ide to write to a black box? Or do I somehow save the compiled file and load it with open builds control?

    Thanks for any help!
     
  2. sharmstr

    sharmstr OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 23, 2018
    Messages:
    2,030
    Likes Received:
    1,428
    Go through the steps outline in the grbl wiki. You should end up with a hex file. Use the Firmware Flashing Tool in the Wizards menu of Control. Select Custom: firmware hex file for machine style. Once you do that, you'll be able to browse for the file.
     
    Peter Van Der Walt and that-jim like this.
  3. that-jim

    that-jim Journeyman
    Builder

    Joined:
    Apr 19, 2020
    Messages:
    143
    Likes Received:
    148
    Thanks I will take a look at the grbl wiki.
     
  4. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,753
    Likes Received:
    4,070
    You can flash from Arduino too. Make sure to select Uno/Genuino under Tools > Boards
     
    sharmstr likes this.
  5. that-jim

    that-jim Journeyman
    Builder

    Joined:
    Apr 19, 2020
    Messages:
    143
    Likes Received:
    148
    Thank you Peter and Shawn. I have the USE_SPINDLE_DIR_AS_ENABLE_PIN option working now. Only one drawback that I did not know about pin 13 is toggled on and off at power up, reset or usb connection.

    grbl config file does warns about this.

    " BEWARE! The Arduino bootloader toggles the D13 pin when it powers up. If you flash Grbl with
    // a programmer (you can use a spare Arduino as "Arduino as ISP". Search the web on how to wire this.),
    // this D13 LED toggling should go away. We haven't tested this though. Please report how it goes! "

    Is programming the black box the way they suggest possible? Or a bad idea for any reason?

    I would rather not have the spindle enable pin toggling on the spindle upon connection.
     
  6. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,753
    Likes Received:
    4,070
    If you own an ISCP programmer you can put the bootloader back. Without the neccesary tools, you can not. So really boils down to purchasing the tools you need:

    USBtinyISP AVR Programmer Kit (USB SpokePOV Dongle)
    Pocket AVR Programmer - PGM-09825 - SparkFun Electronics
    ATAVRISP2 Microchip Technology | Development Boards, Kits, Programmers | DigiKey
    etc


    That said, thats why we recommend NOT using the relay/Enable - rather just configure the VFD correctly so it doesn't spin up until the 0-10v reaches the minimum RPM: docs:blackbox:connect-vfd [OpenBuilds Documentation] - then you only need to wire it to 0-10v and GND. DCM/FOR is jumpered or you can wire a safety switch there
     
    sharmstr likes this.
  7. that-jim

    that-jim Journeyman
    Builder

    Joined:
    Apr 19, 2020
    Messages:
    143
    Likes Received:
    148

    Thanks,

    Thanks for the reply. I did see(and try) the configuration in your documentation, at this point I am exploring the different configs possible to see what I am the most comfortable with. And your suggestion of adding a safety switch in the DCM/FOR connection may be a good option.

    I would like to set a min speed in the VFD (PD011) so I can not inadvertently set a speed that might damage my air cooled spindle. When you use PD011 to enforce a minimum speed you lose the ability to shut the spindle down with the 0-10v signal.

    Thanks again for the info on the ISCP programmer, I am actually pretty near spark fun maybe I will order one from them.
     
  8. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,753
    Likes Received:
    4,070
    Not too sure of the specific parameters (we don't supply VFD spindles), but most folks here seem to have a setup that DOES shutdown, and I'm pretty sure also has the Minimum RPM setup working. Just need the right combination of parameters I am sure
     
  9. ljvb

    ljvb Well-Known
    Builder

    Joined:
    Feb 14, 2019
    Messages:
    276
    Likes Received:
    87
    Could you not restore the board using JTAG header? (or do these boards not have said circuitry)
     
  10. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    13,753
    Likes Received:
    4,070
    ICSP header. Yes it is onboard. And yes you still need programming hardware
     
  11. that-jim

    that-jim Journeyman
    Builder

    Joined:
    Apr 19, 2020
    Messages:
    143
    Likes Received:
    148
    So I got the SparkFun Pocket Programmer today, they have a great hook up guide on their site. I tested the whole process of burning firmware with the programmer on a UNO that I had 'on hand' just to get familiar with everything. I now have the custom grbl firmware working with the USE_SPINDLE_DIR_AS_ENABLE_PIN option on the BlackBox. I have my jumper set use the onboard relay to turn on with the DIR pin and with the bootloader removed the DIR pin (13) no longer toggles upon usb connection. Everything seems to be working well, I am still bench testing this and not in a big hurry to put it into service as the machine that it is going on is still a work in progress.

    Thanks again Peter and Shawn for the info, even if I don't end up using this configuration I learned something new...
     

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