UCCNC startup G18

If you have a question about the software please ask it here.

UCCNC startup G18

Postby Robertspark » Sat Oct 28, 2017 5:22 pm

Is it possible to start UCCNC in another plane other than G17 be default?

Like G18 required for lathe or turning

{I've not seen anthing in the profile or screenset which allows me to do this, I can do it by Macroloop, but thought it would need to be something combo-box based within the screenset, and pulled from the profile?}
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: UCCNC startup G18

Postby Derek » Sat Oct 28, 2017 6:12 pm

You could add it to the startup macro.
Derek
 
Posts: 341
Joined: Mon Sep 05, 2016 9:57 am

Re: UCCNC startup G18

Postby Robertspark » Sat Oct 28, 2017 6:18 pm

Ahhhh!

Thanks, not used the startup macro before {thought never crossed my mind :oops: )

Sounds like a plan thanks again.
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: UCCNC startup G18

Postby Robertspark » Sat Oct 28, 2017 7:02 pm

Derek, Thanks very much for that, sorted via the constructor macro. :D

For anyone interested:

Need to add a bit of sleep to allow for the code to be entered whilst the E-Stop (Reset) is cleared and then reset to Active

I tried Codesync() without the sleep and although it would set G18, an error message still popped up stating that the reset needed to be cleared before entering gcode (changing modal setting)
It worked fine if I removed the E-Stop reset too.... but I like to start my machine in e-stop condition.

The call button #141 bit sets the toolpath view left for lathe X/Z plane active

Code: Select all
exec.Callbutton(141); // Toolpathviewleft  - Sets the toolpath to a left side look viewing mode.

exec.Callbutton(513); ///  Clear Reset (E-Stop) {required to change modal state}
Thread.Sleep(50);
exec.Code("G18"); // Sets G18 XZ plane selection
exec.Callbutton(512); ///  Set Reset (E-Stop)


:ugeek: :roll:
It would be possible to alter the code to change the default feedrate of 6 units per minute to something else using a similar bit of code (change te "G18" to "Fxxxx" and it will work + "Sxxxx" if you desire or change any of the other modal commands too my the look of things from startup)
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: UCCNC startup G18

Postby ger21 » Sat Oct 28, 2017 9:37 pm

I didn't think it was possible to do that in the Constructor macro. This thread has some info on that:

viewtopic.php?f=4&t=770
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: UCCNC startup G18

Postby cncdrive » Sat Oct 28, 2017 10:12 pm

It's possible to execute g-code from the constructor macro, but the macro has to remove the reset condition calling the reset off button code.
The macro also has to wait for the reset to clear. Rob's solution should be working if the sleep is long enough, but a better approach would be to wait for the reset LED state to clear after calling the reset button, then the wait is sure long enough.
BTW, it works a bit different in Mach3, there is an init string which is a line of g-codes. In the UCCNC this was not implemented, because we think it is unsafe how it works in Mach3,
and what we feel unsafe is that Mach holds the init string codes execution until the user removes the reset (presses the reset button), but what if the user forgot about that this is the first reset press and forgot about that a motion will happen if the init string contains a motion g-code which is also possible to add to the init string. So, is why the solution in UCCNC is different, the user has a full control of when and how to execute code with the constructor macro.
It could be also considered a bit unsafe to remove the reset automatically with the constructor macro, but at least it happens always as soon as the software startsup, so the user can't run the UCCNC leave it there and later come back to reset and see the macro executing, so we think this is still a safer way...
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: UCCNC startup G18

Postby Robertspark » Sun Oct 29, 2017 6:51 am

Gerry, Thanks for the link, I remembered reading about that one. I was trying to avoid another macroloop, hence thought I'd try it this way, and the 50mSec wait seemed to do the trick.

If the wait is not long enough all that happens if a message pops up on the screen telling you that you need to perform a reset first. If you use Codesyc() the G18 change goes through anyway and the modal setting is changed and you just presss OK on the message.

These are all part of my attempt to see what is required to get a lathe / turning function running, hence I'd rather prefer not to have to use any macros to do that and would prefer the use of comboboxes (given the selection is only one of a few options) to set G17 or G18 or G19, and think that the setting should be held in the profile {given it will be the profile that is setu for milling, plasma lathe or whatever you want}

The other bit that was added to the constructor macro is also I believe not required and should be inbuilt within UCCNC which is to change the toolpath view which will be required by a lathe setup.

I know that these are not priority for cncDrive as they have other things (which are more important), so these should just be thought of as a temporary fix until proper development time is available for lathe / turning to integrate some of these items. Think of them as forming a todo list for lathe / turning {but they probably show you another way to do things too should you want to change the feedrate spindle speed etc, not that any of these affect me as I kind of think you should change those through the MDI or via the gcode file to the job you want to run, I can't remmebr what I did yesterday let along what feedrate I ran a job at hence in my opinion those numbers should go in the gcode file, I dont need an "initialistion" string to change / set those up {each to their own}

I added in callbutton 138 to the constuctor macro to set the view scale for the toolpath a little closer.
Code: Select all
//This is the Constructor macro which executes once when the application gets loaded

exec.Callbutton(141); // Toolpathviewleft  - Sets the toolpath to a left side look viewing mode.
exec.Callbutton(138); // Set - Toolpathzoomcontents Zooms the contents in the toolpath viewer.

exec.Callbutton(513); ///  Clear Reset (E-Stop) {required to change modal state}
Thread.Sleep(50);
exec.Code("G18"); // Sets G18 XZ plane selection
exec.Callbutton(512); ///  Set Reset (E-Stop)



Interesting I then loaded a test gcode file, and the toolpath view switched back to toolpatheview top (button (142)) :( :(
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: UCCNC startup G18

Postby ger21 » Sun Oct 29, 2017 11:41 am

Just tested setting the Feedrate and RPM in the Constructor, and it works fine. Thanks for that.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: UCCNC startup G18

Postby dezsoe » Sun Oct 29, 2017 1:57 pm

It's nice to have some settings in the constructor, but:
- by me (and I think a lot of people) reset controls charge pump and charge pump controls the main power supply for the machine. I do not want to turn my power supply on for only some milliseconds!
- what happens, if the reset cannot turn on and constructor waits for reset LED? Normally, I leave my e-stop button pressed when I turn off the stuff for safety.
I think, the solution is somewhere around my macroloop technique, but (if needed) it should ask for approval first to set the defaults to prevent surprises.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: UCCNC startup G18

Postby Robertspark » Sun Oct 29, 2017 2:33 pm

dezsoe wrote:- what happens, if the reset cannot turn on and constructor waits for reset LED? Normally, I leave my e-stop button pressed when I turn off the stuff for safety.


Good point, I'm just using uccnc in demo mode, without a motion controller / machine connected. With the estop pressed in (physically) it will not be able to clear the reset to run the code.

As my code does not have any check or wait it will just error out with a message on the screen (screenshot below).

really, the solution is to allow for G17, G18 and G19 to be loaded from the profile under startup {they have to be set somewhere within the UCCNC startup code, why not make them accessible via a screen / tab / combobox or checkbox...}

I was just trying to use this as a workaround, I did not see it as a long term fix / solution.

---------------------------------------------------
Dezsoe, why are you toggling your power supply on and off under chargepump signal?
Why not use the enable pin on your drives, and an interlock on your VFD / spindle?

If you physically drop the power out to your stepper / servo drives + VFD they have no way to come to a controlled emergency stop using breaking as quick as is possible.

{I do take your point though about the xxmSec pulse of e-stop / reset clear, I'll take another look at your macroloop}

I don't know why but I'm reluctant to have a load of macroloops even though I know that they are constructed in such a way that they will just check a status and return and little delay will be induced by the loops.
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Next

Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 3 guests