× Forum Header

Mach3 XML and Stepconfig issues.

More
19 Apr 2017 08:08 #91622 by tecno
Still no go so I hope somebody can share some information on how to proceed to find out what is wrong.

One thing that puzzles me is that at start up = when the black splash screen pops up starting LCNC the Charge Pump goes active for a second and then no go when F1/F2 can be toggled. Here the CP should be on or off with F1/F2, right?

There must be something in settings that is not correct but I am not so familiar with LCNC to find out what is wrong.
Step by step advice to get me started would be much appreciated.

Cheers
Bengt

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

More
19 Apr 2017 11:31 #91627 by rodw
I have not used a parallel port with LinuxCNC so can't help much. But the Wiki is always a good place to start.

wiki.linuxcnc.org/cgi-bin/wiki.pl?About_Charge_Pumps

You need to know the port on your Breakout board that is being used as a charge pump.

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

More
19 Apr 2017 11:37 #91628 by tecno
Same settings are used in Stepconfig as in Mach3 that works perfectly, seems to be something with E-stop condition with CP function that is wrong in some way. Just canĀ“t figure it out what.

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

More
19 Apr 2017 15:25 #91638 by Todd Zuercher
In you hal file there is one minor error, but it it were a problem Linuxcnc would not start.
In your file you have the line
net estop-out charge-pump.enable iocontrol.0.user-enable-out
and later you also have the line
net estop-out <= iocontrol.0.user-enable-out
That is connecting the same pin " iocontrol.0.user-enable-out" to the same signal twice. So remove either the first "iocontrol.0.user-enable-out" or the whole 2nd line.

Do you know what frequency or frequency range your charge pump requires. Currently your config files should generate the charge pump signal at 16.7KHz. I think the default speed for Mach3 is 12.5KHz. Maybe that is too fast to work with your hardware. (For example a CNC4PC C4 charge pump frequency range is 0.3-15.5KHz.)
You can easily halve your charge pump frequency by simply changing this line in your hal file from:
net charge-pump <= charge-pump.out
to this:
net charge-pump <= charge-pump.out-2

Where is your spindle step signal connected in your Mach3 config? Is it to one of the parallel port pins?

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

More
19 Apr 2017 15:46 #91640 by tecno
CP is Mach standard = 12.5kHz

Mach3 pins

X 2=S 3=D
Z 4=S 5=D (Dir low)

Spindle 6=S 200steps max vel 4400 and acc 1875
and 7=D

9 = coolant
14 = Charge pump

10 = Index
11 = Z home
12 = X home
15 = E-stop

Will try your suggestions after dinner now.

Cheers
Bengt

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

More
19 Apr 2017 16:18 #91648 by Todd Zuercher
So you send pulses to pin 6 for clockwise and pin 7 for CCW?
That should be simple to set up. (once we get the charge pump straightened out.)

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

More
19 Apr 2017 16:45 #91654 by tecno
Changed hal as per your description, erased 2 line and added -2

Still no go, same behavior as before.

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

More
19 Apr 2017 17:33 #91655 by Todd Zuercher
To do this you will need to add another stepgen, and configure it as type 1, in velocity mode. Then set the scale so that 4000rpm = 200steps/sec. And finally connect the pins in the hal file.

You also need to add some more stuff for your spindle index to work properly. Because you only selected index in Stepconfig it didn't add the encoder module to your hal file. If you go through Stepconfig once more selecting and input for both the spindle index and A-pulse, I think it will configure the rest by its self and you only need to tie the A back to the index in the hal file.)
(PS it will work better with a true encoder with A,B,Z phases with a count of 60-200 pulses/rev rather than just an index pulse.)

This is only a start, I'm sure I haven't added every thing that is needed for reading and using the spindle index.

Change or add these lines in your hal file:
#change "loadrt stepgen step_type=0,0" to:
loadrt stepgen step_type=0,0,1 ctrl_type=p,p,v 

loadrt endoder.update-counters

addf encoder base-thread
addf encoder.capture-position servo-thread

setp encoder.0.counter-mode 1
 
net spindle-index => encoder.0.phase-Z => encoder.0.phase-A

net spindle-cmd-rpm => stepgen.2.velocity-cmd  

setp stepgen.2.position-scale 0.05 #steps/RPM
setp stepgen.2.steplen 1
setp stepgen.2.dirdelay 35000
setp stepgen.2.maxaccel 500

#change net spindle-cw <= motion.spindle-forward
net spindle-cw <= stepgen.2.up
#change net spindle-ccw <= motion.spindle-reverse
net spindle-ccw <= stpegen.2.down

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

More
19 Apr 2017 17:42 #91656 by Todd Zuercher

Changed hal as per your description, erased 2 line and added -2

Still no go, same behavior as before.


Change this line "net estop-out charge-pump.enable iocontrol.0.user-enable-out" to
setp charge-pump.enable 1

To get a charge pump signal of 12.5KHz, you would have to have add the charge pump component to at thread running at 40000ns (or 20000 with the -2). But try the above line change first before we start messing with your thread speeds.

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

More
19 Apr 2017 18:28 - 19 Apr 2017 18:29 #91664 by tecno
setp charge-pump.enable 1

Now I can jog both axis, F1/F2 and E-stop works. Need to get proper parameters as it is now way too fast and steppers stall.

Will try to see if I can get the spindle running tomorrow. I only have Index now and only pin 13 free for A-channel. No physical encoder yet on my lathe but have parts to do this but I hope I can get spindle working and have to wait for encoder/threading possibilities.

Thanks for your kind support Todd, much appreciated.

Bengt
Last edit: 19 Apr 2017 18:29 by tecno.

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

Time to create page: 0.094 seconds
Powered by Kunena Forum