[ Vfdmod ] An easy VFD control over MODBUS RTU

More
25 Aug 2021 19:53 #218731 by iforce2d
My HAL had this:

net spindle-cmd-rpm => vfdmod.spindle.rpm-in
net spindle-at-speed <= vfdmod.spindle.at-speed
net spindle-cw => vfdmod.control.run-forward
net spindle-ccw => vfdmod.control.run-reverse

With your suggestion I got this result:
./custom.hal:11: Pin 'spindle.0.forward' does not exist

Thanks for the tip though, because now that you pointed out HAL connections as a possible problem, I noticed that the main .hal file had no matching pins called 'spindle-cw' or 'spindle-ccw'. There were only 'spindle-cmd-rpm' and 'spindle-at-speed' as generated by the stepconf wizard. I added connections like this:

net spindle-cw        => motion.spindle-forward
net spindle-ccw        => motion.spindle-reverse

After this when I click on the forward/reverse buttons I can see the correct values being set in the VFD registers. Everything looks good on the software side now, but..... motor doesn't turn. I wonder if there is some other message that needs to be sent when controlling via the port of the LCD panel. Looks like I will be spending some time with the logic analyzer....

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

More
26 Aug 2021 19:12 #218825 by iforce2d
(YL620 again) I spent a long time watching the traffic between the LCD panel and the VFD, and found that the panel basically relays the state of the buttons and dial to the VFD, and the VFD tells the panel which LEDs should be lit, and the target frequency. After this I reconnected my USB/RS485 connector and imitated the panel. All messages and replies are exactly the same, but..... the motor never starts.

After two and a half days of continuous struggle and failure I've had just about enough, so I will be giving up and using PWM control instead. Overall I like this vfdmod though, very nice to use.

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

More
31 Aug 2021 13:58 #219248 by pinsyd1
I notice  aekhv hasn't replied to this forum in many months, is this still the official forum for english support, or is this dead (I really hope not)?  I'd like to add functionality to this code (to support Bosch Rexroth VFD) but I'd like to know how to setup the dev environment on a stock linuxcnc build so I can compile.  It looks like QT and some other things are needed but I haven't got it compile in it's stock form.

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

More
01 Oct 2021 12:57 #221949 by aekhv

I'd like to add functionality to this code (to support Bosch Rexroth VFD) but I'd like to know how to setup the dev environment on a stock linuxcnc build so I can compile.  It looks like QT and some other things are needed but I haven't got it compile in it's stock form.


All you need is Qt4/Qt5 and LinuxCNC sources. When Qt is installed, run Qt Creator and open the project ("vfdmod.pro" file).
The following user(s) said Thank You: Roguish

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

More
02 Jan 2022 19:32 #230567 by s_volenszki
Hi, today I started to implement your Vfdmod to my LinuxCNC with a Sako SKI780 VFD. First I checked all the commands and addresses with a serial console app, following the VFD documentation. I can start, stop the VFD, I can change and read the frequency.

After all I installed the vfdmod package on my Debian 10, generated the config file and did all the steps according the documentation.

When I start LinuxCNC I can see, the VFD frequency is changing to the MinSpeedRPM, but on the Pyvcp panel the RS485 is connected remains red and the error count rising.

I turned on the debug and I can see this in terminal (full debug log attached):
...
Request for slave 76 ignored (not 1)
The responding slave 76 isn't the requested slave 1
...

and this:
...
Waiting for a confirmation...
<01><03><00><02><1D>
ERROR CRC received 0x21D != CRC calculated 0x20F0
...

It seems the returning data is not from the slave 1, or it has some corruption, and this is why vfdmod has different CRC.

If you look at the full log, you can see, the frequency change to default value was successful for the second attempt. The first failed with the The responding slave 76 isn't the requested slave 1 message. If I change the IsConnectedDelay to 1, than the connected indicator flashing green and read constantly.

How to resolve this issue? I tried to change the delays but nothing changed. Any advice will be very helpful, thank you!
Attachments:

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

More
04 Jan 2022 09:25 #230735 by aekhv

It seems the returning data is not from the slave 1, or it has some corruption, and this is why vfdmod has different CRC.

If no other slaves are connected then only one device (it's your VFD) can/must reply. Are you shure your VFD has slave address "1"? Also try to increase ProtocolDelay in RS485 section. Something around 5...50 should be enough.

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

More
04 Jan 2022 21:49 #230801 by s_volenszki
Thank you aekhv for your answer. I tried to rise the delay, but nothing changed. I tried to analyse the communication and I think, there is some timing problem, but I don't know what. I attached an image, if you take a look on it, you can see the response data contains the correct answer, but it chunked strangely. And also if you notice the image, you can see, the same data sometimes has good response, sometimes not. Example: the 0106 commands.

I ordered an RS485 data analyser, If I get it, I will check what is going on the wire. And also ordered high quality RS485 cable and USB cable. I will be back with the results.
Attachments:

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

More
05 Jan 2022 09:48 #230849 by aekhv
It looks like some kind of noise on the RS485 bus. I agree, it's good idea to test with another adapter. Also make sure your PC, VFD and spindle motor have common ground wire.

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

More
10 Jan 2022 20:41 #231343 by s_volenszki
Today I received an industrial USB to RS485 converter (www.ebay.com/itm/293750807849) and I tried. The slave problem gone, but all response has CRC error. If I use Windows 10 Commix 1.4, everything is ok. Tried the delays (LoopDelay 50-10000, ProtocolDelay 5-100), no effect.

What else can I check?

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

More
11 Jan 2022 02:26 #231381 by aekhv
Try to test communication on different speed (9600, 19200, 38400 etc).

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

Time to create page: 0.164 seconds
Powered by Kunena Forum