× Forum Header

Please help, I need some addvise

More
05 May 2013 06:47 #33629 by allenwg2005
I don't have the line:
setp parport.0.pin-02-out-reset 1
as the second line, is that an issue ?
The rest is as it should be.

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

More
05 May 2013 07:48 #33632 by allenwg2005
I don't see the following in the HAL:

net min-home -Z <= parport.0.pin-10-in (pins for max and so forth)

I don't see the following either, I have one for Y axis and for this one:

net min home -X=> axis.1.home-sw-in
net min home -X=> axis.1. Neg-lim-sw-in
net max =>axis.1.pos-lim-sw-in

Should I have these?

I'm going to include the message I get when trying to do a test run on Z, it may help.
When I click “Test run” in Z axis configuration:

File “/usr/bin/stepconf”, line 1740, in on_axistest_clicked def on_axis_clicked (self *args): self.test_axis('z')
File “usr/bin/stepconf”, line 2175, in test_axis 'scale': data [axis+”scale”]
TypeError: int argument required

Back in the weeds again. :pinch:

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

More
05 May 2013 07:54 #33633 by andypugh

I don't have the line:
setp parport.0.pin-02-out-reset 1
as the second line, is that an issue ?
The rest is as it should be.


That's interesting.
It may not matter, and the explanation of what that line does is rather complicated.

"reset" is a special HAL function that runs last in the real-time "base" thread. What it does is set any pin back to zero after a set time.
What this means is that you can have a step pulse every time the base thread runs. Without the reset function it takes two thread cycles, the first turning the pin on, the second off.

I possibly need to explain what a "thread" is. It is a list of bits of code that are run regularly by the realtime system. Every "base thread" cycle LinuxCNC stops everything else the computer might be doing and runs the base thread code (which typically makes step pulses). Every servo thread cycle it does the same for the more high-level code that calculates positions and velocities for LinuxCNC. The base thread can, and does, interrupt the servo-thread.

If your step time set in Stepconf is quite long, then I suspect that Stepconf won't bother with the Reset function.

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

More
05 May 2013 08:08 #33634 by andypugh

I don't have the line:
setp parport.0.pin-02-out-reset 1
as the second line, is that an issue ?
The rest is as it should be.


That's interesting.
It may not matter, and the explanation of what that line does is rather complicated.

"reset" is a special HAL function that runs last in the real-time "base" thread. What it does is set any pin back to zero after a set time.
What this means is that you can have a step pulse every time the base thread runs. Without the reset function it takes two thread cycles, the first turning the pin on, the second off.

I possibly need to explain what a "thread" is. It is a list of bits of code that are run regularly by the realtime system. Every "base thread" cycle LinuxCNC stops everything else the computer might be doing and runs the base thread code (which typically makes step pulses). Every servo thread cycle it does the same for the more high-level code that calculates positions and velocities for LinuxCNC. The base thread can, and does, interrupt the servo-thread.

If your step time set in Stepconf is quite long, then I suspect that Stepconf won't bother with the Reset function.

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

More
05 May 2013 10:52 #33638 by Todd Zuercher
Sorry I thought that Stepconfig would give a 2nd port configuring window and it doesn't. Sorry, you will have to set that up by hand.
The following user(s) said Thank You: allenwg2005

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

More
05 May 2013 21:05 #33656 by allenwg2005
Thanks Todd, no worries.

I found a “custom.hal” file in the folder with the configuration file, it had no text in it for commands and it stated this file would not be over written when changes were made to the base configuration file, so I used it.
Z still sent the message I shared earlier.

So Linuxcnc uses both the config file and custom hal file together to run a part program?
I would have thought you could just edit the config file and go with that, all though I suppose it could be over writted if you change the file. Is that the thinking here?

I think I'm stuck here, any thoughts?

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

More
05 May 2013 21:58 #33658 by Todd Zuercher
Stepconfig is just covering its self when it says that the config file could be overwritten. What it means is that if you open the config with Stepconfig after you have made any manual changes those changes you made manually will be over written. Just make backups of manual changes by saving to a different named file as a backup (or never reopen it with Stepconfig).

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

More
06 May 2013 02:08 #33661 by allenwg2005
Below is a copy of the step config hal.

As Andy pointed out, I have no port/pin assignments for Z.
I don't see any limits listed either, shouldn't they be added?

Why can't I just add to these to this hal, instead of writing to the custom hal?
Or can I, with precautions?
# Generated by stepconf at Mon May  6 07:41:15 2013
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg="0x378 out 0x8800 out 0xa000 out"
loadrt stepgen step_type=0,0,0

addf parport.0.read base-thread
addf parport.1.read base-thread
addf parport.2.read base-thread
addf stepgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.1.write base-thread
addf parport.2.write 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 <= motion.spindle-speed-out

setp parport.0.pin-01-out-invert 1
net estop-out => parport.0.pin-01-out
net xstep => parport.0.pin-02-out
net xdir => parport.0.pin-03-out
net xenable => parport.0.pin-05-out
net ystep => parport.0.pin-06-out
net ydir => parport.0.pin-07-out
net xenable => parport.0.pin-09-out


net min-home-x <= parport.0.pin-10-in
net max-x <= parport.0.pin-11-in
net min-home-y <= parport.0.pin-12-in
net max-y <= parport.0.pin-13-in


setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 1
setp stepgen.0.dirhold 41971
setp stepgen.0.dirsetup 41971
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable
net min-home-x => axis.0.home-sw-in
net min-home-x => axis.0.neg-lim-sw-in
net max-x => axis.0.pos-lim-sw-in

setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 1
setp stepgen.1.dirhold 41971
setp stepgen.1.dirsetup 41971
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable
net min-home-y => axis.1.home-sw-in
net min-home-y => axis.1.neg-lim-sw-in
net max-y => axis.1.pos-lim-sw-in

setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 1
setp stepgen.2.dirhold 41971
setp stepgen.2.dirsetup 41971
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable axis.2.amp-enable-out => stepgen.2.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

Here is the custom.hal, did I do something wrong on this?

# Include your customized HAL commands here
# This file will not be overwritten when you run stepconf again

net zstep => parport.2.pin-02-out
net zdir => parport.2.pin-03-out

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

More
07 May 2013 00:15 #33684 by allenwg2005
Hello forum friends,

The website really is struggling these past few days, makes you wounder what is causing this.

I have some minor results to share, I still haven't been able to get a test to run on Z axis.

I followed the error message /usr/bin/stepconf line 1740 and 2175 using Gedit.

Line 1740 reads:
def on_zaxistest_clicked (self, *args): self.test_axis ('Z')

This line reads just as the X axis with the exception of the Z's, X axis works just fine.
I don't know what this means exactly, can someone let me know? (*args????? what's that)?

Line 2175 reads:
'scale': data[axis+ 'scale'],

I must have something entered wrong so scaling isn't working properly?
I think if I can fix this I will have Z working.

Please advise.

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

More
07 May 2013 20:00 #33720 by andypugh

I must have something entered wrong so scaling isn't working properly?
I think if I can fix this I will have Z working..


What is the Z-scale in the INI [AXIS_2]SCALE ?

If that is zero, then there my be problems.

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

Time to create page: 0.391 seconds
Powered by Kunena Forum