Schaublin 125-CNC retrofit.
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 687
- Thank you received: 123
09 Aug 2023 19:28 #277465
by smc.collins
Replied by smc.collins on topic Schaublin 125-CNC retrofit.
saw that, if you can get a cheap servo drive, you could in theory, put a hall sensor and a magnet on the screw, feed that into a servo drive, set the servo drive in step/dir mode. then keep the current motor and use it as a servo. making a simple hall effect sensor to pickup a single pulse per rev " or some minimal count" then configuring the drive would allow you to keep the existing hardware and get you the adjustability you desire.
you can also handle the ratio v rpm v spindle vfd output in a few simple lines of if/else statements and some equations in a hal component. I kinda already have something sketeched out for my spindle
you can also handle the ratio v rpm v spindle vfd output in a few simple lines of if/else statements and some equations in a hal component. I kinda already have something sketeched out for my spindle
The following user(s) said Thank You: RotarySMP
Please Log in or Create an account to join the conversation.
09 Aug 2023 19:42 - 09 Aug 2023 19:45 #277466
by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
Given the mechanical variator speed change loop is a less responsive, slower control loop, enclosed by the faster and more responsive VFD loop, what advantage could there be in doing all the work to pull it all out, add that encoder, wiring up a VFD etc.
It would give infinitely variable, more accurate variator control. Sounds like a good thing. But that would be functionally invisible, as the VFD control loop would make the system performance indistinguishable from the much cruder five timed ratios, open loop variator control which can be implemented with zero mechanical or electrical changes. Given both need a comp written, for me the effort equation is:
Plan B (your plan) Plan A (my plan)
Change mechanical plus electrical plus write comp > write comp.
So the right side of the equation wins.
It would give infinitely variable, more accurate variator control. Sounds like a good thing. But that would be functionally invisible, as the VFD control loop would make the system performance indistinguishable from the much cruder five timed ratios, open loop variator control which can be implemented with zero mechanical or electrical changes. Given both need a comp written, for me the effort equation is:
Plan B (your plan) Plan A (my plan)
Change mechanical plus electrical plus write comp > write comp.
So the right side of the equation wins.
Last edit: 09 Aug 2023 19:45 by RotarySMP.
Please Log in or Create an account to join the conversation.
09 Aug 2023 19:44 #277467
by rodw
Replied by rodw on topic Schaublin 125-CNC retrofit.
A component is similar to the Arduino loop() function except it is called at precisely 1 ms intervals by the servo-thread.
So there is no need to loop, you just wait for the next iteration.
I think the variator should be controlled by is own component to keep it clean. It will get complicated if it includes the backgear.
There is a variable fperiod which contains the actual time for each servo cycle in seconds
You need to define some static variables that persist between servo cycles to track things.
to wait for 1 second, you just wait until the sum of the time Is > 1 second.
I think your 5 second time period in 1 second increments actually gives you 6 gears (0-5)
If you had a couple of parameters geartime (eg 5 seconds) and numgears, you could experiment with the number of gears.
I'll have a bit of a think about it over the next few days.
PS You are getting famous. After watching your variator video, the news feed on my Android phone included a link your latest video so I am on top of your EMI issue. Should be trivial to fix. Its not noisy interference ridden plasma cutter!
So there is no need to loop, you just wait for the next iteration.
I think the variator should be controlled by is own component to keep it clean. It will get complicated if it includes the backgear.
There is a variable fperiod which contains the actual time for each servo cycle in seconds
You need to define some static variables that persist between servo cycles to track things.
to wait for 1 second, you just wait until the sum of the time Is > 1 second.
I think your 5 second time period in 1 second increments actually gives you 6 gears (0-5)
If you had a couple of parameters geartime (eg 5 seconds) and numgears, you could experiment with the number of gears.
I'll have a bit of a think about it over the next few days.
PS You are getting famous. After watching your variator video, the news feed on my Android phone included a link your latest video so I am on top of your EMI issue. Should be trivial to fix. Its not noisy interference ridden plasma cutter!
The following user(s) said Thank You: RotarySMP
Please Log in or Create an account to join the conversation.
09 Aug 2023 19:55 - 09 Aug 2023 19:58 #277468
by RotarySMP
Replied by RotarySMP on topic Schaublin 125-CNC retrofit.
Thanks Rod.
I am in the basement now working through the EMI trouble shooting. That would go faster, but for setting up to film and narrating it to hopefully show I used the advise given, trouble shot in a systematic way, and fixed the problem (hopefully).
Good observation. When I put my rough ideas in that initial flow chart, I also saw that there is little overlap between the gearbox and variator control.
Once I realised that the variator ratio is always calcuable, (is that a word?), I am wondering if I even need to keep track of the variator gear number. It might be enough to simply command the variator up or down each time the VFD frequency approaches it's limit, and update the spindle.scale every servo thread based on the calculated ratio. I think I will redirect the variator end stop signals from hardwire inhibits to the contactor coils (currently), to Mesa input signals. I can then use them both as contactor coil inhibits in the ladder logic, and also use them for homing the spindle control on start up.
Any thoughts on the VFD closed loop PID needing different PID values based on the overall system gear ratio?
I am in the basement now working through the EMI trouble shooting. That would go faster, but for setting up to film and narrating it to hopefully show I used the advise given, trouble shot in a systematic way, and fixed the problem (hopefully).
Good observation. When I put my rough ideas in that initial flow chart, I also saw that there is little overlap between the gearbox and variator control.
Once I realised that the variator ratio is always calcuable, (is that a word?), I am wondering if I even need to keep track of the variator gear number. It might be enough to simply command the variator up or down each time the VFD frequency approaches it's limit, and update the spindle.scale every servo thread based on the calculated ratio. I think I will redirect the variator end stop signals from hardwire inhibits to the contactor coils (currently), to Mesa input signals. I can then use them both as contactor coil inhibits in the ladder logic, and also use them for homing the spindle control on start up.
Any thoughts on the VFD closed loop PID needing different PID values based on the overall system gear ratio?
Last edit: 09 Aug 2023 19:58 by RotarySMP.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19343
- Thank you received: 6477
09 Aug 2023 20:09 #277469
by tommylight
Replied by tommylight on topic Schaublin 125-CNC retrofit.
Did you find a ferrite doughnut?
Some home appliances have them on the power cord, also.
Some home appliances have them on the power cord, also.
Please Log in or Create an account to join the conversation.
09 Aug 2023 21:03 #277475
by rodw
Replied by rodw on topic Schaublin 125-CNC retrofit.
Mark, try this. There are probably typos and bugs cos I did not test if it compiles
so we use a state machine
enum states{HOMING, RUNNING, CHANGING, UP, DOWN};
and start in a homing position which runs the actuator down until it hits your limit switch.
Hopefully this will fire when the machine starts
Then it changes to a default state of running until a gear is changed.
When this happens, it enables the correct relay (up or down)
Then it moves to a changing state until the timer expires then it reverts to the running state.
I think its pretty close...
so we use a state machine
enum states{HOMING, RUNNING, CHANGING, UP, DOWN};
and start in a homing position which runs the actuator down until it hits your limit switch.
Hopefully this will fire when the machine starts
Then it changes to a default state of running until a gear is changed.
When this happens, it enables the correct relay (up or down)
Then it moves to a changing state until the timer expires then it reverts to the running state.
I think its pretty close...
Attachments:
Please Log in or Create an account to join the conversation.
- smc.collins
- Offline
- Platinum Member
Less
More
- Posts: 687
- Thank you received: 123
09 Aug 2023 21:18 - 09 Aug 2023 21:20 #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
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: 09 Aug 2023 21:20 by smc.collins.
Please Log in or Create an account to join the conversation.
09 Aug 2023 21:53 #277478
by spumco
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:
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.
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)
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.
09 Aug 2023 22:59 #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
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
Attachments:
The following user(s) said Thank You: RotarySMP, smc.collins
Please Log in or Create an account to join the conversation.
10 Aug 2023 08:29 - 10 Aug 2023 08:39 #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.
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: 10 Aug 2023 08:39 by RotarySMP.
The following user(s) said Thank You: rodw
Please Log in or Create an account to join the conversation.
Moderators: piasdom
Time to create page: 0.132 seconds