huanyang vfd & linuxcnc 2.7

More
14 Sep 2015 23:04 - 05 Feb 2016 21:10 #62567 by andypugh

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.
halrun

Now load the vfd driver, assuming that all the default settings are correct
loadusr hy_vfd

To see a list of all the HAL pins, and their values
show pin
You can initially ignore all the output pins that tell you things about the VFD. Once you do that, things look a lot simpler.

Now enable the VFD communications
setp hy_vfd.enable 1
You can use tab-completion to save typing and to make sure the spelling is right, so that could be typed as setp h<tab>e<tab> 1

Set to run FWD, set the speed, and turn it on
setp hy_vfd.spindle-forward 1
setp hy_vfd.command 500
setp hy_vfd.on 1

Experiment with speed changes and see some info about the VFD.
setp hy_vfd.command 200
show pin hy_vfd.DCV
show pin hy_vfd.ACV
...

When you have finished
setp hy_vfd.on 0
setp hy_vfd.enable 0
exit

The HAL file connections will look rather similar.
net vfd-comms halui.machine.is-on => hy_vfd.enable
net spindle-fwd motion.spindle-forward => hy_vfd.spindle-forward
net spindle-reverse motion.spindle-reverse => hy_vfd.spindle-reverse
net spindle-speed-cmd  motion.spindle-speed-out-abs => hy_vfd.command
net spindle-on motion.spindle-on => hy_vfd.on
Last edit: 05 Feb 2016 21:10 by andypugh.
The following user(s) said Thank You: Officer, pommen

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

More
15 Sep 2015 00:40 #62574 by pommen
Replied by pommen on topic huanyang vfd & linuxcnc 2.7
Andy, Thank you SOOO much!

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 or Create an account to join the conversation.

More
27 Sep 2015 12:37 #63048 by russtuff
This has been such a great thread. I'm using 2.6x and now have my VFD running via the modbus.

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 or Create an account to join the conversation.

More
27 Sep 2015 16:13 #63053 by pommen
Replied by pommen on topic huanyang vfd & linuxcnc 2.7
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

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

More
27 Sep 2015 16:28 #63054 by andypugh

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 or Create an account to join the conversation.

More
27 Sep 2015 23:02 - 27 Sep 2015 23:02 #63069 by russtuff

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.

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.
Last edit: 27 Sep 2015 23:02 by russtuff.

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

More
28 Sep 2015 07:54 - 28 Sep 2015 08:04 #63102 by russtuff
No luck. I manually jogged the VFD to 50hz and noted the spindle speed, then entered that speed in PD144.
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.
Last edit: 28 Sep 2015 08:04 by russtuff.

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

More
28 Sep 2015 17:08 #63121 by andypugh

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
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

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

More
29 Sep 2015 10:30 - 29 Sep 2015 10:51 #63174 by russtuff

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
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 :)
Last edit: 29 Sep 2015 10:51 by russtuff.

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

More
29 Sep 2015 15:52 #63185 by andypugh

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
halcmd show pin > pins.txt
halcmd show param params.txt
That will give you two text files that you can open in a text editor and get a full list of all the pins and parameters that you can use in your HAL file. (every HAL component you add will add some more, too)

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

Time to create page: 0.151 seconds
Powered by Kunena Forum