Spindle orient PID tuning [re-solved, yay]

More
4 years 4 months ago #245348 by spumco
Two halscope screen shots attached with pid.o.feedback included.  First one failed to orient in time, second one nailed it quickly.

pid.0.feedback doesn't seem to be doing a whole lot - it's basically the same thing as orient.0.position and doesn't reset to "0" between orient commands so there's no way to trend anything.

Unless I've got my HAL connections horribly wrong?

And another thing...

I just noticed it's not going to the same orient location each time I start up the machine.  I spent quite some time fiddling with the INI orient_offset a couple days ago to get it perfectly lined up with the carousel pockets, and the 'completed' orient cycle today (attached) wound up about 60 degrees off from the last time I had the machine running.

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

More
4 years 4 months ago #245361 by tommylight
That is a loooooong hal file ! :)
Just an advice to make your life easier, add the Orient section with their respective values to the INI file and add references to them from the HAL file, that way you can open "calibration" from the "machine" menu in LinuxCNC and do tuning without the need to restart LinuxCNC after every value change.

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

More
4 years 4 months ago #245372 by spumco
Thanks Tommy.  All that stuff is in HAL for the moment because it's easy to tune it right from halshow.

Once everything is sorted out I'll move them to INI and probably create a number of hal files for the various i/o, spindle, ATC, etc.
The following user(s) said Thank You: tommylight

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

More
4 years 4 months ago #245420 by spumco
For those of you still following along patiently, I got tired of trying to get the spindle to orient and failing.  Maybe with more tuning it'd be OK, but I really need it to be 100% reliable.  Even 99% reliable means 1 out of 100 tool changes will fail - not acceptable.

I think the biggest probelm is that I've got a 2-pole induction motor spindle, and the VFD just isn't capable of really fine, low-speed positioning type moves.  The VFD is great at low RPM, but it's fighting the motor and spindle inertia.

And I'm sure Andy (and others) are sick of holding my hand through this one even if they haven't bit my head off yet.image missing /media/kunena/emoticons/sad.png

So... I concluded a mechanical solution was in order.  LCNC gets it close, and a shot-pin of some sort nails the position.

Step 1 - find an air cylinder.  (happened to have a couple of cute little Festos in the junk drawer)
Step 2 - mount something on the spindle with a notch for the air cylinder to engage
Step 3 - mount something on the end of the air cylinder to engage the notch
Step 4 - fire the air cylinder and then run the orient cycle
Step 5 - spindle orients, gets close, and the air cylinder forces whatever it is in to the notch and locks it in the right place.

Taking a page from the old Fadal orientation lock assembly, I turned a brass ring that fits over the spindle upper preload nut.  This nut has 3 spanner pockets just right for set screws to lock in.  Drill 3 holes for set screws, mount it on the nut with a slight press fit, and snug it down.

Mount some 11mm OD roller bearings to the end of an air cylinder.  These roll on the brass ring while it's doing the orient move.

Slide the ATC carousel in and engage a pocket on a tool in the spindle. Rotate the tool in the fork a bit (my forks have BT30 alignment tangs), and mark where the air cylinder lock rollers just touch the ring.

Get the ring off, and use a 3/8" end mill to plunge straight down through the ring. I made the arc pocket about 0.100" deep (radius), so a little less than 1/4 of the bearings drop in to the pocket.  And because the pocket is slightly narrower than the bearing, the bearing is only touching at two contact lines - no rocking back and forth in a valley.  Plus the pocket can wear a bit over time and still have precise alignment.

Connect the air cylinder to a solenoid valve with some speed valves so it doesn't slam.

Connect the valve to a spare Mesa output, and then to motion.digital-out-nn. Solenoid valve is a 3-way, so the rest position is retracted.

Extending the rollers and letting them ride on the brass ring seems to work just fine - LCNC moves the spindle at M19, and it just has to get within about +/- 10 degrees and the air pressure on the bearings forces the pocket (and thus the spindle) in to alignment.  LCNC sees that it's within the alignment tolerance and shuts off - no fighting the alignment lock.

Just tested it and it nailed the orient in half a second 10 out of 10 times.  No fighting, no drama, no noise - bang on.

Next step is to wire up the proximity sensor that came with the cylinder and connect it to motion.digital-in-nn for a safety function.  I don't want the spindle to start with this thing engaged.  On the other hand, I think the roller & shallow pocket will cause way less damage than a traditional tapered pin & notch if something goes sideways.

And I've got a spare air cylinder if I do damage something...image missing /media/kunena/emoticons/wink.png

There's probably a more elegant way to do this, like using a spring-loaded bellcrank so the air cylinder rod isn't seeing any side loads.  But this seems to work and now I can get back to the main ATC project.
The following user(s) said Thank You: tommylight, Clive S, mgm

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

More
4 years 4 months ago #245437 by mgm
Hello Ralph,

that is a super execution ...
M19 needs an encoder in the spindle or?
Is there an alternative to orient if I do not have an encoder.

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

More
4 years 4 months ago #245438 by spumco
MGM-

I genuinely don't know if M19 requires an encoder.  Like everything in LCNC, there are usually about 12 (or more) ways to skin a cat.

If your objective is to position the spindle anywhere you want, then it either needs to be controlled like an axis/joint or through M19 orient.  In either case some sort of feedback would be needed.

If the spindle is controlled via step-direction, I can imagine a single index signal could reset a step counter and LCNC could 'count' how many steps from that signal during a positioning move.  This is, in my mind, similar to the recent 'counts' mode for carousel.comp.

If your objective is to simply line it up for an ATC, then I bet there are ways to do it without M19 and without an encoder.  Off the top of my head I can imagine having a user-defined M-code that starts the spindle at low speed, deploys a shot pin, and shuts the spindle off when the shot pin drops in to place.  If the spindle drive (VFD, servo, etc.) has user programmable inputs, it might be smart to trigger a 'low-torque' setting in the drive during the positioning move.

There are plenty of spindle tapers that don't require the spindle be aligned.  ISO20 or 30, some HSK variants, even BT30 if you remove the drive dogs.  Some vendors sell BT30 holders that don't have dog slots, and I've read some internet speculation that the drive dogs aren't really needed on BT30 below about 4hp - but that speculation probably didn't consider gear reduction with large diameter tools.

I guess a shorter answer would be that it depends on your hardware and objective.  What do you have (or can afford), and what do you want to do with it?  What function(s) is required, and what is nice-to-have?

-Ralph

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

Time to create page: 0.130 seconds
Powered by Kunena Forum