Macro - SmartHome

Here is where you can drop off Examples of WORKING macros,plugins,Gcode programs , macro Wizards etc.
Please give a brief description of what it is and how it works.

Macro - SmartHome

Postby dezsoe » Wed Sep 13, 2017 9:27 am

This macro makes "smart homing". It homes the axes in the order defined in Configuration/General settings/Homing sequence. The main difference between the default homing and this macro is that you can define backoff for the axes. The other difference is that it handles SoftLimit. When the home position is over the SoftLimit position and SoftLimit is on, then UCCNC will give a SoftLimit error when backing off from the home position, so for the backoff it turns off the SoftLimit.

You have to add to your profile a [SmartHome] section, where you set the parameters. The G28Move<axis>=true/false option enables or disables the backoff move, and the G28Goto<axis>=<coord> value defines the backoff position. Here is a sample:

Code: Select all
[SmartHome]
G28MoveX=true
G28GotoX=0.0
G28MoveY=true
G28GotoY=0.0
G28MoveZ=true
G28GotoZ=45.0

You can call this macro with or without a Q parameter. If you omit parameter Q, then a field will control the homing (see below). If Q exists, then only one axis is homed, where Q=0..5 as X, Y, Z, A, B, C.

I put a field outside of the screen to be invisible, and a slider to control its value in the range of 0..6. 0..5 is the same as parameter Q and 6 means home all: it homes the axes in the order defined in Configuration/General settings/Homing sequence. (The field and slider number is given in SmartHomeAxisFld.) So I have a button and a slider to control which axis to home.

SmartHome.png
SmartHome.png (3.95 KiB) Viewed 29698 times

After homing the status looks like this:

SmartHomeStatus.png
SmartHomeStatus.png (7.97 KiB) Viewed 29698 times
Attachments
M20928.txt
(2.8 KiB) Downloaded 1370 times
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Macro - SmartHome

Postby dezsoe » Wed Sep 13, 2017 9:56 am

I forgot to write that my home switches are on -5 (X and Y) and on 50 (Z), so all axes move 5mm after homing.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Macro - SmartHome

Postby beefy » Wed Sep 13, 2017 7:06 pm

Thanks very much Dezsoe.

Keith
beefy
 
Posts: 449
Joined: Mon Sep 05, 2016 10:34 am

Re: Macro - SmartHome

Postby jaybyrd42 » Mon Nov 27, 2017 2:42 am

I'm having a bit of trouble understanding what I need to add to my profile to add the [SmartHome] section.

I have added the macro to my profile and am able to call it manually. I'm having a bit of trouble adding the field to define the parameters in the macro. Is it just a regular text field linked with the field number 20602?
jaybyrd42
 
Posts: 1
Joined: Mon Nov 27, 2017 1:53 am

Re: Macro - SmartHome

Postby dezsoe » Mon Nov 27, 2017 1:42 pm

Field 20602 is needed, because you have to have a numeric field which you can control with a slider. This field will contain a value 0..6, where 0..5 means X to C axis to home, or 6 for home all. If you want only the slider on the screen, then put the numeric field out of the screen (e. g. position 1111,1111).
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Macro - SmartHome

Postby Battwell » Sun Dec 03, 2017 7:44 pm

would be nicer if it would back off to an encoder index pulse :-)
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 867
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Macro - SmartHome

Postby dezsoe » Sun Dec 03, 2017 7:56 pm

Battwell wrote:would be nicer if it would back off to an encoder index pulse :-)

:) That's your job on the hardware side to synchronize home switch with the index pulse. Lot of people do it to make homing more precise.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Macro - SmartHome

Postby nikdan » Sat Dec 30, 2017 2:54 pm

Much appreciated dezsoe
nikdan
 
Posts: 8
Joined: Wed Dec 27, 2017 6:35 pm

Re: Macro - SmartHome

Postby ger21 » Sat Dec 30, 2017 2:58 pm

Now that UCCNC has built in backoff settings, is this method no longer needed? Is it the same, better, or worse? :D
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Macro - SmartHome

Postby dezsoe » Sat Dec 30, 2017 3:11 pm

After 1.2101 it's no more needed. The built-in backoff positioning is much faster. It worked fine since 1.2033 (that was the actual version when I wrote it), but now I deleted it from version 2101. It's time for it to retire... :)
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Next

Return to UCCNC TOOL BOX

Who is online

Users browsing this forum: No registered users and 1 guest