PDA

View Full Version : New to LinuxCNC - Trying to add a PPort card and get LinuxCNC to start



TnW
21-04-2020, 06:18 PM
Hi,

First off, I haven't really used Linux much before this so apologies if the questions that I am asking seem a little noddy to you more knowledge guys. We all have to start somewhere! My brother in law is an IT tech and he was going to help me get this set up but with the lock down we are unable to figure out what is going on. I have had a right mission to get to this point with missing parts, needing to re fabricate parts as stuff ended up getting slightly warped and delays on parts due to the lock down such is life though, I shall not be beat!!! I just want to get it running and start making some money :nightmare:

The plan was/is to use LINUXCNC for the control software. The PC I have didn't have a PPCard so I purchased a StarTech PEX1Pcard. Installed it inside the machine and Linux has found it OK. I am having issues on not only which I/O port to use in the config file (Ive tried everything), but also not sure what I should be editing in the .hal file and what I shouldn't be using.

Ill dump some info below, if you need anything else just drop me a reply and I will get it when I get back to the workshop.

Should the number after the parport in my .hal file be a 0 or a 1? Would it need to be a 1 as the card we are using is parport1?

hardinfo and PCI devices is giving me the following info...

I/O Ports 0xe010 -0xe017
I/O Ports 0xe000 -0xe003

:~$ dmesg | grep parport

[ 9.663273] parport_pc 00:0a: reported by Plug and Play ACPI
[ 9.663332] parport0: PC-style at 0x378 (0x778), irq 5 [PCSPP,TRISTATE]
[ 9.757461] parport1: PC-style at 0xe010 (0xe000), irq 17 [PCSPP,TRISTATE,EPP]
[ 17.305126] lp0: using parport0 (interrupt-driven).
[ 17.305473] lp1: using parport1 (interrupt-driven).

lpisc -v

02:00.0 Parallel controller: Oxford Semiconductor Ltd Device c110 (prog-if 02 [ECP])
Subsystem: Oxford Semiconductor Ltd Device c110
Flags: bus master, fast devsel, latency 0, IRQ 17
I/O ports at e010 [size=8]
I/O ports at e000 [size=4]
Capabilities: <access denied>
Kernel driver in use: parport_pc

.hal File - Not all the info but enough to help I hope!

loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt hal_parport cfg="0x378 out"
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0
loadrt pwmgen output_type=1
loadrt classicladder_rt numPhysInputs=15 numPhysOutputs=15 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10
loadrt linear8

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf pwmgen.make-pulses 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 classicladder.0.refresh servo-thread
addf stepgen.update-freq servo-thread
addf pwmgen.update servo-thread
addf linear8.0 servo-thread


If anyone has any ideas it would be greatly appreciated.

Thanks!

Kitwn
22-04-2020, 01:55 AM
Which version of LinuxCNC are you using? If it's the base v2.7 and the mchine is a vanilla design then most if not all of the configuration can be done from the setup wizards rather than write the .hal and .ini files by hand. I never once looked at those files until I upgraded to v2.8. You can certainly create most of what you need fom there and then edit as required later.

Re the parallel port: I know there are issues regarding finding an add-on card rather than a built-in port but cannot remeber what the answer is! It has been talked about on the forum before.

Clive S
22-04-2020, 08:47 AM
Welcome to the forum TnW.

What kind of machine are you planning to use it on ie. Do you need ATC or dual axis etc. Mil, router or lathe.

What version of linuxcnc? . I see you are loading classic ladder.

Here are the Docs for 2.7 http://linuxcnc.org/docs/2.7/pdf/LinuxCNC_Documentation.pdf page 33 stepper config wizard

Jools
22-04-2020, 10:54 AM
I would go with KITWN's reply. To help more we'd need to know what setup you're using. Servo's or steppers for a start then as he said you should really use the stepconf or PNC conf wizard for your first setup. These tools will be installed when you install Linuxcnc.

That should get you started and then if there's still problems with it you can fill us in more.

The stepconf wizard basically sets up your HAL and INI files for you depending on the inputs you give it. Some things need to be added afterwards like coolant, ATC, further axis etc but once you have the basic setup you can then chase those monkeys seperately :-)

TnW
22-04-2020, 12:28 PM
Morning guys, apologies as I should have explained a little better yesterday evening, it had been a long day and my brain was pretty frazzled!

The machine I am using is called a SheetCNC, it is an 8 x 4 cnc router using a GPenny 2.2kw chinese spindle.

Its built from 25mm MDF and Plywood. It comes as a pre manufactured mechanical type kit which you assemble and then I source the electronics and set up.

The machine uses stepper motors with a sprocket and chain drive which run off of 3 ST-M5045 drivers. The chain drives the machine off of steel rails and steel v type wheels.

The reason for going with LinuxCNC is the manufacturer provided a basic hal file which has been set up for the machine including certain homing functions and spindle monitoring etc. I am waiting for a reply from the manufacturer to see if they have any info or help to give. The few pages of info relating to machine set up with an aftermarket card is that it is beyond the scope of the documentation and needs further looking into.

I have tried to modify their .hal file in the stepconf but it doesn't even find it when I go into the configs file for some reason, when you open the folder there are no files to be seen. I had hope to just modify their file however I'm wondering if the simplest this is to start from the beginning again and maybe try to cherry pick the correct info from their .hal file?

I understand how difficult it can be to try and diagnose problems over a forum so if you need info just ask. Thank you!

Clive S
22-04-2020, 04:36 PM
A linuxcnc basic config requires a hal file and an ini file. You need to post the config folder.


I understand how difficult it can be to try and diagnose problems over a forum so if you need info just ask. Thank you!
I have already asked you what version of Linuxcnc you are using. It should be at the top of the screen when liniuxcnc is open

TnW
22-04-2020, 05:09 PM
Linux info below.

Distributor ID: Debian
Description: Debian GNU/Linux 7.11 (wheezy)
Release: 7.11
Codename: wheezy

LinuxCNC Info

Axis 2.7.14

.ini info

# Generated by stepconf 1.1 at Wed Nov 30 14:30:16 2016
# If you make changes to this file, they will be
# overwritten when you run stepconf again

[EMC]
MACHINE = SHEETCNC
DEBUG = 0

[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 = 20.00
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 200.00
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/sheetcnc/linuxcnc/nc_files
INCREMENTS = 5mm 1mm .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 = 54088
SERVO_PERIOD = 1000000

[HAL]
HALUI = halui
HALFILE = SHEETCNC.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal

[HALUI]
# add halui MDI commands here (max 64)
MDI_COMMAND = o110 call
MDI_COMMAND = o120 call
MDI_COMMAND = o130 call

[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 20.00
MAX_VELOCITY = 200.00
ARC_BLEND_ENABLE = 1
ARC_BLEND_FALLBACK_ENABLE = 0
ARC_BLEND_OPTIMIZATION_DEPTH = 316
ARC_BLEND_GAP_CYCLES = 40
ARC_BLEND_RAMP_FREQ = 2

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

[AXIS_0]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 200.00
MAX_ACCELERATION = 300.0
STEPGEN_MAXACCEL = 450.0
SCALE = 92.4221251174
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -0.001
MAX_LIMIT = 2486.0
BACKLASH = 0.095
HOME_OFFSET = 0.0

[AXIS_1]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 200.00
MAX_ACCELERATION = 300.0
STEPGEN_MAXACCEL = 450.0
SCALE = 92.4410919142
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -0.001
MAX_LIMIT = 1255.0
BACKLASH = 0.095
HOME_OFFSET = 0.0

[AXIS_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 100.0
MAX_ACCELERATION = 3200.0
STEPGEN_MAXACCEL = 4000.0
SCALE = 100.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -245.0
MAX_LIMIT = 0.001
HOME_OFFSET = 0.0

Clive S
22-04-2020, 06:07 PM
where are the hal file files refired to here:

HALFILE = SHEETCNC.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal

I see you are posting on the linuxcnc forum as well.

What are the actual problems you have. Pictures of inside the control box might help as well

cropwell
22-04-2020, 07:07 PM
Don't know if this is of use. https://www.youtube.com/watch?v=Md4LxvbYoV0

Kitwn
23-04-2020, 02:10 AM
Don't know if this is of use. https://www.youtube.com/watch?v=Md4LxvbYoV0

That looks like the answer to the initial question.

TnW
23-04-2020, 06:10 PM
Clive - All files are in linuxcnc/configs/sheetcnc

Kitwin/Cropwell - yeah I tried what he did on the video but no joy. Re' the linuxcnc forum, I thought it best to try and wind everyone up at the same time, either that or I hoped someone might have some help. You never know unless you try!

I will try and get a picture of my wiring setup in an hour or so. All the dip switch settings etc have been copied over at the linuxcnc forum if you were interested.

Thanks for the continued help.

cropwell
23-04-2020, 06:48 PM
I spent 33 years as a programmer, specialising in IBM360 seriesFTP-ALCP, which is pretty much professional nerd level, but I can't get into Linux, made by nerds for nerds with time on their hands as far as I am concerned. Creating esoteric problems for esoteric solutions.

Best of Luck !

TnW
24-04-2020, 11:01 AM
I spent 33 years as a programmer, specialising in IBM360 seriesFTP-ALCP, which is pretty much professional nerd level, but I can't get into Linux, made by nerds for nerds with time on their hands as far as I am concerned. Creating esoteric problems for esoteric solutions.

Best of Luck !

:nonchalance::chargrined::rolleyes::hysterical:

It cracks me up to be honest, I mean it clearly works for some people and that's great for them lol. Sure it will be awesome when its up, running and I'm earning money!