Spindle Step/Dir

More
15 Jun 2013 20:30 - 16 Jun 2013 00:44 #35678 by jbradshaw
Spindle Step/Dir was created by jbradshaw
Hi all,

Converting a XYZ mill from Mach to LinuxCNC (everything works on Mach). BigJohnT kindly converted the stepconf file so I've moved onto the spindle now.

The spindle is controlled via a B1-VSC board from cncdoctor.co.uk which converts a step input to a 0-10V output to drive the servo amp.
Their docs it says to use the "Step/Dir" option in the Motor Control section.

The forum post at
www.linuxcnc.org/index.php/english/forum...-spindle-help-needed
provided some information but I'm getting file read errors now.

Attached the HAL and INI files.

Has anyone a working XYZ config with a step/dir controlled spindle they could share?

Thanks,
John.
Attachments:
Last edit: 16 Jun 2013 00:44 by jbradshaw. Reason: Typo: Meant XYZ config

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

More
15 Jun 2013 21:01 #35679 by ArcEye
Replied by ArcEye on topic Spindle Step/Dir
Hi

What you need is a velocity stepgen

loadrt stepgen step_type=0,0,0,0,0 ctrl_type=p,p,p,p,v

Then set it up

####################################################################
#
# This section enables the Spindle2 board to produce
# 0-10v scaled upon steps from axis4 and direction of
# rotation from Dir signal
####################################################################

# Use a scale module for offset and scaling of the stepgen
# Offset and scale are determined by first calculating and testing
#
setp scale.0.in 0
setp scale.0.gain 0.44 # gives true at 1000
setp scale.0.offset 0.0
addf scale.0 servo-thread
#
# Initialise the stepgen for the spindle
#
setp stepgen.4.position-scale 1
setp stepgen.4.maxvel 2400
setp stepgen.4.steplen 1
setp stepgen.4.stepspace 0
setp stepgen.4.dirhold 20000
setp stepgen.4.dirsetup 20000
setp stepgen.4.maxaccel 200

net spindle-enable <= motion.spindle-on => stepgen.4.enable
net spindle-cmd motion.spindle-speed-out => scale.0.in
net spindle-freq <= scale.0.out => stepgen.4.velocity-cmd
net spindle-out <= stepgen.4.step => parport.0.pin-09-out
net spindle-cw <= stepgen.4.dir => parport.0.pin-08-out


then set up the spindle encoder (if you have one)

##########################################################################

# This produces an absolutely accurate RPM reading

setp encoder.0.position-scale 1
setp encoder.0.counter-mode 1
net spindle-position encoder.0.position-interpolated => motion.spindle-revs
net spindle-velocity encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=> motion.spindle-index-enable
net spindle-index parport.0.pin-15-in => encoder.0.phase-Z encoder.0.phase-A


ini file needs to relect there are 5 axes even though 3 is not used and 4 is a velocity stepgen

[TRAJ]
AXES = 5
COORDINATES = X Y Z


I will attach the files for a small mill which uses this, but that is the bones of it
(as a bonus the code for a MPG pendant is there too)

regards


File Attachment:

File Name: small-mill...ndle.zip
File Size:7 KB
Attachments:
The following user(s) said Thank You: jbradshaw, eFalegname, Rapha94

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

More
16 Jun 2013 00:45 #35690 by jbradshaw
Replied by jbradshaw on topic Spindle Step/Dir
Thanks ArcEye, will try that and report back.

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

More
11 May 2014 22:00 #46817 by jbradshaw
Replied by jbradshaw on topic Spindle Step/Dir
It's been nearly a year but managed to get back to the mill.

XYZ now 100% and have added ArcEye's config to the hal but the servo spindle isn't turning at all now (previous config based on a stepper switched it on at a fixed speed).

Can anyone see anything wrong in the attached config?

Old parameters from StepConf still in the file but commented out.

Thanks,
John.
Attachments:

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

More
28 Feb 2016 09:19 #70746 by Tomasz_K
Replied by Tomasz_K on topic Spindle Step/Dir
Number answer to your question suggests that such a configuration is not possible.

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

More
29 Feb 2016 13:38 #70809 by andypugh
Replied by andypugh on topic Spindle Step/Dir

Can anyone see anything wrong in the attached config?.


For steplen 1 / stepspace 0 you probably need to set pin-09.reset true (ie, like the other step pins are configured).

Set up a halmeter on the stepgen.4.velocity and check that it is being activated, ditto the stepgen.4.enable.
The following user(s) said Thank You: jbradshaw

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

More
29 Feb 2016 13:48 #70812 by jbradshaw
Replied by jbradshaw on topic Spindle Step/Dir
Thanks Andy. Will do that - going to swap out PC first as have a slightly better one with parallel port idle at present.

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

Time to create page: 0.126 seconds
Powered by Kunena Forum