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

More
04 May 2021 13:00 #207826 by andypugh
You need to keep this section:
# ---closedloop stepper signals---

net c-pos-cmd    <= joint.2.motor-pos-cmd
net c-vel-cmd    <= joint.2.vel-cmd
net c-pos-fb     <= [HMOT](CARD0).encoder.00.position
net c-pos-fb     => joint.1.motor-pos-fb

Except, to avoid following errors, change to this:
# ---closedloop stepper signals---

net c-pos-cmd    <= joint.2.motor-pos-cmd  joint.2.motor-pos-fb
net c-vel-cmd    <= joint.2.vel-cmd
net c-pos-fb     <= [HMOT](CARD0).encoder.00.position

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

More
04 May 2021 14:08 #207830 by NoJo
Now an error - seems there are two net names the same , one in spindle , one in C_axis -

Pin 'hm2_7i92.0.encoder.00.position' was already linked to signal 'c-pos-fb'

report attached..

Can you explain what that error means please? I found

net c-pos-fb <= [HMOT](CARD0).encoder.00.position in the C axis section and

net spindle-revs <= [HMOT](CARD0).encoder.00.position in the spindle section

both nets are assigned the same encoder which seems correct? The same encoder has to serve for C axis positioning and for spindle RPM/index sensing, so I would have thought this is Ok...
I would like to understand the connection here..
Joe
Attachments:

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

More
04 May 2021 14:33 #207832 by andypugh
Yes, the answer is to use the same signal name to refer to the same value.
Change the c-pos-fb signal name to be spindle-revs

And note that, as things stand, the C-axis will be scaled 0 to 1 for a full turn. (we can fix that later)

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

More
04 May 2021 15:17 #207837 by NoJo
Ok, no errors anymore.
No C axis motion either..
Homing Caxis homes the AXIS DRO display - no Caxis motion with/without M100 active
Jogging Caxis jogs the AXIS DRO display. - no Caxis motion with/without M100 active
MDI commands:
M100
G01 Z20 C10 F100 > Z axis moves, Caxis AXIS DRO display moves, but C axis does not move.
HAL file attached has latest state. ini unchanged from your 05-03 version ( except ZX > ZXC)

Andy Thanks for all your help thus far!
Regards
Joe
Attachments:

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

More
04 May 2021 16:44 #207847 by andypugh

Homing Caxis homes the AXIS DRO display - no Caxis motion with/without M100 active


C homing is a puzzle yet to be solved...

Jogging Caxis jogs the AXIS DRO display. - no Caxis motion with/without M100 active


That should be working, though.
Can you poke around with the halmeter and see what the command, feedback and output of pid.c are, after an attempt to jog?

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

More
04 May 2021 16:54 #207849 by NoJo
Something new to learn every day...May take a day to do that as I have never done it and need first to go learn how...
Thanks
Joe

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

More
04 May 2021 17:06 #207851 by andypugh
The Halmeter is in the "Machine" menu in the Axis GUI.
(I have forgotten which GUI you are using)

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

More
04 May 2021 19:02 #207863 by andypugh
I might see the problem. The M100 file has "setp pid.c.enable 1" but pid.c.enable is netted to the c-enable signal. This might be an (invisible) conflict. Try deleting the "net c-enable" line from the HAL.

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

More
05 May 2021 07:01 #207935 by NoJo
Bit of a complicated answer..
looking only at C axis now, with M100 active.
HOME C, no axis movement but DRO in AXIS (GUI) display does zero.
Then JOG C_Axis:
JOG +Ve : C_axis DRO increments and spindle turns then runs continuously, clockwise
Speed of spindle is greater the larger the jog increment is from the zero position.
JOG -Ve : C_Axis DRO decrements, but if not less than zero, spindle still spins clockwise. As soon as decrement moves DRO below zero, spindle reverses direction smoothly, with speed depending on how much negative the DRO value is.
Only way to stop spindle is to get DRO=zero, or M101

HAL_Meter:
PID C output - +Ve value if DRO > zero, and increases, -Ve value if DRO<zero.
PID C Command behaves similarly.
PID C Feedback remain zero.

Appears that the Encoder position is somehow not active or used in positioning? When the spindle is 'running' as above, the RPM display shows the actual rpm, which is correct, so encoder is functional and being read.
Also, you mentioned the C_Axis scale is 0-1 for 360deg, so under the current setup,if I select a C axis jog increment of '0.005mm' this makes the C_axis DRO increment by that amount with each jog click.
A jog of 0.005 makes the spindle turn continuously, but very slowly, and the greater the increment the faster it spins.

I realise this is difficult for you to debug with no test bed - also that is is rather complex. I am happy to jump though any hoops to assist - I really do appreciate your efforts!

Joe

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

More
05 May 2021 07:57 #207940 by andypugh
I see the problem, I was unclear in my instructions.

You had:
net c-enable        =>  pid.c.enable
net c-pos-cmd       =>  pid.c.command
net c-pos-fb        =>  pid.c.feedback
net c-output            pid.c.output => mux2.0.in1

# ---closedloop stepper signals---

net c-pos-cmd    <= joint.2.motor-pos-cmd  joint.2.motor-pos-fb
net c-vel-cmd    <= joint.2.vel-cmd
net c-pos-fb     <= [HMOT](CARD0).encoder.00.position

But because the encoder feedback is already linked elsewhere, you needed:
net c-enable        =>  pid.c.enable
net c-pos-cmd       =>  pid.c.command
net spindle-revs        =>  pid.c.feedback
net c-output            pid.c.output => mux2.0.in1

# ---closedloop stepper signals---

net c-pos-cmd    <= joint.2.motor-pos-cmd  joint.2.motor-pos-fb
net c-vel-cmd    <= joint.2.vel-cmd

(note how the pid.c feedback is now the spindle-revs pin)

The next stage, if that works, will be to add a scale component to calculate spindle position in degrees (or radians, if you want) and use that as the input to pid.c.feedback. That will probably need a change to the C-axis P-gain in the INI to be stable, though.

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

Time to create page: 0.094 seconds
Powered by Kunena Forum