- Posts: 52
- Thank you received: 0
Gearchange help controlling a BLDC motor
- tacklem60
- Offline
- Senior Member
-
Less
More
7 years 1 month ago #146390
by tacklem60
Gearchange help controlling a BLDC motor was created by tacklem60
I am having some trouble with my spindle speed control in LinuxCNC. I am using the current stable release of LinuxCNC with gmoccapy as my GUI.
Currently my setup allows me to control speed and direction of my spindle from LinuxCNC and it has a good deal of accuracy. I have a single pulse encoder on my spindle which drives a display so I can see current speed but in no way does this feed back into LinuxCNC.
My spindle is a BLDC motor and I'm using velocity mode to control my spindle by regulating the variable voltage to my BLDC motor controller. I have that velocity set up as basically a 4th axis and it's working great. My spindle has a high and a low speed and I spend 90% of my time cutting in the high range. In the odd days when I need to switch, I simply trick my control and input a much higher RPM than what I want and vary that until my display on the mill gives me my intended output (i.e. I know if I want 750rpm in low gear, I tell my control to go 1750rpm). Unfortunately this is not linear for my spindle and is very difficult to work around when programming with a cam package.
I am looking for a way to offset my variable resistance that the control issues as well as some sort of button and display of what gear I am I'm as well as switching between the two. (this would all be manual and I have no plan to auto change gears or use limit switches for it to auto detect).
I believe the gearchange comp is correct for me, however, my Hal understanding is very limited and the only examples I see are those using gearchange to control a PWM signal to a VFD and similar applications. Any help would be greatly appreciated.
Currently my setup allows me to control speed and direction of my spindle from LinuxCNC and it has a good deal of accuracy. I have a single pulse encoder on my spindle which drives a display so I can see current speed but in no way does this feed back into LinuxCNC.
My spindle is a BLDC motor and I'm using velocity mode to control my spindle by regulating the variable voltage to my BLDC motor controller. I have that velocity set up as basically a 4th axis and it's working great. My spindle has a high and a low speed and I spend 90% of my time cutting in the high range. In the odd days when I need to switch, I simply trick my control and input a much higher RPM than what I want and vary that until my display on the mill gives me my intended output (i.e. I know if I want 750rpm in low gear, I tell my control to go 1750rpm). Unfortunately this is not linear for my spindle and is very difficult to work around when programming with a cam package.
I am looking for a way to offset my variable resistance that the control issues as well as some sort of button and display of what gear I am I'm as well as switching between the two. (this would all be manual and I have no plan to auto change gears or use limit switches for it to auto detect).
I believe the gearchange comp is correct for me, however, my Hal understanding is very limited and the only examples I see are those using gearchange to control a PWM signal to a VFD and similar applications. Any help would be greatly appreciated.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
-
Less
More
- Posts: 22011
- Thank you received: 7491
7 years 1 month ago #146392
by tommylight
Replied by tommylight on topic Gearchange help controlling a BLDC motor
There is a Linuxcnc component named "lincurve" that shoud do exactly that.
linuxcnc.org/docs/html/man/man9/lincurve.9.html
linuxcnc.org/docs/html/man/man9/lincurve.9.html
Please Log in or Create an account to join the conversation.
- pl7i92
- Offline
- Platinum Member
-
Less
More
- Posts: 1872
- Thank you received: 358
7 years 1 month ago #146396
by pl7i92
Replied by pl7i92 on topic Gearchange help controlling a BLDC motor
you can also use a gear component to setup a 2 stage Spindle
anothere way woudt be just use a Pin to change the gear and use 2 different spindles in the setup
and just change to the second spinle[1] from a Extra button
anothere way woudt be just use a Pin to change the gear and use 2 different spindles in the setup
and just change to the second spinle[1] from a Extra button
Please Log in or Create an account to join the conversation.
- tacklem60
- Offline
- Senior Member
-
Less
More
- Posts: 52
- Thank you received: 0
7 years 1 month ago #146397
by tacklem60
Replied by tacklem60 on topic Gearchange help controlling a BLDC motor
Thank you very much for the fast reply. Reading the description, it sounds like that will do exactly what I want. I will just have to make sure I know the value for RPM where I have decided to switch gears because there will be no way for the control to know using this method. For example, if I switch to low gear below 1200RPM, I can use the linear multiplier to scale the output, but nothing would prompt me to switch to low gear below 1200RPM or pause the program to do so correct?
I have gotten pretty good at taking an existing Hal file and editing it to suite my needs, unfortunately I don't think I have enough experience to use the description to generate my own from scratch. I will have to look around for someone who has used this for a similar application and try to tweak it to do what I need
I have gotten pretty good at taking an existing Hal file and editing it to suite my needs, unfortunately I don't think I have enough experience to use the description to generate my own from scratch. I will have to look around for someone who has used this for a similar application and try to tweak it to do what I need
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
-
Less
More
- Posts: 22011
- Thank you received: 7491
7 years 1 month ago #146404
by tommylight
Replied by tommylight on topic Gearchange help controlling a BLDC motor
Am on the phone so can not do much, but search for a MAHO retrofit here on the forum, it had several gears and it was all made to work properly.
Please Log in or Create an account to join the conversation.
- tacklem60
- Offline
- Senior Member
-
Less
More
- Posts: 52
- Thank you received: 0
7 years 1 month ago #146428
by tacklem60
Replied by tacklem60 on topic Gearchange help controlling a BLDC motor
I really like the idea of setting it up as 2 spindlss. That would allow me to use the full range if speeds in both high and low gear with no issue. Sounds like it would be the best option for me.
When you say to use a pin to change gears, do you mean a physical pin on the BOB and use a physical button to send a signal that they have switched or a button inside the control software?
I apologise for my lack of knowledge here, I was able to get this far in my own and have basically been ignoring the two speeds for a year now because I had such a hard time understanding it when I setup my machine go begin with.
When you say to use a pin to change gears, do you mean a physical pin on the BOB and use a physical button to send a signal that they have switched or a button inside the control software?
I apologise for my lack of knowledge here, I was able to get this far in my own and have basically been ignoring the two speeds for a year now because I had such a hard time understanding it when I setup my machine go begin with.
Please Log in or Create an account to join the conversation.
Time to create page: 0.204 seconds