EL4031 setup for VFD
- Martin.L
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 1
30 Jan 2025 13:39 #320143
by Martin.L
EL4031 setup for VFD was created by Martin.L
Hi guys,
I've been lucky enough to find a used EL4031 used at an affordable price. I have set it up on LCNC and I can enable it. I can't keep going one with the setup because I'm a bit lost on what I should do next. I have found this example:
I'm not asking to do it for me, I want to learn so a practical example should be enough, I know the basics of C+ and did many arduino projects but I'm a bit lost on how to write code for LCNC.
I've been lucky enough to find a used EL4031 used at an affordable price. I have set it up on LCNC and I can enable it. I can't keep going one with the setup because I'm a bit lost on what I should do next. I have found this example:
Warning: Spoiler!
Suppose you have a spindle that takes a 0..10V input to control the spindle RPM. The maximum RPM is 25,000 RPM, but it loses torque as the speed slows and doesn't support anything below 5,000 RPM, which happens at 2V. To disable the spindle entirely, the voltage needs to be turned off (set to 0V).To accomplish this setand. This should result in being able to setdirectly:If, then. Then, so, which is the largest value allowed, which will result in the hardware sending 10V. Any attempt to set RPM higher will just be capped at 25000.If(which is below the 5,000 RPM limit mentioned above), then. Then. This is less than, so it will be bumped up to. That will result in avalue of, which should result in around 2V, which will give 5,000 RPM.To disable the spindle entirely, instead of setting RPM=0, just setto. That will drop the output to 0V.
scale=25000
min_dc=0.2
value=RPM
RPM=25000
value=25000
curr_dc=25000/25000=1
raw=32767
RPM=3000
value=3000
curr_dc=3000/25000=0.120
min_dc
0.2
raw
0.2*32767=6554
enable
false
I'm not asking to do it for me, I want to learn so a practical example should be enough, I know the basics of C+ and did many arduino projects but I'm a bit lost on how to write code for LCNC.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 544
- Thank you received: 176
30 Jan 2025 19:14 #320172
by Hakan
Replied by Hakan on topic EL4031 setup for VFD
Start here and see how far you come
linuxcnc.org/docs/html/examples/spindle.html
Your example is quote complex, forget that.
linuxcnc.org/docs/html/examples/spindle.html
Your example is quote complex, forget that.
Please Log in or Create an account to join the conversation.
- Martin.L
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 1
01 Feb 2025 10:39 #320312
by Martin.L
Replied by Martin.L on topic EL4031 setup for VFD
Hi Hakan, thanks for saving me again!
If can be useful to someone, for a 40K spindle ended up with :
loadrt scale count=1
addf scale.0 servo-thread
setp scale.0.gain 0.000025
net spindle-M3 spindle.0.on lcec.0.SPINDLE.aout-0-enable
net spindle-speed-scale spindle.0.speed-out scale.0.in
net spindle-speed-DAC scale.0.out lcec.0.SPINDLE.aout-0-value
If can be useful to someone, for a 40K spindle ended up with :
loadrt scale count=1
addf scale.0 servo-thread
setp scale.0.gain 0.000025
net spindle-M3 spindle.0.on lcec.0.SPINDLE.aout-0-enable
net spindle-speed-scale spindle.0.speed-out scale.0.in
net spindle-speed-DAC scale.0.out lcec.0.SPINDLE.aout-0-value
Please Log in or Create an account to join the conversation.
Time to create page: 0.079 seconds