Setting up Remora for laser cutting

More
27 Jun 2021 19:52 #213046 by Doogie
I've not done much python but it's really good at parsing XML and JSON file structures. In those structures the variable names and values are defined and there's also a hierarchy to the structures which could match the tabs you have.
something like this and the variables  in the GUI code would reference these data elements and their values.
{
"RemoraConfigGUI":
    {
   "title": "Remora Config.txt GUI",
         "tab_Axis":
           {
                  "Axis_X":
                           {
                          "x_axis": "false",
                           "joint_num":"0",
                            "step_pin":"2.2",
                            "dir_pin":"2.6",
                            "enable_pin":"2.1",
                     },
                     "Axis_Y":
                      {
                            "y_axis": "false",
                            "joint_num":"0",
                             "step_pin":"0.19",
                             "dir_pin":"0.20",
                             "enable_pin":"2.8",
                         }
                    "tab_Outputs":
                     {
                          "ID_Output_0":
                           {
                                "output_0":false",
                                 "pin_number":"",
                                 "pin_state": [ "pull_none","open_drain","pull_up","pull_down"],
                    }
             }
    }

Please Log in or Create an account to join the conversation.

More
27 Jun 2021 21:28 #213052 by Aaroncnc
I will try and see what I can put together this week. I should be able to get the basic starter Machine selection done no problem.

But the save and reload might take a bit longer.

I was thinking of putting in a Hal file generator. So you could copy paste code into your Hal file.
Tell the user to setup the machine with the basic parallel port setup then copy paste over lines from a text file.
The following user(s) said Thank You: Doogie

Please Log in or Create an account to join the conversation.

More
28 Jun 2021 19:55 #213167 by Aaroncnc
I have updated the tool to now support basic configs from a drop down.

I am not sure 100% on what each needs.
I made a K40 laser example can you check it out and let me know what i might have missed?
The following user(s) said Thank You: Doogie

Please Log in or Create an account to join the conversation.

More
29 Jun 2021 04:16 #213213 by Doogie
Looks pretty good but I will say that I've not used the config.txt files the way you are. ie I keep them fully detailing the hardware of the board and adjust parts as needed.  So I have all 5 axis's defined in my config.txt, all the digipots(MKS SBase v1.3) and when in and tweaked the Bed Heater output for hardware PWM.
  {
       "Thread": "Servo",
       "Type": "PWM",
               "Comment": "Bed heater PWM",
               "Hardware PWM": "True",
               "Variable Freq": "True",
               "Period us": 200,
               "SP[i]": 0,
               "Period SP[i]": 1,
               "PWM Pin": "2.5"
       },

And I've not see what options are available for the hardware PWM and thought it was setup like software which was 0-100 was the usable range.
I therefore map/scale the gcode 0-1000 into 0-100 output in my hal file.  I'm now wondering if "PWM Max" can't be 1000 and what else might be there.

I'm guessing you customize the config.txt file like this where you define only what you are using?  
 

Please Log in or Create an account to join the conversation.

More
29 Jun 2021 12:42 #213232 by Aaroncnc
I keep my config set to only what I need.
Keeps it nice and simple.
I am working on the load feature for it now so a user can quickly reload a save file.
For now it will be a second file but in the future I want it to be able to use the config file itself, but this way I can learn and parse the text easily.

Please Log in or Create an account to join the conversation.

More
29 Jun 2021 16:43 #213249 by Doogie
Not having spent the time thinking about this which you have, I do see there being many ways to look at this. I was thinking of some default JSON based format which can be maintained on github and provides the full board capabilities so when a board is selected, it parses the JSON file and populates the GUI so all known options are there and the user can then select the subset they want to use.

And then I think about how cool it would be to also have the capabilities to have some form of defaults for different specific machines. And maybe can be done with some form of <default> fields in the JSON file so that there would then be basic copies of the base board model JSON file but the xxxx_k40.json would be one with the defaults set for a K40 laser cutter.

But I also see the advantage of having it read config.txt files so that you can load something you've already created and make changes.... Maybe the middle ground is loading json defaults and once you make a change it'll ask you to save a new json file before saving the config.txt file? That way you have the file used to generate the config.txt file and could even submit it as a machine default for others to use.

or not. ;-)

Please Log in or Create an account to join the conversation.

More
29 Jun 2021 19:51 - 29 Jun 2021 19:52 #213261 by Aaroncnc
Okay the load function has been added.
It works via creating a second file called save.txt
In this file all items of a kind are saved to a line with all the variable and broken up by "|".

So i am not great at coding so i kludged the entire thing with as little logic as i could.
So it seems to be working with loading the save file.

My next task will be to try and add logic so i dont have to have 8 lines for input when all the variable names are input1, input2 input3 ect.
If i can add a variable after input then just a simple counter this would make the code way better.

But i am still learning and wanted to get a functional generator out as fast as i could.
Last edit: 29 Jun 2021 19:52 by Aaroncnc.
The following user(s) said Thank You: Doogie

Please Log in or Create an account to join the conversation.

Time to create page: 0.078 seconds
Powered by Kunena Forum