Drilling Machine

More
04 Mar 2022 17:15 - 04 Mar 2022 17:17 #236365 by Squark
Drilling Machine was created by Squark
Hello forum. I'm a total newbie to linux and an almost newbie to all things CNC.
I managed to convince my boss that as we have entered the 21st century we could maybe update with some 20th century tech.
He bought a CNC router which eased my job no end and then went on to build a CNC driller. We take a disc of wood, put it on a record player type turntable, x moves to the correct position the A  turns so many degrees, stops, a drill plunges, returns back up and the turn table rotates to the next position for another drill cycle. We are running on a dwell time but it changes as drills get blunt and pneumatic pressure changes.
He fitted magnetic read switches for top and bottom of the drill stroke but Mach3 cant cope with that by all accounts. So in jumps I with the idea of linuxcnc. Oh golly what a learning curve. 

Problem 1... Unexpected realtime delay at task 0. I have read some threads here now my mind is totally boggled
Problem 2... Too many axises(?) axies(?) , We only need X and A, I edited the ini file and an error came up, I guess I have to do the hal file too?

Because our machine is so simple (I found M66 already to read input pin states and am OK with that) can I get an earlier version of linuxcnc that will eradicate problem 1?
We have a dell optiplex 980, onboard graphics, I got X and A moving well on the calibrate program thing, where the ini file is built, it was all going well but for this realtime delay and I am now drowning in jargon. I would like to fix that first then move onto getting rid if Y and Z.

Help please
Last edit: 04 Mar 2022 17:17 by Squark. Reason: typo

Please Log in or Create an account to join the conversation.

More
05 Mar 2022 00:05 #236383 by andypugh
Replied by andypugh on topic Drilling Machine
Stepper machine?
Parallel port and BoB?

Which LinuxCNC version?

Post your HAL and INI and one of us will whittle it down to two axes.

Please Log in or Create an account to join the conversation.

More
07 Mar 2022 17:25 #236586 by Squark
Replied by Squark on topic Drilling Machine
Hi Andy thanks for responding

Yes it has stepper motors and a BOB from the parallel port.

Its debian 10 and linux 2.8.2-buster
The optiplex jitter rate is about 170,000 with a few things running.


The ini file....
[EMC]
MACHINE = GreenCNC
DEBUG = 0
VERSION = 1.1

[DISPLAY]
DISPLAY = axis
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
ARCDIVISION = 64
GRIDS = 10mm 20mm 50mm 100mm 1in 2in 5in 10in
MAX_FEED_OVERRIDE = 1.2
MIN_SPINDLE_OVERRIDE = 0.5
MAX_SPINDLE_OVERRIDE = 1.2
DEFAULT_LINEAR_VELOCITY = 10.00
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 100.00
DEFAULT_ANGULAR_VELOCITY = 5.00
MIN_ANGULAR_VELOCITY = 0
MAX_ANGULAR_VELOCITY = 50.00
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/squark/linuxcnc/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm

[KINS]
JOINTS = 4
KINEMATICS = trivkins coordinates=XYZA

[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 = 65000
SERVO_PERIOD = 1000000

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

[TRAJ]
COORDINATES = X Y Z A
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 5.00
MAX_LINEAR_VELOCITY = 100.00

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

[AXIS_X]
MAX_VELOCITY = 36.5384615385
MAX_ACCELERATION = 65.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 = 36.5384615385
MAX_ACCELERATION = 65.0
STEPGEN_MAXACCEL = 81.25
SCALE = 400.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0

[AXIS_Y]
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0

[JOINT_1]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 937.5
SCALE = 80.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0

[AXIS_Z]
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0

[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
MAX_VELOCITY = 25.0
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 937.5
SCALE = 80.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0

[AXIS_A]
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 180.0
MIN_LIMIT = -9999.0
MAX_LIMIT = 9999.0

[JOINT_3]
TYPE = ANGULAR
HOME = 0.0
MIN_LIMIT = -9999.0
MAX_LIMIT = 9999.0
MAX_VELOCITY = 50.0
MAX_ACCELERATION = 180.0
STEPGEN_MAXACCEL = 225.0
SCALE = 250.0
FERROR = 1
MIN_FERROR = .25
HOME_OFFSET = 0.0




The Hal file....
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hal_parport cfg="0 out"
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0,0
loadrt charge_pump
net estop-out charge-pump.enable iocontrol.0.user-enable-out
net charge-pump <= charge-pump.out

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf charge-pump base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
net spindle-cmd-rpm <= spindle.0.speed-out
net spindle-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-cmd-rps <= spindle.0.speed-out-rps
net spindle-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-at-speed => spindle.0.at-speed
net dout-00 <= motion.digital-out-00
net dout-03 <= motion.digital-out-03
net din-00 => motion.digital-in-00
net din-01 => motion.digital-in-01

net estop-out => parport.0.pin-01-out
net xstep => parport.0.pin-02-out
setp parport.0.pin-02-out-reset 1
net xdir => parport.0.pin-03-out
net dout-03 => parport.0.pin-04-out
net astep => parport.0.pin-08-out
setp parport.0.pin-08-out-reset 1
net adir => parport.0.pin-09-out
net charge-pump => parport.0.pin-16-out
net dout-00 => parport.0.pin-17-out
net din-00 <= parport.0.pin-10-in
net din-01 <= parport.0.pin-11-in

setp stepgen.0.position-scale [JOINT_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 70000
setp stepgen.0.dirsetup 70000
setp stepgen.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL
net xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => joint.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable joint.0.amp-enable-out => stepgen.0.enable

setp stepgen.1.position-scale [JOINT_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 70000
setp stepgen.1.dirsetup 70000
setp stepgen.1.maxaccel [JOINT_1]STEPGEN_MAXACCEL
net ypos-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => joint.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable joint.1.amp-enable-out => stepgen.1.enable

setp stepgen.2.position-scale [JOINT_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 70000
setp stepgen.2.dirsetup 70000
setp stepgen.2.maxaccel [JOINT_2]STEPGEN_MAXACCEL
net zpos-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => joint.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable joint.2.amp-enable-out => stepgen.2.enable

setp stepgen.3.position-scale [JOINT_3]SCALE
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 0
setp stepgen.3.dirhold 70000
setp stepgen.3.dirsetup 70000
setp stepgen.3.maxaccel [JOINT_3]STEPGEN_MAXACCEL
net apos-cmd joint.3.motor-pos-cmd => stepgen.3.position-cmd
net apos-fb stepgen.3.position-fb => joint.3.motor-pos-fb
net astep <= stepgen.3.step
net adir <= stepgen.3.dir
net aenable joint.3.amp-enable-out => stepgen.3.enable

net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

Please Log in or Create an account to join the conversation.

More
07 Mar 2022 18:19 - 09 Mar 2022 08:56 #236588 by Clive S
Replied by Clive S on topic Drilling Machine
Deleted :misleading  info

 
Last edit: 09 Mar 2022 08:56 by Clive S. Reason: misleading info

Please Log in or Create an account to join the conversation.

More
07 Mar 2022 22:01 #236606 by Squark
Replied by Squark on topic Drilling Machine
Thanks Chris. I'm not quite sure what you mean?
I tried to convert our Mach 3 ini file but the software was having none of it. I took a few notes from the Mach3 screens and eyeballed the rest of the values. We shall fine tune it some time. The actual motion of the axes looked reasonable so I left them.

I am currently wondering if I can add .txt to this line.....
PROGRAM_EXTENSION = .nc,.tap G-Code File

Our G codes are currently in TXT form.

Please Log in or Create an account to join the conversation.

More
07 Mar 2022 23:15 - 07 Mar 2022 23:21 #236615 by Clive S
Replied by Clive S on topic Drilling Machine

I am currently wondering if I can add .txt to this line.....
PROGRAM_EXTENSION = .nc,.tap G-Code File

Our G codes are currently in TXT form. 


Yes
[FILTER]
PROGRAM_EXTENSION = .ngc,.tap,.nc,.txt 


linuxcnc.org/docs/2.8/html/config/ini-config.html
Last edit: 07 Mar 2022 23:21 by Clive S.

Please Log in or Create an account to join the conversation.

More
08 Mar 2022 12:51 #236668 by Squark
Replied by Squark on topic Drilling Machine
I'm feeling brave so I made some changes to ini and hal. 

Off to work to try it out

Fingers crossed nothing will explode.

I shall look for extra stuff going on at the bios level too see if I can get that jitter rate down
 

Please Log in or Create an account to join the conversation.

More
08 Mar 2022 16:11 #236684 by Squark
Replied by Squark on topic Drilling Machine
Disabling onboard NIC, sound and twin core processing got the unexpected realtime delay to go. One step closer to success.

We have some other issues though. My head is spinning!
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
09 Mar 2022 00:39 #236726 by andypugh
Replied by andypugh on topic Drilling Machine
Sorry for the delay, here is your config modified for two axes.

It would be more conventional for the described layout to be an XC config, and that might give a clearer preview.
Attachments:
The following user(s) said Thank You: Squark

Please Log in or Create an account to join the conversation.

More
09 Mar 2022 08:00 #236742 by Squark
Replied by Squark on topic Drilling Machine
Thank you so much Andy
I had a play at this same exercise but had joints 0 and 3, it told me 3 didnt exist.
So C rotates on a different plane to A
It would be rotating around Z rather than X I think which is what the machine actually does. Can I just change A for C or is it more involved than that?

Please Log in or Create an account to join the conversation.

Time to create page: 0.220 seconds
Powered by Kunena Forum