Index Homing odd offset

More
11 years 3 days ago #64490 by OT-CNC
Replied by OT-CNC on topic Index Homing odd offset
Thank you PCW. :cheer:

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

More
11 years 3 days ago #64491 by OT-CNC
Replied by OT-CNC on topic Index Homing odd offset
Just got back from the shop. I changed the hal file and it appears to be closed loop now. Tried tuning again but I think something is still wrong in the hal. I get joint following errors even at slow 5 ipm feed rates. It does not seem to matter what I do with P. (went from 10 to 1000) Also there is an oscillation at rest, maybe +-.010" on the dro. I can feel the ballscrew increase in frequency. Slow to faster then it errors out. Maybe 1hz to 4hz. I added some deadband but that didn't change anything.
The home routine still didn't zero out the dro on index, mostly failed during joint following error as expected.
I'm re-attaching the Z axis section of hal please someone point out what is missing.
Code:
loadrt trivkins loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES loadrt hostmot2 loadrt hm2_pci config=" num_encoders=5 num_pwmgens=1 num_stepgens=3 sserial_port_0=20xxxxx" setp hm2_5i25.0.watchdog.timeout_ns 5000000 loadrt pid names=pid.x,pid.z,pid.s loadrt abs names=abs.spindle loadrt lowpass names=lowpass.spindle addf hm2_5i25.0.read servo-thread addf motion-command-handler servo-thread addf motion-controller servo-thread addf pid.x.do-pid-calcs servo-thread addf pid.z.do-pid-calcs servo-thread addf pid.s.do-pid-calcs servo-thread addf abs.spindle servo-thread addf lowpass.spindle servo-thread addf hm2_5i25.0.write servo-thread #******************* # AXIS Z #******************* setp pid.z.Pgain [AXIS_2]P setp pid.z.Igain [AXIS_2]I setp pid.z.Dgain [AXIS_2]D setp pid.z.bias [AXIS_2]BIAS setp pid.z.FF0 [AXIS_2]FF0 setp pid.z.FF1 [AXIS_2]FF1 setp pid.z.FF2 [AXIS_2]FF2 setp pid.z.deadband [AXIS_2]DEADBAND setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT setp pid.z.error-previous-target true setp pid.z.maxerror .005 net z-index-enable <=> pid.z.index-enable net z-enable => pid.z.enable net z-pos-cmd => pid.z.command net z-vel-cmd => pid.z.command-deriv net z-pos-fb => pid.z.feedback net z-output => pid.z.output # Step Gen signals/setup setp hm2_5i25.0.stepgen.02.dirsetup [AXIS_2]DIRSETUP setp hm2_5i25.0.stepgen.02.dirhold [AXIS_2]DIRHOLD setp hm2_5i25.0.stepgen.02.steplen [AXIS_2]STEPLEN setp hm2_5i25.0.stepgen.02.stepspace [AXIS_2]STEPSPACE setp hm2_5i25.0.stepgen.02.position-scale [AXIS_2]STEP_SCALE setp hm2_5i25.0.stepgen.02.step_type 0 setp hm2_5i25.0.stepgen.02.control-type 1 setp hm2_5i25.0.stepgen.02.maxaccel [AXIS_2]STEPGEN_MAXACCEL setp hm2_5i25.0.stepgen.02.maxvel [AXIS_2]STEPGEN_MAXVEL # ---closedloop stepper signals--- net z-pos-cmd <= axis.2.motor-pos-cmd net z-vel-cmd <= axis.2.joint-vel-cmd net z-output <= hm2_5i25.0.stepgen.02.velocity-cmd net z-pos-fb <= hm2_5i25.0.stepgen.02.position-fb net z-enable <= axis.2.amp-enable-out net z-enable => hm2_5i25.0.stepgen.02.enable # ---Encoder feedback signals/setup--- setp hm2_5i25.0.encoder.02.counter-mode 0 setp hm2_5i25.0.encoder.02.filter 1 setp hm2_5i25.0.encoder.02.index-invert 0 setp hm2_5i25.0.encoder.02.index-mask 0 setp hm2_5i25.0.encoder.02.index-mask-invert 0 setp hm2_5i25.0.encoder.02.scale [AXIS_2]ENCODER_SCALE net z-pos-fb <= hm2_5i25.0.encoder.02.position net z-vel-fb <= hm2_5i25.0.encoder.02.velocity net z-pos-fb => axis.2.motor-pos-fb net z-index-enable axis.2.index-enable <=> hm2_5i25.0.encoder.02.index-enable net z-pos-rawcounts <= hm2_5i25.0.encoder.02.rawcounts # ---setup home / limit switch signals--- net home-z => axis.2.home-sw-in net min-z => axis.2.neg-lim-sw-in net max-z => axis.2.pos-lim-sw-in

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

More
11 years 3 days ago #64493 by PCW
Replied by PCW on topic Index Homing odd offset
The hal file looks basically correct (but the INI file needs looking at also)

What I would suggest is setting the following error (and min following error) fairly large, say 1 inch
and then plotting the following error in halscope

It will be very difficult to tune unless the encoder scale and step/dir scale match (at least with FF1=1)

That is you should be able to set P=0 and still get approximately correct motion by velocity command only (courtesy of FF1)

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

More
11 years 2 days ago #64533 by OT-CNC
Replied by OT-CNC on topic Index Homing odd offset

The hal file looks basically correct (but the INI file needs looking at also)

What I would suggest is setting the following error (and min following error) fairly large, say 1 inch
and then plotting the following error in halscope

It will be very difficult to tune unless the encoder scale and step/dir scale match (at least with FF1=1)

That is you should be able to set P=0 and still get approximately correct motion by velocity command only (courtesy of FF1)


I did the above, and it looks like the motion is correct when run at 12ipm and FF1=1.

A short vid here:




Something is still way off when p get's introduced. The following errors are large and the axis either creeps or bounced back and forth. I tried I and D to see if anything would improve.
Should I be looking at the encoder channel as well?

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

More
11 years 1 day ago #64535 by PCW
Replied by PCW on topic Index Homing odd offset
you might try raising maxerror (to say .050 ) and plotting what happens with a P of 1

BTW I think a screen shot of halscope stopped at an appropriate time would be a lot easier to see

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

More
11 years 1 day ago #64552 by OT-CNC
Replied by OT-CNC on topic Index Homing odd offset
I will try the suggested following error numbers in the ini.
If I understand correctly, the system is trying to keep the following error between FERROR (rapid move) and MIN_FERROR (slow feed rate) values.

How does this come into play in the hal file? Should this be the same number as the FERROR?
setp pid.z.maxerror .0005

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

Time to create page: 0.064 seconds
Powered by Kunena Forum