Home designed and built 5C CNC lathe with ATC and C_Axis

More
5 years 7 months ago #202977 by NoJo
So, just to make sure we are on the same page:
Were your axis homed when you tried to jog?


No, not homed. I did not realize I needed to home before trying to jog.

Are your drives sending the position back to LCNC (eg by encoder output)?

No. The motors look like a normal stepper motor with a stepper drive/controller attached, except motor has an encoder which the drive uses to close the INTERNAL loop, ie, the motor will always try to turn by the number of steps given by using its encoder to know if the step command equals the encoder steps moved.
So it is closed loop, but within the motor. Normal steppers may lose steps due to resonance, etc, these do not- they WILL step, and keep track of steps and not lose any, so long as the max motor torque is not exceeded.

Let me try on the lathe with the limit switches as home indicators, and disable the motor's own homing process. If I can get all that working, then I can mess around with alternatives. And in the meantime read up some more to see if I can discover and understand what you wrote:


HOME_SEARCH_VEL = 0
HOME_LATCH_VEL = 0.1
HOME_USE_INDEX = YES
HOME_SEQUENCE = 0



means..!

Thank you for working at this to try help me see the light!

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

More
5 years 7 months ago - 5 years 7 months ago #202979 by Aciera
See link in edit3 above.

HOME_SEARCH_VEL = 0 => don't look for the home switch
HOME_LATCH_VEL = 0.1 => move at 0.1 machine units/s in the positive direction until the index signal appears
HOME_USE_INDEX = YES => look for the index
HOME_SEQUENCE = 0 => first joint to home



In your INI file each [joint] has it's own homing configuration. This would configure your joint to use 'Index only'. The index here would come from an encoder that is going back to LCNC. For example linear glass scales.
Last edit: 5 years 7 months ago by Aciera.

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

More
5 years 7 months ago #202980 by NoJo
Thank You!
That's the sort of explanation I am looking for to get me going!

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

More
5 years 7 months ago - 5 years 7 months ago #203160 by andypugh
Back to jogging...

Your HAL is set up for jogging with + / - buttons. I don't know if PNCCOnonf knows how to set up jogwheels, but I imagine it would.
So perhaps you forgot to mention the MPG during setup?

Anyway, MPG jogging is handled by pins belonging to the motion module. (You currently have button jogging set up using halui, which is a user-space module, effectively a GUI with no G)

Look at the axis.L.jog-.... pins.

axis.L.jog-counts needs to connect to the MPG counts. Something like:
Code:
net jog-counts hm2_5i25.0.7i73.0.0.encoder-00-counts net jog-counts axis.x.jog-counts axis.y.jog-counts axis.z.jog-counts

And if you want to jog in joint mode too, add those in:
Code:
net jog-counts hm2_5i25.0.7i73.0.0.encoder-00-counts net jog-counts axis.x.jog-counts joint.0.jog-counts net jog-counts axis.y.jog-counts joint.1.jog-counts net jog-counts axis.z.jog-counts joint.2.jog-counts

You might well be asking how the system knows which axis to jog if they are all connected to the same encoder? That is where the jog-enable comes in:
Code:
net x-enable axis.x.jog-enable joint.0.jog-enable hm2_5i25.0.7i73.0.0.input-00 net x-enable axis.x.jog-enable joint.1.jog-enable hm2_5i25.0.7i73.0.0.input-01 net x-enable axis.x.jog-enable joint.2.jog-enable hm2_5i25.0.7i73.0.0.input-02

And as for the scale? That needs a similar structure, but withoiut knowing how you intend to configure the jog increment settings that is a bit harder to guess.
Last edit: 5 years 7 months ago by andypugh. Reason: changed HAL around a bit

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

More
5 years 7 months ago #203208 by NoJo
Andy, Thanks for responding. I am not sure I follow what you said here:


Your HAL is set up for jogging with + / - buttons. I don't know if PNCCOnonf knows how to set up jogwheels, but I imagine it would.
So perhaps you forgot to mention the MPG during setup?


I have separate jog wheels for X and Z, and an encoder for Spindle speed override ( and for a live tool speed overrride - not relevant now). I have set these all up in pncconf ( in 'advanced setup' mode) and can see all the wheels counters and all the switches I have all toggling in HAL_Show in linuxCNC.
Towards the end of the HAL file I attached some posts ago is the setup related to the encoders - (excerpt below - not complete).
So I am not sure what you meany by me forgetting the mention MPG during setup? Am I missing something? ( quite possible at this stage!)
Code:
# ---jogwheel signals to mesa encoder - x axis MPG--- net x-jog-count <= hm2_7i92.0.7i73.0.1.enc0.count # ---mpg signals--- setp axis.x.jog-vel-mode 0 net x-jog-enable => axis.x.jog-enable net x-jog-count => axis.x.jog-counts net selected-jog-incr => axis.x.jog-scale sets x-jog-enable true # ---jogwheel signals to mesa encoder - z axis MPG--- net z-jog-count <= hm2_7i92.0.7i73.0.1.enc1.count # ---mpg signals--- setp axis.z.jog-vel-mode 0 net z-jog-enable => axis.z.jog-enable net z-jog-count => axis.z.jog-counts net selected-jog-incr => axis.z.jog-scale sets z-jog-enable true # connect selectable mpg jog increments net jog-incr-a => jogincr.sel0 net jog-incr-b => jogincr.sel1 net jog-incr-c => jogincr.sel2 net jog-incr-d => jogincr.sel3 net selected-jog-incr <= jogincr.out-f setp jogincr.debounce-time 0.100000 setp jogincr.use-graycode False setp jogincr.suppress-no-input False setp jogincr.in00 0.000000 setp jogincr.in01 0.001000 setp jogincr.in02 0.005000 setp jogincr.in03 0.001000 setp jogincr.in04 0.100000 setp jogincr.in05 0.010000 setp jogincr.in06 0.050000 setp jogincr.in07 0.100000 setp jogincr.in08 0.500000 setp jogincr.in09 0.125000 setp jogincr.in10 0.125000 setp jogincr.in11 0.125000 setp jogincr.in12 0.125000 setp jogincr.in13 0.125000 setp jogincr.in14 0.125000 setp jogincr.in15 0.125000 # connect feed overide increments - MPG setp halui.feed-override.direct-value false setp halui.feed-override.scale .01 net fo-enable => halui.feed-override.count-enable net axis-selected-count => halui.feed-override.counts # ---spindle override signals to mesa encoder - mpg--- net so-count <= hm2_7i92.0.7i73.0.1.enc2.count # connect spindle overide increments - MPG setp halui.spindle.0.override.direct-value false setp halui.spindle.0.override.scale .01 setp halui.spindle.0.override.count-enable true net so-count => halui.spindle.0.override.counts


Then you indicate:

axis.L.jog-counts needs to connect to the MPG counts. Something like:

Code:
net jog-counts hm2_5i25.0.7i73.0.0.encoder-00-counts net jog-counts axis.x.jog-counts axis.y.jog-counts axis.z.jog-counts


I think this is in my HAL file as above?

But this is not ( I could not find it anyway!)

And if you want to jog in joint mode too, add those in:
Code:
net jog-counts hm2_5i25.0.7i73.0.0.encoder-00-counts net jog-counts axis.x.jog-counts joint.0.jog-counts net jog-counts axis.y.jog-counts joint.1.jog-counts net jog-counts axis.z.jog-counts joint.2.jog-counts


What I don't understand is why is the above not in the HAL file? Should this not have been created by pncconf? When I used pncconf to do the setup the result in HAL_Show is that all the connected hardware, encoders, jog wheels, switches are seen.

NOW - a small Eureka moment..
Before hitting submit I went to try some more, as it had been mentioned in some previous posts that I must HOME first else jogging wont work.
I used switches to simulate the home switches, managed to home, and then all jogging works!
The X and Z jog wheels jog fine, using the rates as selected by my 4 position jog step size switch, etc!
The X+,X- and Z+, Z- jog push buttons work ( at rate =1 - where do I change that?) , etc
So I am even more confused now, as the setup seems to work - jogs, etc, but appears to be lacking fundamental enabling statements in the HAL file??

Could I ask that you please explain the jogging concepts in LinuxCNC? I think I am not asking the correct question here, but lack the knowledge to know what I should be asking! What or where are the jog instances that occur in L_CNC - You can jog in 'Axis' and in 'joint' modes? Joint is a 'motor', but that is attached to an Axis and so the axis jogs when you jog the 'joint'?

You said :

And if you want to jog in joint mode too, add those in:

If I did not add 'those' in, what mode am I jogging in? And what moves when jogging then?

Going back to read all the HAL docs again, since it seems the more I learn the less I know!.
Thanks Andy!

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

More
5 years 7 months ago - 5 years 7 months ago #203212 by Aciera

If I did not add 'those' in, what mode am I jogging in? And what moves when jogging then?


The concept is this:

When you start LCNC it's in 'joint' mode. Which means the controller has no concept of how your machine is built in respect to cartesian space, in your case which motors (ie joints) have to be run to move the tool along the X axis or the Z axis.

In your configuration there is this:
Code:
[KINS] JOINTS = 2 KINEMATICS = trivkins coordinates=XZ

Which defines the kinematic of your machine as being 'trivkins' or 'trivial kinematics', this is a file containing the mathematical model of how the joints (ie motors) are related to the X axis and Z axis. I your case this relation is 'trivial' meaning movement of joint0 is proprtional to movement of axisX and movement of joint1 is proportional of axisZ. Your machine as most lathes and mills just happens to be mechanically built in a way that the two coincide, this is however not the case with all machines.

Once the homing procedure has been performed and the controller knows where the joints (ie motors) are positioned in relation to the defined limits the mode is switched from joint-mode to [strike]coordinated-mode[/strike] axis-mode using the mathematical model defined in the kinematics file. In this mode the motor position is fed into the kinematic model and the tool position in cartesian space is then CALCULATED using the formulae in the kinematics file. In your case this just happens to be so trivial that the input into that calculation is identical to the output. The ability to define different kinematics is a VERY powerful feature of LCNC.

As an illustration:
In my robotic arm there are 6 rotational joints (motors) involved to move the tool in cartesian space (XYZABC) so this uses 'non-trivial' kinematics called 'genserkins'. Here the calculation to derive the tool position and orientation in cartesian space from the positions of the six motors involve multiple matrix multiplications. So here if I jog in joint-mode I rotate the individual joints of the arm, while in '[strike]coordinated[/strike]axis-mode' I jog the tool along a cartesian axis (XYZABC). So that is why it makes sense to separate joints and axis.


Once homed and thus in[strike] coordinated[/strike]axis-mode you can switch between the two modes by pressing '$' on the keyboard.

What Andy means is that in your hal if you replace this:
Code:
net jog-counts hm2_5i25.0.7i73.0.0.encoder-00-counts net jog-counts axis.x.jog-counts axis.y.jog-counts axis.z.jog-counts

with this:
Code:
net jog-counts hm2_5i25.0.7i73.0.0.encoder-00-counts net jog-counts axis.x.jog-counts joint.0.jog-counts net jog-counts axis.y.jog-counts joint.1.jog-counts net jog-counts axis.z.jog-counts joint.2.jog-counts

you will be able to jog in joint-mode because the signal named 'jog-counts' coming from hm2_5i25.0.7i73.0.0.encoder-00-counts is not only routed to axis.N.jog-counts that is used in '[strike]coordinated[/strike]axis mode' but also to joint.N.jog-counts that is used in 'joint-mode'.

The X+,X- and Z+, Z- jog push buttons work ( at rate =1 - where do I change that?)


When you say 'at rate = 1' do you mean it jogs in incremental 1mm moves or at a continuous speed of 1mm/min?
Last edit: 5 years 7 months ago by Aciera. Reason: decided to replace 'coordinated mode' with 'axis mode'

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

Time to create page: 0.472 seconds
Powered by Kunena Forum