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

More
5 years 6 months ago - 5 years 6 months ago #205319 by andypugh

NoJo wrote: I added the permanent spindle enable -

Code:
setp [HMOT](CARD0).7i76.0.0.output-15 1
That works - the spindle remains enabled ( it is in fact how I want it finally - I have a manual handwheel to loosen and tighten the 5C collet, and the spindle servo is supposed to hold the spindle fixed against my hand tightening/loosening force - it does too!)
How that will work with the C_Axis mode remains to be battled with..


Actually, that's pretty good news. It will make the C axis easier too.
I would suggest
Code:
net machine-is-on [HMOT](CARD0).7i76.0.0.output-15
. That will enable the drive and lock the spindle when the machine is on (F2 button on many GUIs) . And you can press F2 if you do need to move a spindle or an axis by hand.


At the end, the spindle still does not ramp down and I am digging, but not obvious!

I think this is probably the stepgen enable going false imediately.

You have
Code:
net spindle-enable => [HMOT](CARD0).stepgen.02.enable
which would normally be right, but in this case I would suggest trying
Code:
net machine-is-on => [HMOT](CARD0).stepgen.02.enable
instead.

There is still the issue that e-stop will set machine-is-on to false, and stop the spindle dead. But then that might be what you want.
Last edit: 5 years 6 months ago by andypugh.
The following user(s) said Thank You: timo

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

More
5 years 6 months ago #205326 by NoJo
THAT is a resounding Success!
Thank you Andy. Works perfectly. E-stop does stop all dead, but that is what I would want - Sort of what the 'E' is in E-stop!

This works very well indeed.

I fear I am still in need of much more assistance on this machine!
Still to get going is :

  • C_Axis with proper orient control.
  • Be able to jog the C_Axis with a jog wheel.
  • ATC - much later as the ATC still has to be designed, but for that I would like to have some details of how it will be driven by 'HAL' - read many posts on ATC's, esp EMCO machines, but still know too little.
  • Basic live tool - a single mill spindle fixed in radial or axial plane - also much later as the spindle is in progress.


  • To prioritise I think the C_Axis and its jog is first.
    I very much need guidance on the C_Axis - It is a lot more complex and the few posts I have read that seem very much to be what I wish to achieve are very detailed and created by chaps who really know this stuff well!
    Where do I start?

    It is really nice to watch this lathe do its thing now. The servos are dead quiet, the spindle motor likewise, a 5C collet system so not even any wind noise from the chuck jaws - just sits there and quietly gets on - and then comes to a halt gently!

    Thanks Andy

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

    More
    5 years 6 months ago - 5 years 6 months ago #205360 by andypugh
    Late reply as I have been investigating an idea.

    I liked the idea of configuring the C-axis as a locking-indexer then using the "joint.2.unlock" pin to control whether the spindle was under velocity control or C-axis control.

    But it seems that you can't jog an indexer, and can only do G0 moves.

    Both these restrictions seem arbitrary, I might look in to removing them.

    But, back to your machine:

    It's easy enough to set up a PID controller to add a a second velocity command to the spindle stepgen command for positioning.

    What complicates this is that you might have 1,000,000 full revolutions already on the spindle when you engage the C axis, and the PID would want to unwind (very nearly) all of them to go to +90 degrees, for example.

    Does your spindle encoder work? (It is in the HAL file, I see. Does the HAL pin spindle.0.revs increase by 1 for every spindle rotation?

    (You can test this with the HAL meter, under the "Machine" menu in the Axis GUI.)

    Here is a possible solution.

    1) Define a user M-code to enable C-axis control.
    2) Set up a 4th PID to control the C axis
    3) Add the output of that PID to the spindle velocity command.
    4) When enabling the C-axis PID, also set the "index-enable" for the spindle encoder. This means that there will be a largely uncontrolled movement of up to 1 turn when the C-axis is engaged, but then it will be referenced to the encoder index.

    First you need to make the lathe into a 3-axis machine.

    I suggest making a copy of the entire current working config (just copy the ~/linuxcnc/configs/CNC_lathe folder and rename the new one)

    In the INI in the [DISPLAY] section:
    Code:
    GEOMETRY=XZC


    In the [KINS] section
    Code:
    JOINTS = 3 KINEMATICS = trivkins coordinates=XZC

    Code:
    [TRAJ] COORDINATES = XZ

    Code:
    [AXIS_C] MAX_VELOCITY = 40.0 MAX_ACCELERATION = 100 MIN_LIMIT = -3600 MAX_LIMIT = 3600 [JOINT_2] TYPE = ANGULAR HOME = 0 FERROR = 1.0 MIN_FERROR = .1 MAX_VELOCITY = 40.0 MAX_ACCELERATION = 350.0 P = 2 I = 0.0 D = 0.0 FF0 = 0.0 FF1 = 0.0 FF2 = 0.0 BIAS = 0.0 DEADBAND = 0.0 MAX_OUTPUT = 0.0 MIN_LIMIT = -3600 MAX_LIMIT = 3600 HOME_OFFSET = 0.000000 HOME_SEARCH_VEL =0 HOME_LATCH_VEL = 0

    And see if a C-axis appears in the GUI. (with only these changes it will f-error immediately if you try to move it)

    Then attach the HAL and INI from that config here so that we can have a look at setting up the C-axis.
    Last edit: 5 years 6 months ago by andypugh.

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

    More
    5 years 6 months ago - 5 years 6 months ago #205361 by PCW
    Note that hostmot2 in master supports clearing the stepgen position
    and also supports index on the stepgen
    Last edit: 5 years 6 months ago by PCW.

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

    More
    5 years 6 months ago #205370 by andypugh

    PCW wrote: Note that hostmot2 in master supports clearing the stepgen position
    and also supports index on the stepgen


    I think that we will probably end up ignoring stepgen counts and position, but time will tell.

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

    More
    5 years 6 months ago #205372 by PCW
    You can do that (using encoder feedback only) but it may compromise
    the servo response somewhat.

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

    Time to create page: 0.230 seconds
    Powered by Kunena Forum