- Posts: 19306
- Thank you received: 0
huanyang vfd & linuxcnc 2.7
pommen wrote: I still dont get how you would know what to include. I mean where do you begin to figure you what to use, and to what pin?
Assuming that you have configured the hardware part of things, (or, in fact to help configuring the hardware part), here is a way to run the component in a minimal setup.
Open a terminal and start realtime.
Now load the vfd driver, assuming that all the default settings are correct
To see a list of all the HAL pins, and their values
Now enable the VFD communications
Set to run FWD, set the speed, and turn it on
Experiment with speed changes and see some info about the VFD.
When you have finished
The HAL file connections will look rather similar.
Please Log in to join the conversation.
I think I'm actually starting to get it now. It's a little bit scary starting out and trying to make sense with all the info avalible, your hadnholding was just the thing I needed

Thanks to you, I now have a decently running config (Woohoo). Just the tip about ignoring most of the pins made me focus alot more on how and why things work.
Again, Thanks! Was close to tearing my hair out there for a moment.
I hope your answer can help more newbies like me get a clearer picture, if nothing else to get beyond the (very awesome) stepconf.
/Peter
Please Log in to join the conversation.
I do have a question about RPM if anyone has the patience to help. I have PD144 set to 1690 which is the rated speed on my motor's plate. I'm using the phase A (tied to index) to see my actual RPM in LinuxCNC, but there is some scaler or multiplier that is working against me so I can't set my actual RPM using S.
This setup is for a G0602 lathe, so there is a belt drive between the motor and the spindle (not 1:1). Here is an example of my problem:
PD144 1690
I use M3 S1250
LinuxCNC (PYVCP bar) reports 770RPM (and is actual spindle speed)
VFD reports 1250RPM
Also, when LinuxCNC/actual is 1250RPM, the VFD is 2028RPM.
I've tried scaling in HAL but can't seem to figure it out.
What I assume should be happening is LinuxCNC should tell the VFD to increase speed until LinuxCNC/actual reaches 1250RPM.
Thanks.
Please Log in to join the conversation.
Are you sure that PD144 should be faceplate value? I think i read somewhere that is the RPM at 50 Hz(to enable high speed spindles).
I'm in no way sure about this though, and i think it has to do with how the driver calculates max speed.
If im not mistaken, the OLD driver took PD144 to be 1/10'th the actual speed. dont know if that still the case.
/Peter
Please Log in to join the conversation.
rusmannx wrote: I've tried scaling in HAL but can't seem to figure it out.
Have you tried setting PD144 to the spindle speed at 50 Hz? (rather than the motor speed)
Please Log in to join the conversation.
pommen wrote: Hello,
Are you sure that PD144 should be faceplate value? I think i read somewhere that is the RPM at 50 Hz(to enable high speed spindles).
I'm in no way sure about this though, and i think it has to do with how the driver calculates max speed.
If im not mistaken, the OLD driver took PD144 to be 1/10'th the actual speed. dont know if that still the case.
/Peter
It's called the Rated Motor Revolution program but you're right, it should be set to actual resolution and is based on 50hz. I may have been thinking of this incorrectly.
andypugh wrote: Have you tried setting PD144 to the spindle speed at 50 Hz? (rather than the motor speed)
I'm pretty sure I have at one point while fiddling with everything, but you're making me doubt myself :blink:
I'll do it again today and see what happens. Thanks for pointing it out.
Please Log in to join the conversation.
When I then S1250 I get 770RPM actual.
EDIT: I just did some more testing and realized that it doesn't matter what I set PD144 to be, any time I S1250 the I get 39.24hz on the VFD.
Please Log in to join the conversation.
rusmannx wrote: I just did some more testing and realized that it doesn't matter what I set PD144 to be, any time I S1250 the I get 39.24hz on the VFD.
In that case it looks like you need to use a "scale" component
www.linuxcnc.org/docs/html/man/man9/scale.9.html
Unless you have two gears, in which case "gearchange" might be more appropriate
www.linuxcnc.org/docs/html/man/man9/gearchange.9.html
Please Log in to join the conversation.
andypugh wrote:
rusmannx wrote: I just did some more testing and realized that it doesn't matter what I set PD144 to be, any time I S1250 the I get 39.24hz on the VFD.
In that case it looks like you need to use a "scale" component
www.linuxcnc.org/docs/html/man/man9/scale.9.html
Unless you have two gears, in which case "gearchange" might be more appropriate
www.linuxcnc.org/docs/html/man/man9/gearchange.9.html
Code:loadrt scale ... addf scale.0 servo-thread ... net spindle-speed motion.spindle-speed-out => scale.0.in net motor-speed scale.0.out => hy_vfd..... setp scale.0.gain 1.623
Thank you. I assumed I would need something like this, however, no matter how I try and implement your code I get errors. I think it's because of the scale/lowpass stuff in the postgui.hal, plus, I'm terrible at this stuff and don't know what should be put in place of your "..." lines to make it work.
For now I'll just multiply the RPM I really want by 1.7
Please Log in to join the conversation.
rusmannx wrote: Thank you. I assumed I would need something like this, however, no matter how I try and implement your code I get errors. I think it's because of the scale/lowpass stuff in the postgui.hal,
Yes, you need to integrate the scale into your existing HAL. That is going to mean combining any loadrt scale commands and taking out incompatible nets.
It's like an electrical circuit, if you are inserting an amplifier in a signal path you need to cut the original wires.
One thing that might be useful, when the system is loaded open a terminal and type
Please Log in to join the conversation.
