Getting started
4. Connecting home sensors
37 min
this information is intended for the {{controll}} and may not be accurate when used with another controller please refer to the documentation for your specific controller home sensors provide the machine with a reference for its position after shutdowns, step loss, and manual movements, the machine will be able to find its original position home sensors and limit sensors are not the same the difference may seem semantic, but in reality, this means that during homing, a machine must be able to move slightly beyond the switch's trigger point this is to ensure the machine decelerates after the switch is triggered this distance is determined by the homing speed and the machine's acceleration ( deceleration ) settings additionally, the home switch position may not be at the axis's limit a limit sensor is essentially the end of an axis so there is no room left the image below illustrates the difference please note that the sensor position is relevant in this context, not the sensor type the home sensor types supported by the {{controller name}} are npn and pnp, both in normally open ( {{no}} ) and normally closed ( {{nc}} ) configurations the detection method is irrelevant to the controller and can be selected based on its specifics, such as physical, inductive, or capacitive switches the {{controller name}} is designed to sink around 10ma into the sensor when it is active/closed the threshold voltage for a low or closed signal is typically < 1 4v for revision 13 and up and < 0 7v for revision 12 and lower all home sensors must have the same polarity, so all {{no}} or {{nc}} hardware configuration npn or pnp sensor? before connecting the sensor, make sure the controller is powered down next, verify that the jumpers for selecting the sensor type are set correctly the relevant jumpers are shown in the list below jumper function jp6 home1 mode npn or pnp jp7 home2 mode npn or pnp jp8 home3 mode npn or pnp jp9 home4 mode npn or pnp below is shown where these jumpers are on the controller if the jumper is in position ' n ', the sensor is npn; in position ' p ', the sensor pnp please note that sensors cannot be m ixed ; they must be either npn or pnp home inputs the {{controller name}} has 4 inputs for homing signals, one for each axis on the breakout board, behind the home inputs, are a row of connections that can be configured to either +24v or gnd depending on how you wire the sensors, you can select this using jumper jp1 wiring an inductive sensor the advantage of using an inductive sensor is that detection is contactless avoiding the wear and tear of the sensor however, they are activated by detecting a metal surface near the sensor please check the manual for the detection distances in general, most sensors will have the following color codes blue is the ground wire black is the signal wire brown is the +24v wire always check the manual of the sensors to validate the color code wiring a microswitch when using a simple switch, eg microswitch you only need two wires testing the sensor ensure that none of the sensors are currently triggered open the io tab and find the home inputs their state is indicated by the circle's color next to the input verify that the color of the switches in the non triggered state is the same and matches the software settings please note, these indicators show the logical state of the input, so either high or low it does not show the functional state detection is purely based on change of level compared to the level when the sensor is not active manually activate the home sensor for each axis and verify whether the input state changes if the switch does not trigger, verify the wiring steps if the wiring is correct, check that the sensor actually triggered; some sensors have a built in led indicator to also shows the activation home sensor active range when the controller needs to perform a homing sequence, it must know the direction to travel this is done by detecting whether the homing sensor is active at the start of the homing sequence; based on this, the controller knows which direction to travel the machine must be designed to detect this correctly failing to do this can result in damage the homing algorithm is designed to prevent the sensor from activating at the end of the homing process as a result, the machine coordinate will not be exactly zero because it accounts for the offset from the actual homing position and the sensor's non activated positions the so called 'pull off' position if you prefer to have the machine position to be exactly 0, you can add at the end of the homing macro this sub home x home x g53 g0 x0 eendsub this is, of course, an example for the x axis, but it can also be applied to other axes by using the correct axis designation software configuration homing an axis works the same for most axis types except for master slave setups ' master slave ' is sometimes also called ' gantry squaring ' or ' tandem axis ' using master slave axes with auto gantry squaring requires additional setup steps as outlined in docid\ ghhniyu vg6m3agv5azjq which cannot be skipped with all sensors wired, start the software with the machine connected open the setup tab, navigate to ' machine general ', and scroll to the ' homing ' section if the switch type is known , the setting must be set to "falling edge" for {{no}} sensors and "rising edge" for {{nc}} sensors if the switch type is unknown , the switch polarity can be determined automatically jog the machine to a position where none of the switches are triggered press "auto detect polarity" and "ok" to use the current values of the home inputs as inactive if the state of all home inputs is not equal , an error will be displayed this can happen because the sensor types are not identical or mixed, or because some inputs are triggered while others are not perhaps some switches are accidentally activated if all home inputs are wired to the first home input, the " use home input for x axis as home input for all axes " option must be checked this option is not supported with tandem axes because, with both motors running simultaneously, it is impossible to know which sensor was triggered next, scroll to the motors section all homing options here can be configured on a per axis basis these configuration steps assume that the maximum velocity and maximum acceleration have already correctly been set both these settings may influence the homing procedure and changing them later may induce changes to the homing sequence by default, the homing velocit y is set to 0, in this case, manual appears in the setup for that axis executing a home command for this axis results in the current position being set as 0 entering a non zero positive value ensures a proper home movement will be executed a high homing velocity results in a faster homing sequence but also increases the distance the axis moves past the sensor trigger point when the sensor triggers during homing, the axis will decelerate according to the value entered in maximum acceleration the distance covered results from the acceleration, homing velocity, and docid\ tun7rde84cwjm3nptdibt typical values are around 10mm/s the precise/safe homing velocity is the velocity at which the machine is moved out of the sensor's triggered area typical values are roughly 10% of the homing velocity; the sensor untriggers at that point, which is used as the home position any inaccuracies caused by the first faster movement are therefore not translated into an inaccurate home position the homing sequence needs to know whether to home in a positive or negative direction if the home position is at the machine's negative limit, invert the direction if it is at the positive limit, it should not be inverted this is set by checking inverted homing direction lastly, the 'home position' need not be at the sensor trigger point an offset can be applied to decouple the sensor position from the home position the value entered here represents the trigger point's position relative to the home position tandem axes / master slave / gantry squaring in many cases, it is helpful to use two separate motors on a gantry, perhaps due to weight and size, or to avoid the gantry being no longer square during the operation of the machine there are three modes to do this connecting two motor drivers to one output advantages cheap and simple disadvantage once the gantry is misaligned for any reason, this needs to be fixed manually using two axes output in master slave or tandem setup (slave follows master) advantages complete control of master and slave axis position disadvantage needs an extra axis output master slave setup, but with so called 'gantry squaring' advantages the gantry can automatically square itself after homing, improving the machine's results disadvantage it needs an additional homing sensor, and setup is a little more complicated the rest of the document will only discuss the second and third options as the first option required no additional setup compared to a regular axis step 1 axes setup the first step in setting up this is to set up the axes depending on the controller, any of the up to 3 extra axes can be configured as a slave axis, as shown in the image below please note that typically, only one of these dropdown boxes will be displayed the options relevant to setting this up are selecting one of three options slave to x axis slave to y axis slave to z axis for this example, we will use the a axis as a slave to the y axes in the setup, this will look like this step 2 macro modifications changes to the macro must be made to home axes used in a tandem configuration a tandem configuration contains two axes, one master and one slave axis the master axis is the axis that can be actively controlled, and the slave follows the position programmed to the master in this example, the y axis forms a tandem pair with the a axis the y is the master, and the a axis follows as the slave in the macro, both of the homing macros need to be changed on the operate tab of the software, click " macro ", and subsequently " edit file " there are two options tandem axes with one homing sensor use gantry squaring with two homing sensors option 1 only tandem axes with one homing sensor since there is only one homing sensor, there must be no separate homing of the slave axis we can modify this in the macro called home a in this case, we can either remove the line home a or comment this out original sub home a home a endsub modified sub home a ; home a endsub option 2 use gantry squaring with two homing sensors when actual gantry squaring is to be performed, two macros need to be modified, ' home y ' and ' home a ' first, modify ' home y ' original sub home y home y endsub modified sub home y hometandem y endsub next, as before, modify ' home a ' original sub home a home a endsub modified sub home a ; home a endsub this starts tandem homing when the y axis is homed and does not re home the a axis separately please note, the macro home all is used to indicate the homing sequence sub home all gosub home z gosub home y gosub home x gosub home a gosub home b gosub home c msg "home complete" endsub when pressing 'home all', each axis is homed sequentially, the default sequence is z, y, x, a, b, c if the machine needs a different order, this can be changed in the macro as well by changing the order of the lines in home all save the file and close the editor press "reload file" to load the changes into the software gantry squaring when using two homing sensors for homing, it's likely that there is a small difference in the position in reference to the gantry as part of gantry squaring this can be addressed in the setup of each axes in the setup tab navigate to ' machine general ' and scroll to the motors section when using gantry squaring, the home position settings for both the master and slave are used for both homing sensor compensation and squaring maximum distance slave and master axis setting the maximum distance between the master and slave after homing to a low enough value is crucial both axes move simultaneously during every step of the homing procedure except the last movement this last movement moves the slave axis to the position of the master this is the actual squaring movement if the difference between these axes is too high, the machine may be too rigid to perform this movement most machines may only be able to independently move between 1 mm and 20 mm before binding or damage occurs the more rigid the machine, the smaller this distance should be if a large difference is found after homing, this likely indicates that the homing procedure failed testing things to observe during testing the first thing to watch out for is the direction the machine homes if this is incorrect, stop the machine using either the e stop or by pressing reset if the homing direction is incorrect, see if the messages show " home sensor active, starting with second move " this means that the homing inputs trigger edge setting was set wrong if this message does not occur, the homing direction should be inverted in the setup, as described in the docid\ tjyqq9lpp5zo84wywqhgm chapter once the machine moves in the correct direction when homing, let the machine go home completely keep near the e stop switch if the machine moves past the homing sensor without stopping, abort using the e stop switch or the reset button if the machine homes correctly, the axis will have moved to the direction of the home sensor, upon triggering it will decelerate and move back out of the sensor after the sensor un triggers, the machine will again delecerate and come to a standstill step 1 testing homing sensors ensure that none of the sensors are currently triggered open the io tab and find the home inputs their state is indicated by the circle's color next to the input check that the color of the switches in the non triggered state is the same and matches the setting for home inputs trigger edge if the setting was set to falling edge, all indicators must be on, if rising edge was set, the indicators must be off please note, this indicators show the logical state of the input, so either high or low it does not show the functional state detection is purely based on change of level compared to the level when the sensor is not active manually activate the home sensor for each axis and check if the state of the input changes if the switch does not trigger, check the docid\ tjyqq9lpp5zo84wywqhgm steps if the wiring is correct, check that the sensor actually triggered, some sensors have a built in led indicator to show the activation step 2 manually testing gantry squaring when gantry squaring is used it's possible to manually test each of the 4 sequences of gantry squaring please note, this is only for testing each step not for normal homing these steps are normally automatically executed when tandemhome function is called in home macro use them in mdi for testing and understanding preparetandemhome y , both slave and master are moved towards the home sensor the axes stop when both axes are on the sensor when one axis reaches the home sensor first, this one is stopped, and the other moves further this movement is done when both axes have reached the sensor home y , home the y, the slave will just follow the y home sensor is used because the y is already on the sensor, the move will be toward the machining area away from the sensor the position is latched at the moment the sensor de activates then the movement stops and then the correct position is calculated end set for the y home a , exactly the same, but now the a home sensor is used and the a position is set when done, a is no longer a slave because the position is different from y this is indicated by the message "slave decoupled from master" the following command will restore the master slave coupling at this point, both master and slave have a correct known position but are probably different it can be equalized by moving the slave axis to the position of the a axis this is done using the command moveslavetomaster a the slave will move to the same position as the master the gantry is squared and the homing procedure is done (if the gantry is not square, adjust the home positions in the setup) step 3 home each axis keep near an e stop switch and start the homing procedure for each axis separately by going to the home menu and pressing the home button for the accompanying axis remember that the order of homing operations is usually important to avoid collisions the image below shows the homing menu at the bottom of the operate tab the homing menu has separate buttons for manually homing each axis repeat this manual homing each axis after all axes are tested separately, press home all to verify the order of the homing operations optionally correcting the homing position after homing after the machine has been homed, the actual machine coordinate position will be slightly away from the home position point, this difference is the result of the machine needing to decelerate after the home sensor triggers this does not mean that the home position is inaccurate a side effect of this behavior is that the sensor is always un triggered after the home operation for that axis is completed this is especially important in setups that use all homing switches to be connected to one input if, for any reason, it is preferred that the machine is positioned at position 0 of that axis, it is possible to add a command to the homing functions there are two ways of doing this move to position 0 of the axis after homing it for example, for the x axis, the standard macro function can be modified so that after homing the axes move back to their actual 0 position original sub home x home x endsub modified sub home x home x g0 g53 x0 endsub keep in mind that for other axes the 'x0' needs to be changed to its respective axis depending on the machine, you can optionally also add the feed rate by replacing the g0 with g1 and adding an f word g1 g53 x0 f50 move to position 0 for all axes after homing the second option is to execute the move when all separate axes have been homed this is also preferred when all homing inputs are connected to one input in that case, an extra line is added for all axes below is an example of the home all function original sub home all gosub home z gosub home y gosub home x gosub home a gosub home b gosub home c msg "home complete" endsub modified sub home all gosub home z gosub home y gosub home x gosub home a gosub home b gosub home c g0 g53 x0 y0 z0 msg "home complete" endsub