homing & encoders

More
17 May 2009 19:33 #286 by gtom
homing & encoders was created by gtom
Need some information:

are the encoders reset to 0 when machine is in "home-position" ? If not, ist there a way to do this?
Found nothing in emc-doc.

regards, Thomas

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

More
17 May 2009 21:15 - 17 May 2009 21:18 #287 by BigJohnT
Replied by BigJohnT on topic Re:homing & encoders
I would assume you would have to code that in your .hal file using halui.joint.#.is-homed and a oneshot into encoder.N.reset. There might be other ways...

John
Last edit: 17 May 2009 21:18 by BigJohnT.

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

More
22 May 2009 19:57 #334 by gtom
Replied by gtom on topic Re:homing & encoders
Well, i tested index-enable for mesa encoder and axis.*.index-enable.
Set all Home-Settings "0" : Home,Home_Position, Home_Offset.

There is still a "strange" behaivour of hostmot2 Stepgen:

If Homing reaches the encoder-Index the Machine wants to move back to the origin-position where i started the homing, also the Stepgen ignores Max_vel during this move back. I got a joint-follow error, pressed OK (for the error-message) then F2 to switch machine on, Stepgen accelerated again and so on... Same config but stepgen on a parport ist totally different, seems that parport stops after an error and hostmot stepgen wants to complete the move... !?

Question: How do i reset the encoder-index properly? What happens AFTER the index was reset???

regards, Thomas

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

More
23 May 2009 13:48 #335 by BigJohnT
Replied by BigJohnT on topic Re:homing & encoders
If your using an index pulse to home with it should follow one of the last two diagrams in this link .

Are you using the encoders with stepgen in some other way than just using the index pulse?

Also take a look at HOME_FINAL_VEL in the same link above. It controls the speed of the last move if not it is done at a rapid rate.

Maybe Seb or Peter can chime in on the hostmot2 issue...

Regards,
John

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

More
23 May 2009 18:56 - 23 May 2009 19:04 #336 by gtom
Replied by gtom on topic Re:homing & encoders
Well, the diagrams are different from the table under 0.1.2 HOMING SEQUENCE.
This Table tells me that the following setup should work:

HOME = 0
HOME_POSITION = 0
HOME_SEQUENCE = 0
HOME_OFFSET = 0
HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = -2
HOME_USE_INDEX = YES

Why does the machine move back to the position where the Homing started?
Index is tripped (Hal -> index--pin ist set to FALSE)

Example:
X-Positin is 300mm
Index is at 150mm
Homing starts normal and the axis moves at Latchvel down (to 0), index is tripped, machine goes at a rapid speed (beyond all Max_VEL defs in the Ini-File) back to the point where i started the home-procedure... ???
Last edit: 23 May 2009 19:04 by gtom. Reason: Forgot someth

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

More
24 May 2009 00:54 #337 by BigJohnT
Replied by BigJohnT on topic Re:homing & encoders
Yes, I see that the diagrams lack the no switch option that is shown in the table.

Sorry, but I don't have a clue as to why it behaves that way. I've never tried the no switch option. You might need to log on to the IRC and ask one of the developers.

www.linuxcnc.org/component/option,com_mo...rc/Itemid,8/lang,en/

Regards,
John

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

More
25 May 2009 10:21 #340 by gtom
Replied by gtom on topic Re:homing & encoders
Hello, thanks for the answers,
I've tested the homing on index as described in the last 2 diagrams, but they have the same error: After the Index was hit the axis wants to move back again, always to the direction where the homing started. This does NOT happen when i use the setup with Stepgen over Parport. Rest of the Ini & Hal ist untouched. The last move is extremely FAST, i mean faster than everything defined for that machine, it seems that the Hostmot Stepgen does not even accelerate, think that it just starts stepping (causing Joint-Follow errors, same as in version before 2.3.1, no way to stop this except exiting emc and starting again)
All Home-Velocity values are set very low. Hm2 was updated to 2.3.1. Versions of HM2 did not change, right? Before the update dmsg gave me 0.15 & 0.6 Versions, same after the update.
Any ideas???

regards, Thomas

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

More
25 May 2009 13:05 - 25 May 2009 13:09 #343 by BigJohnT
Replied by BigJohnT on topic Re:homing & encoders
Thomas,

That sounds like a bug in hostmot2. I'll try and get Seb's attention today and let him know.

Just to make sure I understand are you just using the index pulse for homing? If so I should be able to duplicate that here sometime today with my 5i20 once I get my stepper wired up.

Edit: I also sent Seb an e-mail on this.

Regards,
John
Last edit: 25 May 2009 13:09 by BigJohnT.

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

More
25 May 2009 15:12 #344 by gtom
Replied by gtom on topic Re:homing & encoders
Yes, i had this problem (accelerating after Joint-Follow-Errors before installing 2.3.1), now this Problem is gone except when i do a home on index (no matter what kind of homing Index-Only / Index + Switch)

If i use just HOME-Switches everyting seems to be ok. Well, there is still an "abnormal" acceleration on the beginning of the final move (Stepgen accels for about 1/4 second too much but returns immedeatly to the programmed Velocity. To make those test i've set all home-related velocitys to 2.0.

regards, Thomas

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

More
25 May 2009 16:13 #346 by gtom
Replied by gtom on topic Re:homing & encoders
Following my ini (just till Axis: X)

[HOSTMOT2]
DRIVER=hm2_pci
BOARD=5i20
CONFIG="firmware=hm2/5i20/SVST8_4.BIT num_encoders=4 num_pwmgens=0 num_stepgens=3"

[EMC]
MACHINE = HM2-Stepper
NML_FILE = emc.nml
#DEBUG = 0x00000003
#DEBUG = 0x00000007
DEBUG = 0

[DISPLAY]
DISPLAY = tkemc
LANG = de
POSITION_OFFSET = ABSOLUTE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 2
PROGRAM_PREFIX = //home/gtom/nc
INCREMENTS = 10mm 5mm 1mm .5mm .1mm .05mm .01mm .005mm
EDITOR = gedit
TKEMCEX = 1
WIDTH = 800
HEIGHT = 800
X = 1
Y = 1
USE_JOGWHEEL = 1

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = hm2-stepper.var

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
SERVO_PERIOD = 1000000
TRAJ_PERIOD = 10000000

[HAL]
HALFILE = hm2test.hal
#HALCMD = save neta

[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
#CYCLE_TIME = 0.020
DEFAULT_VELOCITY = 6.00
MAX_LINEAR_VELOCITY = 8.00
POSITION_FILE = position.txt
MAX_VELOCITY = 8.0
DEFAULT_ACCELERATION = 8
MAX_ACCELERATION = 10
NO_FORCE_HOMING = 1

[AXIS_0]
TYPE = LINEAR
MAX_VELOCITY = 6.0
MAX_ACCELERATION = 8.0
STEPGEN_MAXACCEL = 8.2
SCALE = 320.0
FERROR = 1
MIN_FERROR = 0.9
MIN_LIMIT = -200.0
MAX_LIMIT = 200.0

HOME = 0
HOME_POSITION = 0
HOME_SEQUENCE = 0

## Homing with Index
HOME_OFFSET = 180
HOME_SEARCH_VEL = 4
HOME_LATCH_VEL = -4
HOME_FINAL_VEL = 4
HOME_USE_INDEX = YES
HOME_IGNORE_LIMITS = YES

DIRSETUP = 200
DIRHOLD = 200
STEPLEN = 4000
STEPSPACE = 4000

.
.
.

And this is my hal (also till X-Axis)

loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
#loadrt probe_parport

# hostmot2 driver
loadrt hostmot2

# load low-level driver
loadrt [HOSTMOT2](DRIVER) config=[HOSTMOT2](CONFIG)

# watchdog
setp hm2_5i20.0.watchdog.timeout_ns 10000000

# THREADS
addf hm2_5i20.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf hm2_5i20.0.write servo-thread
addf hm2_5i20.0.pet_watchdog servo-thread

# io- spindle
net spindle-cw <= motion.spindle-forward

# io- coolant
net coolant-flood <= iocontrol.0.coolant-flood

#linear encoders
setp hm2_5i20.0.encoder.00.scale 200
setp hm2_5i20.0.encoder.00.index-enable 1
setp hm2_5i20.0.encoder.00.filter 1
setp hm2_5i20.0.encoder.01.scale 200
setp hm2_5i20.0.encoder.01.index-enable 1
setp hm2_5i20.0.encoder.01.filter 1
setp hm2_5i20.0.encoder.02.scale -200
setp hm2_5i20.0.encoder.02.index-enable 0
setp hm2_5i20.0.encoder.02.filter 1

# connect encoder index-enables for homing on index

net Xindex-enable hm2_5i20.0.encoder.00.index-enable <=> axis.0.index-enable

net Yindex-enable hm2_5i20.0.encoder.01.index-enable <=> axis.1.index-enable


#gpio
setp hm2_5i20.0.gpio.024.is_output 1
setp hm2_5i20.0.gpio.025.is_output 1
setp hm2_5i20.0.gpio.026.is_output 1
setp hm2_5i20.0.gpio.028.is_output 0
setp hm2_5i20.0.gpio.029.is_output 0

#set stepgen.2 z-direction
setp hm2_5i20.0.gpio.061.invert_output 1

# IO-> MESA
net spindle-cw => hm2_5i20.0.gpio.024.out
net coolant-flood => hm2_5i20.0.gpio.025.out
net both-home-y <= hm2_5i20.0.gpio.029.in
net both-home-x <= hm2_5i20.0.gpio.028.in


#X
# enable chain
newsig emcmot.00.enable bit
sets emcmot.00.enable FALSE
net emcmot.00.enable <= axis.0.amp-enable-out
net emcmot.00.enable => hm2_5i20.0.stepgen.00.enable
# position command and feedback
net emcmot.00.pos-cmd <= axis.0.motor-pos-cmd
net emcmot.00.pos-cmd => hm2_5i20.0.stepgen.00.position-cmd
#net motor.00.pos-fb <= hm2_5i20.0.stepgen.00.position-fb
net motor.00.pos-fb <= hm2_5i20.0.encoder.00.position
net motor.00.pos-fb => axis.0.motor-pos-fb

# homing
net both-home-x => axis.0.home-sw-in
net both-home-x => axis.0.neg-lim-sw-in
net both-home-x => axis.0.pos-lim-sw-in

# timing parameters
setp hm2_5i20.0.stepgen.00.dirsetup [AXIS_0]DIRSETUP
setp hm2_5i20.0.stepgen.00.dirhold [AXIS_0]DIRHOLD
setp hm2_5i20.0.stepgen.00.steplen [AXIS_0]STEPLEN
setp hm2_5i20.0.stepgen.00.stepspace [AXIS_0]STEPSPACE
setp hm2_5i20.0.stepgen.00.position-scale [AXIS_0]SCALE
setp hm2_5i20.0.stepgen.00.maxaccel [AXIS_0]MAX_ACCELERATION
setp hm2_5i20.0.stepgen.00.maxvel 0
setp hm2_5i20.0.stepgen.00.step_type 0
.
.
.

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

Time to create page: 0.110 seconds
Powered by Kunena Forum