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

More
22 May 2021 12:28 #209833 by NoJo
Forgive the long post again, but there is a lot to understand!

Otherwise, check the [JOINT_2] *HOME* velocities.

Noted that its joint_1:

why the jog wheels don't work after trying to home....
That is because the machine is stuck in "joint mode" and I don't think that the HAL is set up for joint-mode jogging.
...... Anywhere where there is an axis.x.jog.... pin add the matching joint.0..... pin too. That should fo it.

Or go back to a config that doesn't show joint mode, like you had before. (It's the kinstype "kinstype" change that made joint mode visible)


To progress a little, I commented out the 'kinstype = I'
The 'old' AXIS GUI was back, and so I stuck with that for these tests:

Setup is that I can jog with AXIS GUI buttons before homing all, and that works fine for X and Z - both move fine, at usual vel and accel.
So Z connections are fine, and it jogs fine.
Did not try jog C for now, also not worried abt jog wheels right now..

HOME_ALL ( again..)
X homes OK
Z starts of in wrong direction very fast, stalls, Z DRO keeps incrementing till around 550 (mm), stops and get an error :
'end of move in home state 7'.

C starts to home - ( I did this a few times because behaviour differs depending where C starts from)
If start is very close to index - 10deg say, it goes to index directly, slowly, and stops cleanly.
If C is at say 180deg, it slowly goes to index, then shoots past, maybe a whole turn or so, then starts going back to index, still slowly, but noticeably faster that the slowly in bold above. Gets to index and stops cleanly.

If then I start the spindle on the AXIS GUI Manual screen, increase the RPM to 500rpm, and stop it, it then tries to home again ( correct from what you said how it works). But it oscillates and then comes to index halt.
If I do it again , but set rpm to 2000rpm, stop it, it then oscillates worse, never stabilises or gets to index halt, and has joint following error..

To get back to basics, I took my original Pncconf file - it did only 2 axis and had a jog wheel on X and Z - spindle was not 'implemented' as you then came in with the step/dir spindle config.
Used that and generated a new ini and hal, and ran using those - Homing X and Z worked fine, jogging was fine.
I then took the [AXIS X JOINT 0] and [AXIS Z JOINT 1] sections in that ini and hal, compared them with the sections in the latest files, and they are identical - I then even copied them across to be sure..
So, the Z homing issue is not due the Z setups in the HAL or ini files I fear.

The only other deltas I find are related to mux2 but I think they are just that the inputs are swapped, ie, you swapped in1 and in0 compared to the previous HAL ( abandoned..) implementation. ( and of course all the new C axis/spindle stuff) Certainly nothing to do with Z axis! And Caxis.comp does not reference X or Z....

I am at a loss!

When I ran pncconf for the tests above, there is a place where you set the home direction - where does that get set in the HAL or INI files? trying to see if that is incorrect but cannot find how it is referenced, but regardless, the files compare the same!

Still digging..
Attachments:

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

More
22 May 2021 16:51 #209846 by andypugh
I am away from home until Sunday night. I will be able to look again then.

Open a halmeter and look at the Z axis home-sw-in. (Joint 1)

I think that the C axis oscillation is due to the stepgen accel limit that we used to ramp the spindle down. It means that the velocity stays high even after the PID has asked it to stop. The answer is to move the spindle ramp into the component

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

More
23 May 2021 11:22 - 24 May 2021 09:53 #209890 by NoJo
No rush Andy! This stuff ain't what life is about!
I have big issues with the Z axis and its servo, so I am chasing that at the moment.

Ok, spent the better part of the day on Z, and did not achieve much other than I am convinced this issue is related to the added C Axis/Component functions - there is nothing else!

I Verified the servo programming - step/rev, etc.
I then created a plain 2 axis lathe setup with pncconf, and the X and Z work fine, jog and home fine.
I then tried the 'last' ini/hal combo that we had , just prior to the setup we gave up one - this the set dated 2021-05-03
That works fine - XZ jog and home correctly.

I then took the latest hal/ini files and I copied the Xaxis and Joint0, and ZAxis and Joint1 sections completely from the 2021-05-03 ini/hal set, and replaced those section in the current files.

And Z still does not work.
On startup, I can jog Z with AXIS jog, but it jogs at high speed, and in the wrong direction. The polarity of the SCALE is correct, as it works in the 2021 files - all the parameter in the 2021 files work fine, and are now in the current files!
Homing Z fails instantly with a very fast move, in the wrong direction, and stall. This with the Z in the middle of travel, far from the home switch.
I halmetered:
Joint.1.home > false as we are not home
Joint.1.Homing > went true while trying to home and stayed so/
joint.1.home-sw-in > false as we are not on the switch.
joint.1.home-state-pins > started at 0, and went thru to 7 and stayed there ( initial search-wait)

I checked both ini and HAL for joint.1 issues in the wrong places - none...

It's as though a step pulse train destined for the spindle or C axis goes to the Z instead...

Sorry, something that may help as well..
The Z axis jogs very fast ( with velocity settings that used to work fine, and that work fine in the 2021 files), but I can jog it.
However - When I set DRO to zero, and then jog 100mm, the Z axis moves further, so definitely getting more pulses than it should for that distance, and that also shows why it move so much faster. The setup parameters are correct - they work in the 2021 files...
Last edit: 24 May 2021 09:53 by NoJo. Reason: Further tests done..Added the ini/HAL files

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

More
24 May 2021 09:56 #210045 by NoJo
HAL and ini files not added somehow...
Added here
Attachments:

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

More
25 May 2021 19:06 #210249 by andypugh
Your Z axis problem is almost certainly because there is a whole section of stepgen.01... stuff in the AXIS C / Joint 2 section. That whole block should be deleted, it is over-writing the Z axis parameters with spindle parameters.
I also see that the spindle stepgen limits on accel and velocity are sort-of doubled up, with MAX_VELOCITY and MAX_ACCELERATION being used, and STEPGEN_MAXVEL and STEPGEN_MAXACCEL being present, but unused.

In my testing I have found that the problem with C-axis control is almost certainly with the stepgen accel limits. I am working on adding the spindle ramp to the caxis component.

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

More
25 May 2021 19:32 - 25 May 2021 19:33 #210252 by NoJo
I saw the Stepgen.01 stuff in the C axis section, thought it odd, but left it as it was in the HAl file you provided as the trial to use with the Caxis_comp file you provided. I also read in that same post how you told me to clear out any Joint.01 stuff from where it should not be....
My excuse is based on how little I still know...! I apologize for that, now I see how stupid it was!

I also see that the spindle stepgen limits on accel and velocity are sort-of doubled up, with MAX_VELOCITY and MAX_ACCELERATION being used, and STEPGEN_MAXVEL and STEPGEN_MAXACCEL being present, but unused.


The SPINDLE section is as you provided in your trail HAL file - I was not aware of issues here - I would appreciate if you could explain a little more on the issue - I would like to understand which items specifically are an issue and why please.

I have attached that trial HAL file you provided for info
Again, sorry for being somewhat dense..
Attachments:
Last edit: 25 May 2021 19:33 by NoJo.

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

More
25 May 2021 21:12 #210259 by andypugh
Here is a new version of caxis.comp and a new HAL and INI file to suit.

It works here....
Attachments:

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

More
26 May 2021 14:30 #210352 by NoJo
Thanks for your efforts yet again!

I have tried it and the behaviour is interesting..and scary..
I looked at the files to compare with what we had and since you seemed to have corrected my mess, etc, I thought just give it a go.
Complied/installed, started LCNC, and it gave an error -

hm2_7i92.0stepgen.02.maxvel is to high for current step timings and position scale, clipped to max possible.

Thought the problem is somewhere here-

[AXIS_C]
MAX_VELOCITY = 1440
MAX_ACCELERATION = 1200
MIN_LIMIT = -36000
MAX_LIMIT = 36000

[JOINT_2]
TYPE = ANGULAR
HOME = 0
FERROR = 1000
MIN_FERROR = 1000
MAX_VELOCITY = 1440
MAX_ACCELERATION = 1200
STEPGEN_MAXVEL = 1600
STEPGEN_MAXACCEL = 1600

Change to this:

][AXIS_C]
MAX_VELOCITY = 300
MAX_ACCELERATION = 500
MIN_LIMIT = -36000
MAX_LIMIT = 36000

[JOINT_2]
TYPE = ANGULAR
HOME = 0
FERROR = 1000
MIN_FERROR = 1000
MAX_VELOCITY = 300
MAX_ACCELERATION = 500
STEPGEN_MAXVEL = 1600
STEPGEN_MAXACCEL = 1600

Error remained, so changed to this:

][AXIS_C]
MAX_VELOCITY = 300
MAX_ACCELERATION = 500
MIN_LIMIT = -36000
MAX_LIMIT = 36000

[JOINT_2]
TYPE = ANGULAR
HOME = 0
FERROR = 1000
MIN_FERROR = 1000
MAX_VELOCITY = 300
MAX_ACCELERATION = 500
STEPGEN_MAXVEL = 100
STEPGEN_MAXACCEL = 200

and the error went away.

Then HOME ALL
XZ home fine
C goes to index very slowly, @ index shoots past and returns to index very slowly.
Then SPINDLE ON @ 500 rpm for a few sec and off again
Spindle decelerates VERY slowly, 'almost' halts' - 'somewhere' and then VERY RAPIDLY ( like 1000RPM..) goes to index and sometimes bangs to a halt there, sometimes goes past and returns slowly.

Also, After HOME ALL-
MDI - G0 C180 ( C goes to 180.547 deg, not 180deg - G0 C360 goes to 2X180.547deg..)
Then run spindle @ 500rpm for 5sec, stop spindle
C goes to the DRO value - 180.547deg, not home position.

The first run of the files I did not 'fix' the 'hm2_7i92.0stepgen.02.maxvel is to high' and just ran the file - the VEL and ACCEL values were very high ( at least, they were as we had them in the previous C axis attempt..)
The spindle servo has a peak torque of 85NM, and HOME ALL was with a BIG BANG if C was more than a few deg away from index.
If it managed to home, and I ran the spindle, on stopping and going to the index (or DRO Value) position, with a VERY FAST motions, it was with such a bang, it tore the 8-sheeve reinforced drive belt and faulted the servo!

So, a C homing instability, C not homing to index, but to last DRO value when spindle run/halt, and C DRO value incorrect..

Sure I am beginning to annoy you!

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

More
26 May 2021 17:23 #210365 by andypugh

MAX_VELOCITY = 1440

I thought that these seemed high, but they were in the INI as comments as your previous values.

C goes to index very slowly, @ index shoots past and returns to index very slowly.

It shouldn't shoot past. but you can change how fast it moves by increasing the HOME_LATCH_VELOCITY.
Bear in mind that my simulation of your spindle has completely different dynamics to your spindle.


Spindle decelerates VERY slowly

This was deliberate, to prove that it works on my tiny model spindle. Change [SPINDLE_0]MAX_ACCEL (I think, look in the HAL for caxis.spindle-maxaccel)

VERY RAPIDLY ( like 1000RPM..) goes to index and sometimes bangs to a halt there, sometimes goes past and returns slowly.

There is still a lot of tuning of pid limits to do, and various speeds. But that can only be done on your real hardware.

C goes to the DRO value - 180.547deg, not home position.

The .547 might be a home offset Are you showing relative or machine position?
Going to the DRO position is now what it is meant to do. It no-longer homes after a spindle mode run, but instead goes to the previous C position. We could reinstate homing, but I don't think it should be necessary.

it tore the 8-sheeve reinforced drive belt and faulted the servo!

Sorry about that. Maybe try winding all the velocities and gains for the spindle down to smaller numbers and adjust to where the behaviour suits you.

I think it is behaving pretty much like I expected, though it was a lot less intimidating with a NEMA 8 stepper motor.

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

More
26 May 2021 20:06 #210391 by NoJo
Thanks Andy. I will try again tomorrow, esp with gains!

One question - for now..
In the ini [JOINT_2] section

DIRSETUP = 5000
DIRHOLD = 5000
STEPLEN = 5000
STEPSPACE = 5000
STEP_SCALE = 1600

the 1600 STEP_SCALE came across with your previous ini file - my servo is set for 8000 steps/rev - should that not be 8000?

It is so in the spindle section :
DIRSETUP = 10000
DIRHOLD = 10000
STEPLEN = 1000
STEPSPACE = 1000
STEP_SCALE = 8000

I don't understand how it works at the moment with it @ 1600 - the angular position the C axis moves to is correct ( except for the 180.547deg issue - will verify tomorrow) so somehow that step_scale is not used - presumably because the C axis position is from the encoder? Is it unused here?

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

Time to create page: 0.103 seconds
Powered by Kunena Forum