First Time Help
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
If you are wanting to fully flesh out a driver for this card. It also has some timing capibilitys (that we are not taking advantage of). The card came with a DVD that has some driver programing examples for dos in Borland C. I could send you a copy of these if you think they would be useful to you in any way.
Please Log in or Create an account to join the conversation.
If you can think if a use for them, and a way to use them with a HAL "pin" interface then I can look into it.
Please Log in or Create an account to join the conversation.
(what EMC does with threads) They might be useful on one-shot mode as step pulse generators (avoiding the reset operation), but it looks like the stepmotors were originally driven by GPIO instead
Please Log in or Create an account to join the conversation.
ExcellentYes I would be willing to test it.
Well, first of all I think it makes sense to move your good, working, pcl720.ko file from
/usr/realtime-2.6.32-122-rtai/modules/emc2/pcl720.ko
to a safe place, so you can put it back to get the machine running again.
Then make a copy of your current ~/emc2/configs/{whatever} directory under a new name (router_experimental for example), and then start working in that directory. When EMC2 starts up you should see the new config as an option, along with the safe, known-good old config)
Then copy the attached file to somewhere convenient, go to where it is and comp --install pcl720.comp, as you did a few weeks ago.
Then see if it works with the existing config (it should, but I have changed a few things).
Then edit the INI file in the experiment directory to set step_space to 0 on each axis. (This tells the stepen that "reset" is active.
add a line to the HAL file: setp pcl720.0.reset-time 5000 (or whatever suits your drives, that is the step time in nanoseconds, or thousandths of microseconds)
Also add a line: setp pcl2720.0.pin-NN-reset true
for any pin that is a step pulse pin (but not, really not, for anything else)
Then, after all the other "addf" lines in HAL file, add:
addf pcl720.0.reset
Then start emc2 and see what happens. I would be astonished if it worked at all.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
I only have one more thing that I really need to get set up on this machine, and a few other want to dos. I need to set up the amp fault signals from the drives. I know what bits they are on the card, but I am having a lot of trouble finding an example of how to set them up in hal. I found something in the manual about axis.N.amp-fault-in but what I've tried so far didn't work. What I need is for all motion to stop when one of these pins change from true to false, and I would like to have some indication on screen of which drive is faulted.
pcl720.0.pin-26-in is the X indicator
pcl720.0.pin-24-in is the Y indicator
pcl720.0.pin-02-in is the Z indicator
The bit from these pins is true when the drives are working and false when the drive is faulted. Should the lines in hal look something like this? (but with a bit inverter that I don't know how to add)
net Xfault pcl720.0.pin-26-in => axis.0.amp-fault-in
The machine also has a hard wired drive enable switch it seems to be connected to two input pins.
pcl720.0.pin-00-in is false when drives are enabled (true when disabled)
pcl720.0.pin-15-in is true when drives are enabled (false when disabled)
I would also like to add some form of onscreen indication of this switches position, disable movement when off and maybe even require re-homing (un-home all axis if enable is turned off).
One of the other bigger want to dos, is to add some form of cycle timer, to indicate the run time of a file. Also is there a simple way to make the estimated runtime even remotely accurate? Right now the esimated 2.5 minute run isn't even remotely close to the actual 30 min reality.
Please Log in or Create an account to join the conversation.
[quote I found something in the manual about axis.N.amp-fault-in but what I've tried so far didn't work. What I need is for all motion to stop when one of these pins change from true to false, and I would like to have some indication on screen of which drive is faulted.[/quote]
The onscreen LEDs would need to be added as a PyVCP panel (or, rather nicer, but still not in 2.4, I don't think, GladeVCP)
www.linuxcnc.org/docs/2.4/html/hal_pyvcp.html
www.linuxcnc.org/docview/devel/html/gui/gladevcp.html
The bit from these pins is true when the drives are working and false when the drive is faulted. Should the lines in hal look something like this? (but with a bit inverter that I don't know how to add)
net Xfault pcl720.0.pin-26-in => axis.0.amp-fault-in
Yes, that looks correct. I am not at all sure what the amp-fault pin does though, I might need to experiment.
The new driver has an inverted version of each input pin for exactly this sort of situation, So you don't need the example below if the new driver version works, But to add a standalone inverter for three pins in the HAL file you would have:
loadrt invert count=3
...
addf invert.0 servo-thread
addf invert.1 servo-thread
addf invert.2 servo-thread
...
net Xfault-in pcl720.0.pin-26-in => invert.0.in
net Xfault invert.0.out => axis.0.amp-fault-in
net Xfault-in pcl720.0.pin-24-in => invert.1.in
net Xfault invert.1.out => axis.1.amp-fault-in
net Xfault-in pcl720.0.pin-02-in => invert.2.in
net Xfault invert.2.out => axis.2.amp-fault-in
The former would be another job for PyVCP or GladeVCP. The latter point is controlled with the VOLATILE_HOME .ini-file setting.I would also like to add some form of onscreen indication of this switches position, disable movement when off and maybe even require re-homing (un-home all axis if enable is turned off).
linuxcnc.org/docs/html/config_ini_config...b:%5BAXIS%5D-section section 2.2.9.1
Sorry to keep doing this:One of the other bigger want to dos, is to add some form of cycle timer, to indicate the run time of a file.
Current release:http://wiki.linuxcnc.org/emcinfo.pl?SimpleCycleTimer
Develepment version: www.linuxcnc.org/docview/devel/html/man/man9/time.9.html
I don't think that there is even a complicated way to make it accurate. I don't think that preview takes any account of axis accelleration times.Also is there a simple way to make the estimated runtime even remotely accurate? Right now the esimated 2.5 minute run isn't even remotely close to the actual 30 min reality.
However, if there is such a big difference I suspect that you have G-code files made up of many short linear moves? You probably want to fiddle with G64 settings, you might even find that by relaxing the path tolerance you can move the cycle time closer to the estimate, rather than move the estimate closer to the cycle time...
www.linuxcnc.org/docview/html/common_User_Concepts.html
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
I don't think that there is even a complicated way to make it accurate. I don't think that preview takes any account of axis accelleration times.
However, if there is such a big difference I suspect that you have G-code files made up of many short linear moves? You probably want to fiddle with G64 settings, you might even find that by relaxing the path tolerance you can move the cycle time closer to the estimate, rather than move the estimate closer to the cycle time...
www.linuxcnc.org/docview/html/common_User_Concepts.html
This machine is used for relitively fine 2 1/2-D V-groove carving/engravine, so almost all of the cutting movements are very small with average segement lengths often less than 0.01 inches. This combined with the relatively low acceleration rates I have had to use to get a nice cut., leave me with max feed rates less than 20 ipm durring most of the cutting (I have the feed rate set to F100). I currently have G64 set to P0.005 Does this mean that the max deviation from programmed to commanded path would be 0.005 inches? If that is the case then I don't think I want to set it much looser because nice crisp corners are pretty important to this work.
Please Log in or Create an account to join the conversation.
I currently have G64 set to P0.005 Does this mean that the max deviation from programmed to commanded path would be 0.005 inches? If that is the case then I don't think I want to set it much looser because nice crisp corners are pretty important to this work.
Can you run a sample to see how much difference it makes? It seems to me that you don't actually want to follow the 0.01" straight-line segments, you want to follow the smooth curves from the original artwork that those straight lines are a bad approximation to...
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
This is what I used:
# Enable Switches
loadrt not count=3
addf not.0 servo-thread
addf not.1 servo-thread
addf not.2 servo-thread
net Xfault-in pcl720.0.pin-26-in => not.0.in
net Xfault not.0.out => axis.0.amp-fault-in
net Yfault-in pcl720.0.pin-24-in => not.1.in
net Yfault not.1.out => axis.1.amp-fault-in
net Zfault-in pcl720.0.pin-02-in => not.2.in
net Zfault not.2.out => axis.2.amp-fault-in
When the am-fault-in pin is triggered EMC sets an alarm for the join infolved, and tuns the sofware to "machine off". This should be good enough for me (at least for now)
Please Log in or Create an account to join the conversation.
Sorry about that, that is what happens when I try to write HAL code without access to an EMC2 machine.Well invert didn't work. Apparently that is only for float signals. But I was able to use your example framework as an example of how to use the not command.
Please Log in or Create an account to join the conversation.