understanding Pluto

More
13 May 2009 18:12 #253 by lelef
understanding Pluto was created by lelef
Just finished retrofitting my milling machine I'm doing the same with my lathe:
dc servo for Z(with step & dir driver), stepper for X , 1800 pulse only A channel encoder and no variable speed spindle.
PC is not really fast but for milling it seems to be enought but not for turning, so I decided to use a pluto-p board that shoul be a great help in reding encoder (max rpm is 2000 but the pc dosn't succed in reading more than 300 over it loose pulses)
Now I' ve "to traslate" my configuration from lpt port to pluto and it seems very hard to me

you can see my ini and hal lpt files a joystic and a jogwheel are used for simple works.

.hal

# 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 traj_period_nsec=[EMCMOT]SERVO_PERIOD key=[EMCMOT]SHMEM_KEY num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg=0x378
setp parport.0.reset-time 4000
loadrt stepgen step_type=0,0

addf parport.0.read base-thread
addf stepgen.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
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
net coolant-flood <= iocontrol.0.coolant-flood
# finally connect physical pins to the signals
net xstep => parport.0.pin-03-out
#setp parport.0.pin-03-out-reset 1
#setp parport.0.pin-04-out-invert 1
net xdir => parport.0.pin-04-out
net zdir => parport.0.pin-05-out
net zstep => parport.0.pin-06-out
setp parport.0.pin-06-out-reset 1

net spindle-cw => parport.0.pin-14-out
net spindle-ccw => parport.0.pin-16-out
net coolant-flood => parport.0.pin-02-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 16000
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 16000
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


spindle.hal
linksp girimandrino pyvcp.spindle-speed

custom postgui.hal
# Include your customized HAL commands here
# The commands in this file are run after the AXIS GUI (including PyVCP panel)
# starts
# This file will not be overwritten when you run stepconf again

net posXdro axis.0.joint-pos-fb => pyvcp.Xdisplay

net posYdro axis.1.joint-pos-fb => pyvcp.Ydisplay

net posZdro axis.2.joint-pos-fb => pyvcp.Zdisplay



net spindle pyvcp.spindle halui.program.pause

joypad and jogwheel...

# Hal configuration file to move a cnc machine using a joypad using joyhandle component

# Copyright 2008 Paul Willutzki <paul[at]willutzki[dot]de>

# Licence: GPL

# Version 3

# This Hal-File needs the joyhandle component.
# This uses the following formula for a non linear joypad movements:
# y = (scale * (a*x^power + b*x)) + offset
#
# The parameters a and b are adjusted in such a way, that the function starts at (deadband,offset) and ends at (1,scale+offset).
# Negative values will be treated point symetrically to origin. Values -deadband < x < +deadband will be set to zero.
# Values x > 1 and x < -1 will be skipped to +-scale+offset. Negative scale values invert the movement.
# With power one can adjust the nonlinearity (default = 2).
# Default for deadband is 0.
# Valid values are: power >= 1.0 (reasonable values are 1.x .. 4-5), 0 <= deadband < 0.99 (reasonable 0.1). If you use high deadbands (>0.5) you need higher power values to smoothly start at (deadband,offset).
# The additional offset component can be set in special cases (default = 0).
# All values can be adjusted for each instance (joypad axis) separately.

# Please take also a look at the manpages for johandle.

# Insert the following lines in the INI-File (section [HAL])
# HALUI = halui
# HALFILE = joypad_V3.hal

# Load the hal_input component that creates pins for axes and buttons
# See man hal_input for details and finding input devices
loadusr -W hal_input -5-Axis,12-Button with POV

# load joyhandle component and attach to threads
loadrt joyhandle count=2
addf joyhandle.0 servo-thread # x

addf joyhandle.1 servo-thread # z


setp halui.jog-speed 400 # desired maximum jog speed mm/min

# --Start-- These parameters ara used to set up joyhandle
setp halui.jog-deadband 0. # important: default value is 0.2
setp joyhandle.0.power 4. # select nonlinearity
setp joyhandle.1.power 4.

setp joyhandle.0.deadband 0.1
setp joyhandle.1.deadband 0.1
setp joyhandle.0.scale 1
setp joyhandle.1.scale 1 # negative
# --End--

# connect hal_input to halui via joyhandle
net velX input.0.abs-y-position => joyhandle.0.in
net velXout joyhandle.0.out => halui.jog.0.analog

net velZ input.0.abs-x-position => joyhandle.1.in
net velZout joyhandle.1.out => halui.jog.2.analog

# connect hal_joypad directly to halui without joyhandle
#net velX joypad.axis.3 => halui.jog.0.analog
#net velY joypad.axis.2 => halui.jog.1.analog
#net velZ joypad.axis.1 => halui.jog.2.analog

# comandi button
net spindleOn input.1.btn-top2 => halui.spindle.start
net spindleOff input.1.btn-thumb2 => halui.spindle.stop

net floodon input.1.btn-pinkie => halui.flood.on
net floodoff input.1.btn-top => halui.flood.off

net zerox input.1.btn-base5 => halui.joint.0.home
net zeroz input.1.btn-base3 => halui.joint.2.home
# FUNGO button
net fungoon input.1.btn-trigger => halui.estop.activate
net fungooff input.1.btn-thumb => halui.estop.reset
# ON button
net machineOn input.1.btn-base => halui.machine.on

#bottoni
#base=7*
#base2=8*
#base3=9*
#base4=10*
#base5=11*
#base6=12*
#pinkie=6*
#thumb=2*
#thumb2=3*
#top=4*
#top2=5*
#trigger=1 "fire"***
#hat0y-position (oppure counts) valori -1 0 1
# parte jogwheel
# Jog Pendant
loadrt encoder num_chan=2
loadrt mux4 count=2
addf encoder.capture-position servo-thread
addf encoder.update-counters base-thread
addf mux4.0 servo-thread
addf mux4.1 servo-thread
setp encoder.0.x4-mode 0


setp mux4.0.in0 0.1
setp mux4.0.in1 0.01
setp mux4.0.in2 0.001

setp mux4.1.in0 -0.05
setp mux4.1.in1 -0.005
setp mux4.1.in2 -0.0005

net scale1 mux4.0.sel0 <= parport.0.pin-11-in-not
net scale2 mux4.0.sel1 <= input.1.btn-base2-not

net scale1 mux4.1.sel0 <= parport.0.pin-11-in-not
net scale2 mux4.1.sel1 <= input.1.btn-base2-not

net pend-scale axis.2.jog-scale <= mux4.0.out
net xxxx-scale axis.0.jog-scale <= mux4.1.out

net mpg-a encoder.0.phase-A <= parport.0.pin-12-in
net mpg-b encoder.0.phase-B <= parport.0.pin-13-in

net mpg-x axis.2.jog-enable <= input.1.btn-base4

net mpg-z axis.0.jog-enable <= input.1.btn-base6

net pend-counts axis.2.jog-counts <= encoder.0.counts

net pend-counts axis.0.jog-counts <= encoder.0.counts
#
# qui aggiungo segnale mandrino
#encoder canale singolo per mandrino (filettare e costant velocity cut)
setp encoder.1.counter-mode 1
setp encoder.1.position-scale 360
net mandrino encoder.1.phase-A <= parport.0.pin-10-in
net girimandrino <= encoder.1.velocity

ini file

# If you make changes to this file, they will be
# overwritten when you run stepconf again

[EMC]
MACHINE = TORNIO
NML_FILE = emc.nml
DEBUG = 0

[DISPLAY]
DISPLAY = axis
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/cnc/emc2/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
LATHE = 1
PYVCP = panel.xml

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = emc.var

[EMCMOT]
EMCMOT = motmod
SHMEM_KEY = 111
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 70000
SERVO_PERIOD = 2500000


[HAL]
HALUI = halui
HALFILE = TORNIO.hal
HALFILE = joypad_V3.hal
POSTGUI_HALFILE = spindle.hal
[TRAJ]
AXES = 3
COORDINATES = X Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 4.00
MAX_LINEAR_VELOCITY = 20.00

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl

[AXIS_0]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 10.0
MAX_ACCELERATION = 25.0
STEPGEN_MAXACCEL = 28
SCALE = 130.48
FERROR = 10
MIN_FERROR = 1.25
MIN_LIMIT = -2000.0
MAX_LIMIT = 2000.0
HOME_OFFSET = 0.0
BACKLASH = 0.5200
[AXIS_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 10.0
MAX_ACCELERATION = 25.0
STEPGEN_MAXACCEL = 28
SCALE = 125.0
FERROR = 10
MIN_FERROR = 1.25
MIN_LIMIT = -2000.0
MAX_LIMIT = 2000.0
HOME_OFFSET = 0.0
BACKLASH = 0.5200


Thanx, Lele

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

More
14 May 2009 10:53 - 14 May 2009 10:57 #256 by BigJohnT
Replied by BigJohnT on topic Re:understanding Pluto
Lele,

It might be simpler to start with the lathe-pluto sample configuration from the EMC2 Configuration Selector. Then add your joystick and pyvcp to that... or at least compare the lathe-pluto and see the difference.

John
Last edit: 14 May 2009 10:57 by BigJohnT.

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

More
14 May 2009 11:18 #257 by lelef
Replied by lelef on topic Re:understanding Pluto
:woohoo: I've not found it because it's from version 2.2.3 ,
is this one? www.electronicsam.com/images/KandT/servo...luto/lathe-pluto.hal (only servo version?)

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

More
14 May 2009 12:00 #258 by BigJohnT
Replied by BigJohnT on topic Re:understanding Pluto
Yep that seems to be the one I looked at... Didn't catch that it was servo. I see another one under stepper called pluto_inch that might be better. You should have to only change a couple of things to switch to lathe. At least it is in 2.2.x. So that should give you a start. I don't have a pluto card so I don't have any direct experiance with it...

There is quite a bit of info in the integrators manual on the pluto card:

www.linuxcnc.org/docview/html//drivers_pluto_p.html

John

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

Moderators: PCWjmelson
Time to create page: 0.300 seconds
Powered by Kunena Forum