584,802 active members*
4,926 visitors online*
Register for free
Login
IndustryArena Forum > OpenSource CNC Design Center > Arduino > CNCmilling and Dual-Head-3Dprinting firmware/Software?
Page 2 of 2 12
Results 21 to 32 of 32
  1. #21
    Join Date
    May 2015
    Posts
    32

    Re: CNCmilling and Dual-Head-3Dprinting firmware/Software?

    Quote Originally Posted by hfjbuis View Post
    That depends on your drivers. External drivers often have optocoupler inputs. If so, you probably can connect both mega boards to the same driver.
    The mega2560 has onboard drivers without optocoupler inputs and unfortunately can't connect both mega boards to the same driver.
    But I have not thought of that idea before, good one, thanks.

    Quote Originally Posted by wyzarddoc View Post
    It would not be a program "merge" as much as changing a lot of variables with a hardware switch and 1 long program
    That's the idea. But is it possible?
    I checked the mega2560 datasheet and it does not have programming SLOT's functionallity!
    (Then it would have bin simply 2 seperate programs in 2 seperate slots without changing a lot of variables, also adding a hardware switch to select wich program to run.)
    Mega2560 has a Flash memory of 256-8=248KB
    * Marlin firmware is 120KB
    * Gbrl
    firmware is 82KB?
    It could fit in the chip. (And there are a lot of un
    used mega2560-pins for a selection hardware switch.)
    In which code files of Marlin and Gbrl should the "changing a lot of variables" be done?

  2. #22
    Join Date
    Mar 2015
    Posts
    409

    Re: CNCmilling and Dual-Head-3Dprinting firmware/Software?

    In which code files of Marlin and Gbrl should the "changing a lot of variables" be done?
    There is a section where the settings are read from eeprom.
    File settings.c
    // Reads Grbl global settings struct from EEPROM.
    uint8_t read_global_settings() {
    // Check version-byte of eeprom
    uint8_t version = eeprom_get_char(0);
    if (version == SETTINGS_VERSION) {
    // Read settings-record and check checksum
    if (!(memcpy_from_eeprom_with_checksum((char*)&settin gs, EEPROM_ADDR_GLOBAL, sizeof(settings_t)))) {
    return(false);
    }
    } else {
    return(false);
    }
    return(true);
    }
    This could be changed to "alter" settings after they are read or store/retrieve the settings at/from a different eeprom address.

    As a proof of concept, you could set the required configuration by running a (configuration) file that contains all the settings.

    All this requires that you can run the mill using the Marlin firmware by just altering settings!

  3. #23
    Join Date
    May 2015
    Posts
    32

    Question Re: CNCmilling and Dual-Head-3Dprinting firmware/Software?

    You lost me there

    Quote Originally Posted by hfjbuis View Post
    All this requires that you can run the mill using the Marlin firmware by just altering settings!
    1) I expected to do a change in the Marlin firmware file(s) to be able to also mill with gbrl. Because 3Dprinting-Dual-Head(XYZA1A2, heating3x, TempSense3x,Fan) is more complex than Milling(XYZ,Spindle).
    2) I could find a file in the Marlin directory "settings.cpp" that starts with EEPROM settings but differs a lot from GBRL. ("// Change EEPROM version if the structure changes".)
    3) Is it possible for an other aproache like not to EEPROM the codes together but to program all files of Marlin and Gbrl in the controller and by a switch selection is made which part (Marlin or Gbrl) is run?
    Code:
    If switch=0 Then
    Gosub Marlin
    Else
    Gosub Gbrl
    EndIf
    
    Marlin:
    <Marlin code>
    
    Gbrl:
    <Gbrl code>

  4. #24
    Join Date
    Mar 2015
    Posts
    409

    Re: CNCmilling and Dual-Head-3Dprinting firmware/Software?

    Is it possible for an other aproache like not to EEPROM the codes together but to program all files of Marlin and Gbrl in the controller and by a switch selection is made which part (Marlin or Gbrl) is run?
    Technically it is possible. You have to rename all duplicate files, rename duplicate routines if the code is different and change the eeprom storage so that both program's can store their own settings. It probably would take a few months to do!

  5. #25
    Join Date
    May 2015
    Posts
    32

    Re: CNCmilling and Dual-Head-3Dprinting firmware/Software?

    Quote Originally Posted by hfjbuis View Post
    Anything else is possible (we walked on the moon) but requires a lot of work.
    Quote Originally Posted by hfjbuis View Post
    Technically it is possible...It probably would take a few months to do!
    Now I understand the complexity of it, thanks for being straight forward.
    I will leave that programming to the proffesionals and will check in the future if it exists.

    That leaves me with 2 previous options mentioned in this thread:
    1) Use 2 Mega2560
    2) Use multiple CNC-controlleres with like a Dsub-25 connector.
    a) PCBtype
    b) PLUGtype
    c) CABLEtype
    I mentioned earlier that I thought of switching between different CPU boards before with a universal header but my kids will also use it and should be simple to do.
    Do you have pinlayouts and/or pics how you did or will do it on your machine?

  6. #26
    Join Date
    Mar 2015
    Posts
    409

    Re: CNCmilling and Dual-Head-3Dprinting firmware/Software?

    Do you have pinlayouts and/or pics how you did or will do it on your machine?
    No it is on my to do list and waits for some other projects to be finished first. Basically I want to use as little as possible self made electronics. The boards I make are just replacements of wiring.

    CPU side:
    I want CPU boards with no electronics, just wiring CPU pins to a main board.
    The main board will be powered by 24V and supply the CPU power 3V3 and 5V.
    The main board will have an ESP32 or ESP8266 Wi-Fi board to connect the RX/TX of the CPU board, I prefer WiFi connections.
    The main board will do the level converting to the CPU by using FET modules.
    Lathe side:
    The main board will do the 5V level converting for the all drivers and sensors by using optocouplers.
    The spindle will be driven by step/dir (servo) for position modes and 10V for speed modes and manual mode, selectable by a control pin (CPU side) and a switch (Lathe side).
    I will use a PWM to 10V module for the conversion of PWM to 10V

    The CPU board will be connected directly to a D-Sub25 connector
    For the lathe I will use D-Sub25 connectors and D-Sub25 parallel port cable(s)
    The steppers are connected using GX16 4 pin connectors
    The servo motor has its own cables
    For the lathes I will make a board to connect the sensors and switches.

    I will do both lathes the same way so that components can be used interchangeably and in future the mill will also get the same boards.

  7. #27
    Join Date
    May 2015
    Posts
    32

    Re: CNCmilling and Dual-Head-3Dprinting firmware/Software?

    Nice configuration!
    Same here for the24V that I will use on the Mega2560 to have sufficient power for the steppers drivers.
    The mega2560 comes with MOSFETS for spindle etc. but to power mine(100Vdc type high speed with power supply and speed control) I use a 24V relais.
    I checked my old cable wires bag and found 6x D-Sub25 parallel port cables that I will use to switch between controllers for now.
    I noticed your
    ESP32 or ESP8266 Wi-Fi boards setup that is also possible on the Mega2560?

  8. #28
    Join Date
    Mar 2015
    Posts
    409

    Re: CNCmilling and Dual-Head-3Dprinting firmware/Software?

    I noticed your ESP32 or ESP8266 WiFi boards setup that is also possible on the Mega2560?
    I used ESP8266 modules in the past. Now I use Arduino Uno and Mega boards from Robotdyn that have an onboard ESP8266.
    The Mega board:https://robotdyn.com/mega-wifi-r3-at...micro-usb.html
    The ESP8266 sketch and manual:https://github.com/MetalWorkerTools/...%20Connections
    In future I am going to use arm boards without onboard WiFi. I add an ESP module to the main board so that all boards I want to test can be connected by WiFi.

    Beware that the gcode sender also has to support WiFi connections (UGS can). I stumbled about this program that makes a virtual COM port for a WiFi connection. I have tested it and it works for me.
    https://www.hw-group.com/software/hw...al-serial-port

  9. #29
    Join Date
    May 2015
    Posts
    32
    Quote Originally Posted by hfjbuis View Post
    Now I use Arduino Uno and Mega boards from Robotdyn that have an onboard ESP8266
    I did not know that's available, thanks.
    Quote Originally Posted by hfjbuis View Post
    The ESP8266 sketch and manual on github...
    Is for lathes only?

    A virtual COM port for a WiFi connection could be nice.

    Just some info, I ordered the "female Dsub-25 with nuts" because all my old cables had "male Dsub-25 with bolts"!

  10. #30
    Join Date
    Mar 2015
    Posts
    409

    Re: CNCmilling and Dual-Head-3Dprinting firmware/Software?

    Is for lathes only?
    No, the ESP sketch is just a transparent converter. It doesn't alter any messages, just transmits them. I use it on my lathes, rotary table and grinder.

    Just some info, I ordered the "female Dsub-25 with nuts" because all my old cables had "male Dsub-25 with bolts"!
    A female connector is a bit more protected to short circuits. I prefer a female connector on the side where the signals are active.
    On my lathe, there is no voltage on the connector. A short on that connector will do no harm. So the lathe has a male connector. For that same reason, the CPU board also has a male connector.
    The main board is fitted with Female D-sub 25 connectors because it has live signals. I use Male to Female parallel port cables.

  11. #31
    Join Date
    May 2015
    Posts
    32
    The ESP becomes something like a W-USB (wireless USB)?

    The female connector is indeed more protected to short circuits, so I will now use it in the CNC-controller too.
    De male connector is then on the machine.
    I've seen in the past on parallel printers that the connector pins can be bend and create a short circuit.

  12. #32
    Join Date
    Oct 2017
    Posts
    12
    If youre interested, Im trying to finish up a brand new controller designed from the ground up to be flexible enough to operate almost any machine. It runs on an stm32 chip tho not an arduino. It should be able to handle switching from one machine type to another once you have configured the machine and stored its configuration. Since its configurable the user will have to tweak the base settings, so its not quite as simple as grbl. But there should never be a need to reflash it, except for upgrades and bug fixes. Im getting pretty close to having it done.

Page 2 of 2 12

Similar Threads

  1. Software problem with dual head laser cutter, can't cut wide items.
    By timmbbo in forum Laser Engraving / Cutting Machine General Topics
    Replies: 0
    Last Post: 06-27-2020, 05:50 AM
  2. selling dual head camfive CFL-CMA1390kt dual head machine
    By relivegreen in forum Laser Engraving / Cutting Machine General Topics
    Replies: 0
    Last Post: 08-24-2016, 08:11 PM
  3. Anybody here with a dual head G.Weike?
    By CNC-Design in forum Laser Engraving / Cutting Machine General Topics
    Replies: 4
    Last Post: 03-28-2013, 08:33 AM
  4. working effective CNCmilling
    By Nemo1985 in forum News Announcements
    Replies: 0
    Last Post: 12-15-2009, 08:56 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
  •