Boxford 125 lathe Tool Changer Comp FERROR (SOLVED)

More
5 years 11 months ago #188127 by Aciera
As I see it, there is only one place where the backwards locking move comes in:

position_req -= ((moves / divisor) + fudge_factor);

Which is the same as

position_req = position_req - ((moves / divisor) + fudge_factor);

So as the divisor used to be 2 we got the 1.5 degrees for a single move:
(1/2+1)=1.5
and since I now changed the divisor to 1 it is now 1/1+1=2 degrees.

So I guess each forward move is a bit too long to get past the locking mechanism and then the toolchanger is moved backwards by the number of moves (moves) times the extra plus the "fudge factor".

The position is not reset but if the motor looses steps it does not matter since the next move just starts from where it is sitting against the lock. As there is no position feedback.

Just thought of that now.

Please Log in to join the conversation.

More
5 years 11 months ago #188132 by Clive S

Aciera wrote: As I see it, there is only one place where the backwards locking move comes in:

position_req -= ((moves / divisor) + fudge_factor);

Which is the same as

position_req = position_req - ((moves / divisor) + fudge_factor);

So as the divisor used to be 2 we got the 1.5 degrees for a single move:
(1/2+1)=1.5
and since I now changed the divisor to 1 it is now 1/1+1=2 degrees.

So I guess each forward move is a bit too long to get past the locking mechanism and then the toolchanger is moved backwards by the number of moves (moves) times the extra plus the "fudge factor".

The position is not reset but if the motor looses steps it does not matter since the next move just starts from where it is sitting against the lock. As there is no position feedback.

Just thought of that now.


Thank you that all makes sense. So this means it can be moved past the locking mechanism with a bit of leeway and then reverse far enough to always stall the motor .

I will now put the turret back together and hopefully it is a job well done.

I will mark it as solved

Please Log in to join the conversation.

More
5 years 11 months ago #188133 by Aciera
Also note that now I don't see any reason to use the A-axis anymore. So I changed the INI and HAL section:
Code:
# # Boxford ATC Clive # [EMC] MACHINE = Boxford DEBUG = 0 VERSION = 1.1 [DISPLAY] DISPLAY = axis EDITOR = gedit POSITION_OFFSET = RELATIVE POSITION_FEEDBACK = ACTUAL ARCDIVISION = 64 GRIDS = 10mm 20mm 50mm 100mm MAX_FEED_OVERRIDE = 1.2 MIN_SPINDLE_OVERRIDE = 0.5 MAX_SPINDLE_OVERRIDE = 1.2 DEFAULT_LINEAR_VELOCITY = 15 MIN_LINEAR_VELOCITY = 5 MAX_LINEAR_VELOCITY = 20 #MAX_ANGULAR_VELOCITY = 1 INTRO_GRAPHIC = linuxcnc.gif INTRO_TIME = 5 PROGRAM_PREFIX = /home/cnc/linuxcnc/nc_files INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm PYVCP = custompanel.xml LATHE = 1 [KINS] JOINTS = 2 KINEMATICS = trivkins coordinates=XZ [FILTER] PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image PROGRAM_EXTENSION = .py Python Script PROGRAM_EXTENSION = .nc,.tap G-Code File 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 BASE_PERIOD = 100000 SERVO_PERIOD = 1000000 [HAL] HALFILE = Boxford.hal HALFILE = custom.hal POSTGUI_HALFILE = postgui_call_list.hal [TRAJ] COORDINATES = X Z LINEAR_UNITS = mm ANGULAR_UNITS = degree DEFAULT_LINEAR_VELOCITY = 10 MAX_LINEAR_VELOCITY = 25.00 [EMCIO] EMCIO = io CYCLE_TIME = 0.100 TOOL_TABLE = tool.tbl [AXIS_X] MAX_VELOCITY = 25.0 MAX_ACCELERATION = 750.0 MIN_LIMIT = -0.001 MAX_LIMIT = 200.0 [JOINT_0] TYPE = LINEAR HOME = 0.0 MIN_LIMIT = -0.001 MAX_LIMIT = 200.0 MAX_VELOCITY = 25.0 MAX_ACCELERATION = 750.0 STEPGEN_MAXACCEL = 937.5 SCALE = 400 FERROR = 1 MIN_FERROR = .25 HOME_OFFSET = 0.0 [AXIS_Z] MAX_VELOCITY = 25.0 MAX_ACCELERATION = 750.0 MIN_LIMIT = -100.0 MAX_LIMIT = 0.001 [JOINT_1] TYPE = LINEAR HOME = 0.0 MIN_LIMIT = -100.0 MAX_LIMIT = 0.001 MAX_VELOCITY = 25.0 MAX_ACCELERATION = 750.0 STEPGEN_MAXACCEL = 937.5 SCALE = 400.0 FERROR = 1 MIN_FERROR = .25 HOME_OFFSET = 0.0
Code:
################# # ATC ################# setp stepgen.2.position-scale 35 setp stepgen.2.steplen 1 setp stepgen.2.stepspace 0 setp stepgen.2.dirhold 35000 setp stepgen.2.dirsetup 35000 setp stepgen.2.maxaccel 8 #net aenable joint.2.amp-enable-out => stepgen.2.enable ########################################################### # loading the toolchange component in .hal file ########################################################### loadrt toolchanger addf toolchanger servo-thread net tool-change iocontrol.0.tool-change => toolchanger.toolchange net tool-changed iocontrol.0.tool-changed <= toolchanger.toolchanged net tool-number iocontrol.0.tool-prep-number => toolchanger.toolnumber net tool-oldnumber iocontrol.0.tool-number => toolchanger.currenttoolnumber net apos-cmd toolchanger.position-cmd => stepgen.2.position-cmd #net ahomed joint.2.homed => toolchanger.ishomed net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared net estop-out <= iocontrol.0.user-enable-out net estop-ext => iocontrol.0.emc-enable-in => toolchanger.ishomed => stepgen.2.enable

[edit]
Make sure you check the "stepgen.2.position-scale" and connect "toolchanger.ishomed" and "stepgen.2.enable" the way you want.

Please Log in to join the conversation.

More
5 years 11 months ago #188141 by Clive S
If we change the A axis to linear won't it then do steps rather than angles. The turret has different angle between odd and even numbers ?

Please Log in to join the conversation.

More
5 years 11 months ago #188180 by Aciera
The step generator does not know about angles or distances. It only gets the commanded position from the component and then calculates the required number of steps according to the scale (pulses per unit) and its current position. It then put out the steps within the limits of maximum acceleration and velocity. If the commanded position is larger than the current position it drives the DIR pin low otherwise it drives it high. The motion planner does not need to know about the tool changer at all and thus it does not need to be an axis.


The two different angles are entered in the "param" section as "odd_move" and "even_move".
The component adds "odd" or "even" moves to derive the required position depending on whether the current toolnumber is even or not. It then calculates the required number of moves and starts with an odd_move if the currenttoolnumber is even.

Code:
param rw float odd_move = 44.4 "distance from odd tool station to even one"; param rw float even_move = 48 "distance from even tool station to odd one";

[edit]
Note that I doubled the original angles (22.2° and 24°) as the trick with using half-angles was only there to avoid unwanted backward moves.
The angles sum up to (44.4°+48°)x4=368.8° so actually more than a full turn because of the need to get past the locking mechanism.
[/edit]

Code:
if(currenttoolnumber == 2 || currenttoolnumber == 4 || currenttoolnumber == 6 || currenttoolnumber == 8) bEven = true; if(currenttoolnumber < toolnumber) moves = toolnumber - currenttoolnumber; else moves = (8 - currenttoolnumber) + toolnumber; bToggle = bEven; while(index < moves) { if(bToggle) position_req += even_move; else position_req += odd_move; index++; bToggle = !bToggle; }

Please Log in to join the conversation.

More
5 years 11 months ago #188196 by Clive S
Ok just when I thought I was getting to the end :P

You have given me more homework to test out. I will save my config and see how it goes without the A axis.

I will report back.

You have gone more that above with your help in this. Thanks

Please Log in to join the conversation.

More
5 years 11 months ago #188198 by Aciera

Ok just when I thought I was getting to the end


Ha Ha, it will NEVER end! :evil:

Please Log in to join the conversation.

More
5 years 11 months ago #188200 by Clive S

Aciera wrote:

Ok just when I thought I was getting to the end


Ha Ha, it will NEVER end! :evil:


Ha very good You should not take the piss out of a 74 year OAP. ;)

Now I am trying to find out how to auto home the toolchanger.ishomed When I don't have an axis in the ini file ?

Please Log in to join the conversation.

More
5 years 11 months ago #188212 by Aciera
Code:
net estop-ext => iocontrol.0.emc-enable-in => toolchanger.ishomed => stepgen.2.enable


I connected it to the machine enable so its "homed" as soon as you start the machine. Since it is not an axis it does not have a real "homing" routine. Does it not work that way?

[edit]

I think the homing might have been a leftover from the original use to drive a tool changer with a sensor so it could actually home itself before use. Since yours does not have a sensor there is no point in homing as the system has no feedback. Your original INI only had immediate homing so might as well just enable it when you start the machine. At least I think it should work.

Please Log in to join the conversation.

More
5 years 11 months ago #188216 by Clive S

Aciera wrote:

Code:
net estop-ext => iocontrol.0.emc-enable-in => toolchanger.ishomed => stepgen.2.enable


I connected it to the machine enable so its "homed" as soon as you start the machine. Since it is not an axis it does not have a real "homing" routine. Does it not work that way?

[edit]

I think the homing might have been a leftover from the original use to drive a tool changer with a sensor so it could actually home itself before use. Since yours does not have a sensor there is no point in homing as the system has no feedback. Your original INI only had immediate homing so might as well just enable it when you start the machine. At least I think it should work.


Its telling me "can't issue MDI command when not homed"

I think I have always had to home the machine by clicking on each radio button but now I only have X and Z so can't issue the command to the toolchanger.

These are the current hal and ini files

Attachment not found


Attachment not found



Edit: Could it be homed in the comp.

Please Log in to join the conversation.

Time to create page: 0.711 seconds
Powered by Kunena Forum