. .
Page 1 of 2 12 LastLast
  1. #1
    Is it 'auto-squaring', 'auto-racking' or 'auto-un-racking'? Anyway the 'master' version 2.8 of LinuxCNC has a lot of differences under the bonnet compared to the current stable 2.7. The reason I wanted to upgrade is the ability to separately, but simultaneously, home the two motors running the X axis leadscrews on my gantry type CNC router. By allowing the two motors to stop independently, each on it's own limit switch, it is possible to fine tune the squareness between the X and Y axes. Obviously all other movements of the two motors must be synchronised to avoid a nasty mess!

    Unless you are a Linux whiz, quite a lot of the LinuxCNC website and forum seems a bit daunting but I gritted my teeth and decided to have a go. It actually turned out to be much easier than I'd expected. I'm not going into full details, the relevant links are at the bottom of this post but these notes may be of help to non-expert Linux users like me.

    My machine uses a cheap Chinese breakout board with outputs and inputs for 4 motors and 4 limit switches labelled XYZA. There are two microswitches on each axis configured as both limit and homing switches. Each pair is connected in series and use the inputs in 'Normally Closed' operation. This is much safer than having them in parallel using 'Normally Open' as a broken wire will show up immediately as a limit switch error instead of waiting quietly to laugh at you when your machine crashes through the offending switch.

    1) Clone your hard drive! Put the original in a safe place and work with the clone. That way you can always revert to the unmolested version of your machine if it all goes pear shaped. It could all end in tears if you don't bother with this step. Alternatively install a new HDD in your machine and start from scratch by installing the current stable release version 2.7.

    2) Whether you have your existing install or a new one you now have to upgrade to v2.8. For us non-expert Linux users the method is unfamiliar. The idea is that you change where Linux goes looking for sources of upgrades to it's installed software. This is done by opening the Synaptic Package Manager found in the Application Manager under the System option and viewing the list of repositories (Linuxspeak for online software sources) that Linux can look at. By unchecking the repositories shown for v2.7 and checking the ones for v2.8, refreshing the list of packages and selecting LinuxCNC for upgrade (all done within Synaptic) you will upgrade from v 2.7 to v2.8. Only select LinuxCNC for upgrade as you don't want to upgrade the whole operating system.

    3) When you next start LinuxCNC it will ask if you want it to update your configuration files to the new version or, for a clean install, just start up looking much as it always does. Just check the version really is 2.8 so you know the upgrade has gone ahead. Your existing configuration files, created when you last ran the Stepconf Wizard, will be updated and your machine will likely work the same as ever. Otherwise run Stepconf and set up your machine from scratch. It helps to have a fully working machine setup at this stage so you know that any problems are due to your later work on the .hal and .ini files and not a fault with the basic setup.

    4) If you only have 3 sets of homing switches, one for each axis, you will now need to install a fourth set to give separate inputs for the two sides of your relevant axis (X in my case).

    5) When you run the CNC Stepconf Wizard you save the setup with a specific name and can create several different setups for the same machine if you wish. Starting LinuxCNC actually involves selecting which of these files you run by selecting the relevant desktop icon. Normally you would only have one of these.
    The relevant files are stored in a directory with the name you used for saving the configuration which will be inside a directory called 'configs'. For me the full path is kit/linuxcnc/configs/kit-cnc You will now edit the files equivalent to 'kit-cnc.ini' and 'kit-cnc.hal' in that directory.

    These files are created by the Stepconf Wizard and once you have edited them manually it is my understanding that you must not run the stepconf wizard again to make any other adjustments (to acceleration rates or soft limits for example) or you will overwrite your manual changes. Stepconf has not been updated to cope with all the niceties of v2.8 yet so any future changes to your machine config will have to be done by further manual editing of the .hal and .ini files. This is one of the reasons for making sure you have your machine working as you want it before starting this process.

    My linuxCNC computer has no chair next to it so I copied the relevant files onto a USB thumb drive and took them off to my Windows PC and edited them using Notepad++. I made sure to keep copies of the original versions of the files and the edited ones on the thumb drive. You can edit the files in any simple text editor but NOT a word processor which will add a thousand tons of additional formatting data to the file.

    6) The scary bit! If you already have homing set up and working then after you have carefully followed the instructions it should still work. Some people have made up test rigs with motors, cams and microswitches to confirm the motors do as they should before testing 'live'. I removed my motors, sat them on the bed of the machine and manually tweaked the microswitches to see if things happened in roughly the right order before taking the plunge. I know from it's earliest days that my machine will stall it's motors before throwing itself apart so I wasn't too worried. You must do as you think fit. For me it worked perfectly first time.

    One of my X axis microswitches is operated by a finely adjustable end stop. OK, it's an M6 bolt through a threaded hole in a piece of aly angle with a locknut. Measure the squareness of the gantry, adjust the nut, home the axis, repeat as required. Simple!

    The detailed instructions for editting the files can be found from this links to the LinuxCNC forum:

    https://forum.linuxcnc.org/49-basic-...cnc-2-8-master

    Note that there is one addendum: Near the start of the .hal file is the line:
    loadrt stepgen step_type=0,0,0
    Change this as shown below to take account of having 4 joints instead of 3:
    loadrt stepgen step_type=0,0,0,0

    Example edited files are here:

    https://forum.linuxcnc.org/49-basic-...l-motor-gantry

    Good luck!

    Kit
    Last edited by Kitwn; 09-04-2019 at 04:50 AM.

  2. The Following 6 Users Say Thank You to Kitwn For This Useful Post:


  3. #2
    Clive S's Avatar
    Lives in Marple Stockport, United Kingdom. Last Activity: 12 Hours Ago Forum Superstar, has done so much to help others, they deserve a medal. Has been a member for 9-10 years. Has a total post count of 3,333. Received thanks 618 times, giving thanks to others 78 times. Made a monetary donation to the upkeep of the community. Is a beta tester for Machinists Network features.
    4) If you only have 3 sets of homing switches, one for each axis, you will now need to install a fourth set to give separate inputs for the two sides of your relevant axis (X in my case).
    It might be worth pointing out that the homing sequence in Lcnc is defined in the ini file under each axis as in this example:-

    This is a sample from a working ini file of one axis. (in linuxcnc 2.8 there are (axis) and (joints) read joints as a motor as an axis can have more that one motor.

    [AXIS_1]
    TYPE = LINEAR
    HOME = 0.0
    MAX_VELOCITY = 33.2502660021
    MAX_ACCELERATION = 1000.0
    STEPGEN_MAXACCEL = 1250.0
    SCALE = 320.0
    FERROR = 1
    MIN_FERROR = .25
    MIN_LIMIT = -0.001
    MAX_LIMIT = 200.0
    HOME_OFFSET = 0.000000
    HOME_SEARCH_VEL = -10.000000
    HOME_LATCH_VEL = 1.562500
    HOME_IGNORE_LIMITS = YES
    HOME_SEQUENCE = 2

    by changing the sequence you change the number that the axis will home ie 0 will home first then 1 will home next etc you can also home two or more together by using the same number. WITH dual homing ie gantry the numbers have to be both -ve ie say -2
    ..Clive
    The more you know, The better you know, How little you know

  4. The Following 2 Users Say Thank You to Clive S For This Useful Post:


  5. #3
    Clive,
    Good point. The -ve sign makes sure the first motor to home waits for the second one to home before the two then move to their zero position together. Both entries for the gantry motors must end with identical lines such as HOME_SEQUENCE = -2 for the sequence to work correctly.
    Note that HOME_SEQUENCE = 0 should be used for the Z axis to home Z first and lift it clear of obstructions before X and Y begin to move.

    Kit

  6. The Following 2 Users Say Thank You to Kitwn For This Useful Post:


  7. #4
    I suppose it was bound to happen. I wanted to change my X axis upper soft limit so I did what I've always done: ran Stepconf and changed it. Opened LinuxCNC and ran homing. Only one X axis motor started moving, the E-stop did nothing (that'll be something else to investigate ASAP) and the gantry alignment looked very sorry for itself by the time I turned off the motor PSU.

    Once you set up a two motor axis as described above you MUST NOT run stepconf but make the relevant edits to the .hal and .ini files manually instead. I have saved versions of the .hal and .ini files for my machine so reloading was no problem. Fortunately there's no real damage done as the motor stalled before bending anything but the gantry-to-carriage bolts have clearly moved as the gantry will square itself when homed but visibly 'relaxes' when the motors are disabled with one side carriage moving a few millimetres along it's rail. An hour or so with a spanner and the big square required tomorrow morning.

    I think I might create a new wallpaper for my LinuxCNC computer that has "DO NOT RUN STEPCONF!" written on it in big shiny letters. I can't be the only person to have suffered this lapse of concentration and if there's a way of easily disabling stepconf or preventing it from overwriting the relevant files I'd love to hear it.

    Kit

    PS As you may have realised my machine does not use fabulously rigid Hi-Win rails on its axes but has fully supported 20mm round rails with two linear bearings on each side screwed to a plate which the gantry then bolts to. There is about +- 3mm of easy movement between the carriages with the motors disabled. Once it's squared and the motors are energised everything is nice and stiff and the cutting is sufficiently accurate, but the auto-squaring is definitely a good improvement for a machine with so much slack on a two-motor axis.
    Last edited by Kitwn; 16-04-2019 at 02:43 PM.

  8. The Following 2 Users Say Thank You to Kitwn For This Useful Post:


  9. #5
    Clive S's Avatar
    Lives in Marple Stockport, United Kingdom. Last Activity: 12 Hours Ago Forum Superstar, has done so much to help others, they deserve a medal. Has been a member for 9-10 years. Has a total post count of 3,333. Received thanks 618 times, giving thanks to others 78 times. Made a monetary donation to the upkeep of the community. Is a beta tester for Machinists Network features.
    Once you set up a two motor axis as described above you MUST NOTl run stepconf but make the relevant edits to the .hal and .ini files manually instead.
    Well as you now know stepconf is only to be used once and as is says at the top of the ini file it generates. It gives the warning not to not to rerun as it will overwrite any edits you have done.

    But at least you had the foresight to make copies on the hal and ini files

    I take it you know how to alter the homing squaring in software.

    Keep up the good work its nice to see other Lcnc users on here.
    ..Clive
    The more you know, The better you know, How little you know

  10. The Following User Says Thank You to Clive S For This Useful Post:


  11. #6
    Clive,
    Well, yes it does say that but before this update I always used stepconf to make minor adjustments having never got my head round the inner workings. I was always careful to use the 'update existing file' option. Keeping safe copies of software before making changes is part of my DNA so it was only the mechanical effects I was worried about.

    I'm sure I'm not the only user of LinuxCNC who is more interested in cutting wood than learning the intricacies of it's file editting, and I say that as someone with several years experience of designing and building assorted projects involving some quite complex Arduino code (never got as far as writing all of anything in C++ though).

    Anyway we're all back to normal now with everything squared up again. Altering the homing squaring doesn't need alterations to the software, just a tweak of the microadjustable switch actuator shown here:

    Click image for larger version. 

Name:	MicroadjustableEndstop.jpg 
Views:	658 
Size:	106.5 KB 
ID:	25671

  12. The Following 2 Users Say Thank You to Kitwn For This Useful Post:


  13. #7
    Clive S's Avatar
    Lives in Marple Stockport, United Kingdom. Last Activity: 12 Hours Ago Forum Superstar, has done so much to help others, they deserve a medal. Has been a member for 9-10 years. Has a total post count of 3,333. Received thanks 618 times, giving thanks to others 78 times. Made a monetary donation to the upkeep of the community. Is a beta tester for Machinists Network features.
    Anyway we're all back to normal now with everything squared up again. Altering the homing squaring doesn't need alterations to the software, just a tweak of the microadjustable switch actuator shown here:
    Yes that is one way. But is far simpler to just edit the ini file as you can get very fine adjustments. . (This is for the benefit of others to see that the config files are just plain text)


    # Generated by stepconf 1.1 at Sun Jul 1 16:50:39 2018
    # If you make changes to this file, they will be overwritten when you run stepconf again
    # This file has been edited

    [EMC]
    MACHINE = test_for_slaved_axis
    DEBUG = 0
    VERSION = 1.0

    [DISPLAY]
    DISPLAY = axis
    EDITOR = gedit
    POSITION_OFFSET = RELATIVE
    POSITION_FEEDBACK = ACTUAL
    ARCDIVISION = 64
    GRIDS = 10mm 20mm 50mm 100mm
    MAX_FEED_OVERRIDE = 1.2
    MAX_JOG_OVERRIDE = 1.2
    MIN_SPINDLE_OVERRIDE = 0.5
    MAX_SPINDLE_OVERRIDE = 1.2
    DEFAULT_LINEAR_VELOCITY = 2.50
    MIN_LINEAR_VELOCITY = 0
    MAX_LINEAR_VELOCITY = 25.00
    DEFAULT_ANGULAR_VELOCITY = 2.50
    MIN_ANGULAR_VELOCITY = 0
    MAX_ANGULAR_VELOCITY = 25.00
    INTRO_GRAPHIC = linuxcnc.gif
    INTRO_TIME = 5
    PROGRAM_PREFIX = /home/clive/linuxcnc/nc_files
    INCREMENTS = .5mm .1mm .05mm .01mm .005mm
    PYVCP = custompanel.xml


    [FILTER]
    PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
    PROGRAM_EXTENSION = .py Python Script
    png = image-to-gcode
    gif = image-to-gcode
    jpg = image-to-gcode
    py = python

    [TASK]
    TASK = milltask
    CYCLE_TIME = 0.010

    [RS274NGC]
    PARAMETER_FILE = linuxcnc.var

    [EMCMOT]
    EMCMOT = motmod
    COMM_TIMEOUT = 1.0
    COMM_WAIT = 0.010
    BASE_PERIOD = 100000
    SERVO_PERIOD = 1000000

    [HAL]
    HALFILE = wal_slaved_axis.hal
    HALFILE = custom.hal
    POSTGUI_HALFILE = postgui_call_list.hal

    [TRAJ]
    COORDINATES = XYZ
    LINEAR_UNITS = mm
    ANGULAR_UNITS = degree
    CYCLE_TIME = 0.010
    DEFAULT_LINEAR_VELOCITY = 2.50
    MAX_LINEAR_VELOCITY = 25.00

    [EMCIO]
    EMCIO = io
    CYCLE_TIME = 0.100
    TOOL_TABLE = tool.tbl

    [KINS]
    KINEMATICS = trivkins coordinates=XXYZ kinstype=BOTH
    JOINTS = 4

    [AXIS_X]
    MAX_VELOCITY = 25.0
    MAX_ACCELERATION = 750.0
    MIN_LIMIT = -0.001
    MAX_LIMIT = 200

    [JOINT_0]
    TYPE = LINEAR
    # final home position machine-unit/sec
    HOME = 70
    MIN_LIMIT = -0.001
    MAX_LIMIT = 200
    MAX_VELOCITY = 25.0
    MAX_ACCELERATION = 750.0
    STEPGEN_MAXACCEL = 937.5
    SCALE = 320
    FERROR = 1
    MIN_FERROR = .25

    HOME_OFFSET = 0.1 # use this to square the gantry

    # machine-units per sec next 3 lines
    HOME_SEARCH_VEL = 10 This is the speed it searches for the home switch use a -ve number to revervse
    HOME_LATCH_VEL = -6 This the the speed it use to back off the switch use a -ve to reverse
    HOME_FINAL_VEL = 20 This is the speed it will travel to the final HOME position

    HOME_USE_IIDEX = NO

    HOME_SEQUENCE = -1 # has to be -ve for gantry

    [JOINT_1]
    TYPE = LINEAR
    # final home position machine-unit/sec
    HOME = 70
    MIN_LIMIT = -0.001
    MAX_LIMIT = 200
    MAX_VELOCITY = 25.0
    MAX_ACCELERATION = 750.0
    STEPGEN_MAXACCEL = 937.5
    SCALE = 320
    FERROR = 1
    MIN_FERROR = .25

    HOME_OFFSET = 0.5 # use this to square the gantry

    # machine-units per sec next 3 lines
    HOME_SEARCH_VEL = 10
    HOME_LATCH_VEL = -6
    HOME_FINAL_VEL = 20

    HOME_USE_IIDEX = NO

    HOME_SEQUENCE = -1 # has to be -ve for gantry

    [AXIS_Y]
    MAX_VELOCITY = 25.0
    MAX_ACCELERATION = 750.0
    MIN_LIMIT = -0.001
    MAX_LIMIT = 200.0

    [JOINT_2]
    TYPE = LINEAR
    HOME = 0.0
    MAX_VELOCITY = 25.0
    STEPGEN_MAXACCEL = 937.5
    SCALE = 80.0
    FERROR = 1
    MIN_FERROR = .25
    HOME_OFFSET = 0.000000
    HOME_SEARCH_VEL = 0
    HOME_LATCH_VEL = 0
    HOME_USE_IIDEX = NO
    HOME_SEQUENCE = 0

    [AXIS_Z]
    MAX_VELOCITY = 25.0
    MAX_ACCELERATION = 750.0
    MIN_LIMIT = -100.0
    MAX_LIMIT = 0.001

    [JOINT_3]
    TYPE = LINEAR
    HOME = 0.0
    MAX_VELOCITY = 25.0
    STEPGEN_MAXACCEL = 937.5
    SCALE = 80.0
    FERROR = 1
    MIN_FERROR = .25
    HOME_OFFSET = 0.000000
    HOME_SEARCH_VEL = 0
    HOME_LATCH_VEL = 0
    HOME_USE_IIDEX = NO
    HOME_SEQUENCE = 0
    Last edited by Clive S; 24-02-2021 at 09:31 AM. Reason: Added in BLUE for explanation
    ..Clive
    The more you know, The better you know, How little you know

  14. The Following 3 Users Say Thank You to Clive S For This Useful Post:


  15. #8
    Thanks Clive, I didn't know about that way of setting the squaring.
    I have plans to make some new homing switches using latching Hall effect sensors and two magnets attached to the moving gantry. Using latching sensors will overcome the problems associated with the gantry overshooting the sensor while decelerating and might be more accurate/repeatable than conventional Hall sensors. That design may be less able to use the microadjustable switch actuator shown above so your method may well become necessary.

    Kit

  16. The Following User Says Thank You to Kitwn For This Useful Post:


  17. #9
    Hi folks,
    I am building such a gantry with two Y-axis motors/joints. I want to use these typical chinese proximity sensors as limit switches and homing switch.

    In order to have the gantry square every time, the two sensors on the Y-Axes need to be precisely repeatable. So I wondered if any of you have experience whether it is better to approach the limit axially or radially (the cutout in the metal in the lower image shall act as an "open" of a NC sensor - with the axial approach this is not possible, of course.)

    Where to those sensors detect more reliable?

    Click image for larger version. 

Name:	7B2C4E03-CF99-40D1-BD7C-21DF5F2C6CFD.jpeg 
Views:	515 
Size:	1.13 MB 
ID:	25751

    Thanks for your insights!

    Michael.

  18. #10
    Clive S's Avatar
    Lives in Marple Stockport, United Kingdom. Last Activity: 12 Hours Ago Forum Superstar, has done so much to help others, they deserve a medal. Has been a member for 9-10 years. Has a total post count of 3,333. Received thanks 618 times, giving thanks to others 78 times. Made a monetary donation to the upkeep of the community. Is a beta tester for Machinists Network features.
    Welcome to the forum Michael

    I prefer the target going past the end of the sensor PNP NO as it is quite easy to break the sensor head on. PNP are easier to use with standard Mesa cards like 7i96 7i76 7i92 etc.

    Of course as you probably know with linuxcnc 2.8 you adjust the home offsets to square the gantry in the ini file.
    Last edited by Clive S; 05-05-2019 at 11:26 PM.
    ..Clive
    The more you know, The better you know, How little you know

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Why is Y axis "squaring" necessary only with twin motors?
    By MartinS in forum Linear & Rotary Motion
    Replies: 10
    Last Post: 09-08-2017, 10:10 PM
  2. What do I need to run LinuxCNC???
    By gatesy in forum LinuxCNC (EMC)
    Replies: 22
    Last Post: 02-12-2015, 07:42 PM
  3. Setup for squaring twin X-axis gantry
    By routercnc in forum Gantry/Router Machines & Building
    Replies: 20
    Last Post: 26-03-2014, 11:13 PM
  4. Seeking some practical squaring advice.
    By Wal in forum Gantry/Router Machines & Building
    Replies: 12
    Last Post: 09-01-2014, 12:04 AM
  5. How many LinuxCNC/EMC users do we have?
    By birchy in forum LinuxCNC (EMC)
    Replies: 16
    Last Post: 30-12-2012, 08:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •