. .

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Bob Could you put up a link for this part. I will PM you my address.
    ..Clive
    The more you know, The better you know, How little you know

  2. #2
    Thanks Clive and i've now moved on some but i have encountered another hurdle.
    The HAL file for the set up is shown below.

    # Generated by stepconf 1.1 at Sun Jan 15 15:33:03 2017
    # 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 hal_parport cfg="0 out"
    setp parport.0.reset-time 5000
    loadrt stepgen step_type=0,0
    loadrt pwmgen output_type=1

    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 stepgen.update-freq servo-thread
    addf pwmgen.update servo-thread

    net spindle-cmd-rpm => pwmgen.0.value
    net spindle-on <= motion.spindle-on => pwmgen.0.enable
    net spindle-pwm <= pwmgen.0.pwm
    setp pwmgen.0.pwm-freq 100.0
    setp pwmgen.0.scale 876.0
    setp pwmgen.0.offset 0.0
    setp pwmgen.0.dither-pwm true
    net spindle-cmd-rpm <= motion.spindle-speed-out
    net spindle-cmd-rpm-abs <= motion.spindle-speed-out-abs
    net spindle-cmd-rps <= motion.spindle-speed-out-rps
    net spindle-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
    net spindle-at-speed => motion.spindle-at-speed

    net spindle-pwm => parport.0.pin-01-out
    setp parport.0.pin-02-out-invert 1
    net xstep => parport.0.pin-02-out
    setp parport.0.pin-02-out-reset 1
    setp parport.0.pin-03-out-invert 1
    net xdir => parport.0.pin-03-out
    setp parport.0.pin-04-out-invert 1
    net zstep => parport.0.pin-04-out
    setp parport.0.pin-04-out-reset 1
    setp parport.0.pin-05-out-invert 1
    net zdir => parport.0.pin-05-out
    net spindle-on => parport.0.pin-17-out

    setp stepgen.0.position-scale [AXIS_0]SCALE
    setp stepgen.0.steplen 1
    setp stepgen.0.stepspace 0
    setp stepgen.0.dirhold 35000
    setp stepgen.0.dirsetup 35000
    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

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

    If I input M3 S876 then the output from Pin 1 is 4.9V and the spindle runs at approx 876rpm.
    If i input S438 the output drops to a steady 2.45v but the spindle rpm oscillates between 0 and 876rpm. The closer i set the S speed the more the spindle is at max speed.

    If I use a power supply to feed into the VFD at say 2.45V then the spindle runs at the correct speed.

    I deduced there must be some other input that's causing this oscillation and measured the AC voltage on pin1 at 2.7V. I can't determine it's frequency but if this is very low then it might explain the issue?

    Is there a way of filtering out the AC component if in fact it is this that is causing the problem?

  3. #3
    Bob I think that this would be better put on the Linuxcnc forum Having said that Have you had a look at this
    http://linuxcnc.org/docs/2.4/html/ex...ndle.html#r1_3 this is for version 2.4 I think.

    Where did you get the scale from in setp pwmgen.0.scale 876.0 I think this should be set to the max speed of the spindle

    Are you using 0-10V

    I hope somebody can chime in to help plese
    Last edited by Clive S; 15-01-2017 at 06:39 PM.
    ..Clive
    The more you know, The better you know, How little you know

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Linier slide bearings - can they be adjusted?
    By craigrobbo in forum Rails, Guideways & Bearings
    Replies: 6
    Last Post: 10-08-2012, 02:52 PM
  2. FOR SALE: 25mm Linear Slide bearings
    By D-man in forum Items For Sale
    Replies: 4
    Last Post: 28-11-2010, 05:14 PM
  3. BUILD LOG: Magnetic slide of Z-axis
    By Constantine in forum DIY Router Build Logs
    Replies: 4
    Last Post: 08-11-2009, 08:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •