Hello to anyone who reads this. I'm new to the forum and came here, of course, to try to solve an issue.
I'm a mech eng. so I'm pretty bad at programming (thank God for chatgpt).
I have designed a machine with a solenoid tool clamp. Apart from that, the array is pretty standard: RAMPS 1.4, reprap discount full graphics controller, NEMA17s, and three limit switches. The machine is pretty big and disassembleable (my house is not so big). If anybody is interested I'll gladly share the step files, BOM and code, but I guess nobody will be interested in any of those things.
The machine has got a solenoid in the tool head to pick and leave several tools, (like i.e. different pen colors if it's used as a pen plotter). I guess I could have programmed it as a servo tool changer (do not know how to do it, but I have seen in Youtube videos of buildings just like that, so it is possible), and use the servo signal to trigger the relay that turns on/off the solenoid, but, well, I did not explore that road. If anybody that understands Marlin well, tells me that I'm messing things too much, and servo is the way to go, I will try it.
The road I chosed is to get control of the solenoid of the ELECTROMAGNETIC_TOOL_CHANGE, (I'm using servo PIN11 for that) though my machine is defined as a spindle/fan with 0 extruders, and I believe the ELECTROMAGNETIC_TOOL_CHANGE is not meant to be used that way. In any case, I can turn on/off the solemoid with M380, and M381.
Next step is creating a Tool_Swap menu, and that's the issue that has brought me here. I have included in the Configuration.h the following lines:
#define CUSTOM_MENU_MAIN
#if ENABLED(CUSTOM_MENU_MAIN)
#define CUSTOM_MENU_MAIN_TITLE "TOOL CHANGE"
#define CUSTOM_MENU_MAIN_SCRIPT_DONE "M117 User Script Done"
#define CUSTOM_MENU_MAIN_SCRIPT_AUDIBLE_FEEDBACK
#define CUSTOM_MENU_MAIN_ONLY_IDLE // Only show custom menu when the machine is idle
#define MAIN_MENU_ITEM_1_DESC "Tool Change"
#define MAIN_MENU_ITEM_1_ACTION submenu_tool_swap
#define MAIN_MENU_ITEM_2_DESC "Home & UBL Info"
#define MAIN_MENU_ITEM_2_GCODE "G28\nG29 W"
Also, in scr/lcd/menu/menu_main, I have included the following line:
#include "menu_tool_swap.h"
So I guess next step should be creating such a file in scr/lcd/menu and this is where I get stuck.
I know what I want the menu to be like (pretty easy in fact, it just displays a number which represents the current tool, 0 for none, turning the wheel of the encoder the number can be varied, pressing the botton the old tool is leftin its place and the new tool is picked. If no new tool is selected (0) the machine leaves in its place the current tool and homes.)
I guess that with a little help I could write one or several programs detailing the gcode of each one of these operations, Let's say i.e. M806 to pick tool#6 and M816 to teave tool#6. Folder scr/gcode is full of folders with programs to copy from.
But in truth I have no Idea how to create and implement this Tool_swap submenu. Me and my friend chatgpt could use a little guidance from anyone who has experience creating submenus, (or solenoid tool swapping if that thing even exists)
I'm a mech eng. so I'm pretty bad at programming (thank God for chatgpt).
I have designed a machine with a solenoid tool clamp. Apart from that, the array is pretty standard: RAMPS 1.4, reprap discount full graphics controller, NEMA17s, and three limit switches. The machine is pretty big and disassembleable (my house is not so big). If anybody is interested I'll gladly share the step files, BOM and code, but I guess nobody will be interested in any of those things.
The machine has got a solenoid in the tool head to pick and leave several tools, (like i.e. different pen colors if it's used as a pen plotter). I guess I could have programmed it as a servo tool changer (do not know how to do it, but I have seen in Youtube videos of buildings just like that, so it is possible), and use the servo signal to trigger the relay that turns on/off the solenoid, but, well, I did not explore that road. If anybody that understands Marlin well, tells me that I'm messing things too much, and servo is the way to go, I will try it.
The road I chosed is to get control of the solenoid of the ELECTROMAGNETIC_TOOL_CHANGE, (I'm using servo PIN11 for that) though my machine is defined as a spindle/fan with 0 extruders, and I believe the ELECTROMAGNETIC_TOOL_CHANGE is not meant to be used that way. In any case, I can turn on/off the solemoid with M380, and M381.
Next step is creating a Tool_Swap menu, and that's the issue that has brought me here. I have included in the Configuration.h the following lines:
#define CUSTOM_MENU_MAIN
#if ENABLED(CUSTOM_MENU_MAIN)
#define CUSTOM_MENU_MAIN_TITLE "TOOL CHANGE"
#define CUSTOM_MENU_MAIN_SCRIPT_DONE "M117 User Script Done"
#define CUSTOM_MENU_MAIN_SCRIPT_AUDIBLE_FEEDBACK
#define CUSTOM_MENU_MAIN_ONLY_IDLE // Only show custom menu when the machine is idle
#define MAIN_MENU_ITEM_1_DESC "Tool Change"
#define MAIN_MENU_ITEM_1_ACTION submenu_tool_swap
#define MAIN_MENU_ITEM_2_DESC "Home & UBL Info"
#define MAIN_MENU_ITEM_2_GCODE "G28\nG29 W"
Also, in scr/lcd/menu/menu_main, I have included the following line:
#include "menu_tool_swap.h"
So I guess next step should be creating such a file in scr/lcd/menu and this is where I get stuck.
I know what I want the menu to be like (pretty easy in fact, it just displays a number which represents the current tool, 0 for none, turning the wheel of the encoder the number can be varied, pressing the botton the old tool is leftin its place and the new tool is picked. If no new tool is selected (0) the machine leaves in its place the current tool and homes.)
I guess that with a little help I could write one or several programs detailing the gcode of each one of these operations, Let's say i.e. M806 to pick tool#6 and M816 to teave tool#6. Folder scr/gcode is full of folders with programs to copy from.
But in truth I have no Idea how to create and implement this Tool_swap submenu. Me and my friend chatgpt could use a little guidance from anyone who has experience creating submenus, (or solenoid tool swapping if that thing even exists)