Spindle Step/Dir servo ramp down before stop on M stop command.

More
5 years 5 months ago #209213 by andypugh

NoJo wrote: Then connect joint.2.index-enable to the encoder index-enable
Not sure how to do this - where/what is 'encoder index-enable' ?


In the HAL file. The HAL already has a signal defined
Code:
net spindle-index-enable <=> [HMOT](CARD0).encoder.00.index-enable
so use that signal.
Code:
net spindle-index-enable joint.2.index-enable net spindle-index-enable pid.c.index-enable


Do you mean remove set S spindle-index-enable ?

Yes.
The following user(s) said Thank You: NoJo

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

More
5 years 5 months ago #209246 by NoJo

andypugh wrote:

NoJo wrote:

Code:
net spindle-index-enable joint.2.index-enable net spindle-index-enable pid.c.index-enable

Shows still how little I understand...

I tried 'almost' that in the file, but swapped like so
net joint.2.index-enable spindle-index-enable

as you sort of had that sentence order in your comment:
Then connect joint.2.index-enable to the encoder index-enable...
And it gave an error about same name pins...

Ok, I have the files set as I think you want, but am sure I still have something incorrect.
The behaviour now -
Do HOME ALL - All axes home, C rotates slowly to index and stops ( is it the index position?)
Then in MDI, do M100
> gives error = 'must be in joint mode or disabled to un-home'

Then M101, and spin the axis in manual - M03 S100 M05.
The M100 > C oscillates wildly, and goes back to the C DRO position that was set before the M101. The axis is not 'homed' .
and > gives error = 'must be in joint mode or disabled to un-home'

Hal file section:
Code:
#******************* # AXIS C JOINT 2 #******************* setp pid.c.Pgain [JOINT_2]P setp pid.c.Igain [JOINT_2]I setp pid.c.Dgain [JOINT_2]D setp pid.c.bias [JOINT_2]BIAS setp pid.c.FF0 [JOINT_2]FF0 setp pid.c.FF1 [JOINT_2]FF1 setp pid.c.FF2 [JOINT_2]FF2 setp pid.c.deadband [JOINT_2]DEADBAND setp pid.c.maxoutput [JOINT_2]MAX_OUTPUT setp pid.c.error-previous-target true net c-pos-cmd => pid.c.command net spindle-revs scale.degrees.in setp scale.degrees.gain 360 net spindle-degrees scale.degrees.out => pid.c.feedback net c-output pid.c.output => mux2.0.in1 net spindle-index-enable joint.2.index-enable net spindle-index-enable pid.c.index-enable # Here we setup to start machine in C_Axis mode setp pid.c.enable 1 setp mux2.0.sel 1 net c-pos-cmd <= joint.2.motor-pos-cmd joint.2.motor-pos-fb net c-vel-cmd <= joint.2.vel-cmd

INI Section:
Code:
#****************************************** #-# Add Axis C [AXIS_C] MAX_VELOCITY = 1440.0 #was 360 MAX_ACCELERATION = 12000.0 #was 3000 MIN_LIMIT = -3600 MAX_LIMIT = 3600 [JOINT_2] TYPE = ANGULAR HOME = 0 FERROR = 1.0 MIN_FERROR = .1 MAX_VELOCITY = 1440 MAX_ACCELERATION = 12000 P =0.1 I = 0.0 D = 0.0 FF0 = 0.0 FF1 = 0.0027777 FF2 = 0.0 BIAS = 0.0 DEADBAND = 0.05 MAX_OUTPUT = 400 MIN_LIMIT = -3600 MAX_LIMIT = 3600 HOME_OFFSET = 0.000000 HOME_SEARCH_VEL = 0.0 HOME_LATCH_VEL = 50 HOME_SEQUENCE = 1 HOME_USE_INDEX = 1 #******************************************

M100 Script:
Code:
#! /bin/bash halcmd setp pid.c.enable 1 halcmd setp mux2.0.sel 1 halcmd setp halui.joint.2.unhome 1 sleep 1 halcmd setp halui.joint.2.unhome 0 halcmd setp joint.2.home 1 sleep 1 halcmd setp joint.2.home 0

M101 Script
Code:
#! /bin/bash halcmd setp pid.c.enable 0 halcmd setp mux2.0.sel 0

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

More
5 years 5 months ago #209256 by andypugh

NoJo wrote: Shows still how little I understand...


I am winging it myself now too.

I tried 'almost' that in the file, but swapped like so
net joint.2.index-enable spindle-index-enable


That actually creates a new signal called "joint.2.index-enable" which is also an existing pin, so may be disallowed, but would be confusing if not.


Ok, I have the files set as I think you want, but am sure I still have something incorrect.

More likely I have something incorrect, actually.

The behaviour now -
Do HOME ALL - All axes home, C rotates slowly to index and stops ( is it the index position?)
Then in MDI, do M100
> gives error = 'must be in joint mode or disabled to un-home'


Now that I am back at a LinuxCNC machine I am able to experiment.
Try this:

M100 Script:
Code:
#! /bin/bash halcmd setp pid.c.enable 1 halcmd setp mux2.0.sel 1 halcmd setp halui.mode.joint 1 sleep 1 halcmd setp halui.mode.joint 0 halcmd setp joint.2.home 1 sleep 1 halcmd setp joint.2.home 0

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

More
5 years 5 months ago #209257 by andypugh

NoJo wrote: Do HOME ALL - All axes home, C rotates slowly to index and stops ( is it the index position?)


Should be. Does it look like it?

You can make it move faster by changing the [JOINT_2]LATCH_VELOCITY

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

More
5 years 5 months ago #209262 by NoJo

andypugh wrote:

NoJo wrote: Do HOME ALL - All axes home, C rotates slowly to index and stops ( is it the index position?)


Should be. Does it look like it?

You can make it move faster by changing the [JOINT_2]LATCH_VELOCITY


I made an alignment mark on the spindle to headstock, aligned when the encoder is on index, so yes, it is on index - my sentence was structured badly - I guess I meant to ask if it is supposed to home and stop at index - But Yes it is...

The rotation speed to index is fine - takes maybe 1 sec to do 180deg - for homing that is ok..

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

More
5 years 5 months ago - 5 years 5 months ago #209264 by andypugh
I have been thinking about this a little more, and it might be necessary to do a little more fiddling with pins.

I think that, at the very least, we need to turn on the pid and the mux at the same time as the homing command. At the moment they are active for 2 seconds before homing begins and that is probably a problem.
Code:
#! /bin/bash halcmd setp halui.mode.joint 1 sleep 1 halcmd setp halui.mode.joint 0 halcmd setp joint.2.home 1 halcmd setp pid.c.enable 1 halcmd setp mux2.0.sel 1 sleep 1 halcmd setp joint.2.home 0
Last edit: 5 years 5 months ago by andypugh.

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

Time to create page: 0.327 seconds
Powered by Kunena Forum