Schaublin 125-CNC retrofit.

More
3 years 2 months ago - 3 years 2 months ago #277477 by smc.collins
Replied by smc.collins on topic Schaublin 125-CNC retrofit.
you won't have to bolt on a encoder, just a simple hall effect sensor and a few magnets mounted with glue or a split collar on the bottom, and if you put a ac servo drive in the circuit that'll deal with your contactor leakage as well. 

in step direction mode, could use 3 outputs from a mesa care, 1 fwd 1 rev 1 pulse, the rest will be in the drive config, just make sure the drive can take a low pulse per rev count. 


as far as ease, writing the software, far easier with a few if else statements and some equations and a switch statement to have it look at incoming speed request, select the correct position, send a few pulses, leave the rest to the vfd
Last edit: 3 years 2 months ago by smc.collins.

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

More
3 years 2 months ago #277478 by spumco
Replied by spumco on topic Schaublin 125-CNC retrofit.


Any thoughts on the VFD closed loop PID needing different PID values based on the overall system gear ratio?
 

Mark,

Not a PID expert, but probably yes - you'll want two.  My instinct tells me that the system will be more responsive in low gear (less reflected inertia?), vs high gear.  Or maybe the other way 'round, as there's more mass to spin up in low gear.

Either way having two PID's is a good idea - especially if you switch between a big, heavy 4-jaw chuck (low-gear) and a light collet chuck with small stock (high gear).

It's not terribly hard to set up two PIDs for a single output, although tuning them can be a little fussy.  A good example would be a milling spindle which needs to be oriented for an ATC. In my case I've got PID.spindle and PID.orient, and flip between them in HAL when orienting for a tool change.

If you can't find an example on the forum let me know and I'll try to post up a cleaned-up version for you to use as seed-corn (without a bunch of unnecessary junk in it).

And another thing while you're brain is in gear-change & variator-control-mode...

Have you thought about some 'actual' cuts you want to make?  Maybe write down a few realistic jobs you might like to do:
  • turning a 75mm steel shaft down with some stepped shoulders
  • Drill a bigish hole in something with an insert drill, then use the same drill as a boring bar
  • biggest thing you might want to face
  • Conical feature on the end of a part where you really want a nice surface finish (opposed to facing with CSS and you can clean up the backside in Op2)
Think of the order of operations and tools to use, and what the various spindle speeds will be throughout the job.  Anything strike you as 'crossing the line' between the speed ranges which would require a gear change (mid cut or with the same tool) or a faster response than the variator can handle?

Reason I mention this is because it occurred to me that if you use canned cycles from CAM, it may be a challenge to get LCNC to play nicely on a cut that crosses some RPM threshold.  Like facing large diameter - you don't want a cut starting in low gear and then trying to stop halfway through when it reaches the top end of low gear range.

As you've mentioned, I think this is why modern lathe manufacturers just throw a massively oversized motor at the spindle and trade inefficiency for control simplicity.  And these days a bigger motor is probably cheaper than a gearbox.
The following user(s) said Thank You: smc.collins

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

More
3 years 2 months ago #277481 by rodw
Replied by rodw on topic Schaublin 125-CNC retrofit.
Mark,
This version compiles. 
I made some changes to be a bit more defensive. eg. making sure a change to the gear while its executing a change is seen and actioned when the current move is completed and setting an out of range gear to be numgears.

Note a 5 second traverse time has 6 gears (0-5)
Two things I thought of:
1.  In the top gear (5) and the lower gear (0), we probably need to ensure the limit switches are hit.
2. There should be a pin to calibrate the component by measuring how long it takes to get from one limit switch to the other.
3. Sould this calibration be run on startup so that the traversetime s accurately measured?

Without 2, there will be a mismatch with downshifts vs upshifts.
So once this is perfected, you could do some trials and measure spindle speeds at different settings to determine repeatability. Then you can write something like my compomnent.
Let me know your thoughts as I can add a couple more features
 

File Attachment:

File Name: variator.comp
File Size:2 KB
The following user(s) said Thank You: RotarySMP, smc.collins

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

More
3 years 2 months ago - 3 years 2 months ago #277514 by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
Thanks a lot Rod. This evening I will continue with the EMI trouble shooting. Once that is sorted, I will try out this comp.

Since I am not good enough a programming to understand this code in it's entirity, I find it really helpful to use ChatGPT to explain code line by line. It is a useful learning tool specifically with respect to programming.
Last edit: 3 years 2 months ago by RotarySMP.
The following user(s) said Thank You: rodw

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

More
3 years 2 months ago #277530 by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
I didn't realise how simple and elegant it is to set up a state machine in a comp.

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

More
3 years 2 months ago #277531 by rodw
Replied by rodw on topic Schaublin 125-CNC retrofit.

I didn't realise how simple and elegant it is to set up a state machine in a comp.
Yes its pretty cool! I was surprised how easy it was to code. Without the state machine there would be lots of nested if/else spaghetti code!
The hard bit is often to decide what algorithm to use. If you get it wrong, it can be  a lot harder than it needs to be.
its an ideal demonstrateion what a component should look like. Short (68 lines) with a single, clearly defined problem being solved.
Why I've never used classic ladder. :)

 
The following user(s) said Thank You: RotarySMP

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

Time to create page: 0.463 seconds
Powered by Kunena Forum