CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 15, 2019, 11:06:20 am


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Huanyang VFD - spindle talker  (Read 782 times)
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2225



View Profile
« on: August 15, 2019, 10:40:13 am »

For a long time I've been trying to make Mach3 control the spindle over the RS485 communication line.
There is a Mach3 plugin written specially for the Chinese 'Huanyang' brand VFD used by many people.
But it is written with the presumption of using a particular USB to RS485 converter and this is the reason why on the popular CNC forums some people are happy, others - not quite because the plugin does not talk to the VFD.
The reason is that 2 wire RS485 is a half duplex line and the master device (or the control software) must switch between transmit and receive mode dynamically. This is done by manipulating usually two pins with opposite logic (logical 1 turns the transmitter on while disabling the receiver and vice versa). In software usually the RTS signal line is used for that purpose.
The USB to RS485 converters based on the FT232RL chip do this in hardware and are suitable for Mach3. I couldn't find such nearby and made one of my own using the same chip. And finally got a working RS485 link over a twisted pair wires.

While I was digging over the net for information about automatic spindle control and the RS485 standard itself I came across a program called 'Spindle Talker' made to test and control the 'Huanyang' VFD. While it it an early beta version it actually worked out of the box so I could test the system outside Mach3 and its plugin which does not give much feedback. Requires MS .NET4. On first start it crashed and the reason was I had not connected the two wires (A -> RS+; B -> RS-) correctly. The exception was caught by the program and showed a debug dialog describing the crash.
Here is a link:
https://github.com/GilchristT/SpindleTalker2/releases
Logged
Bob La Londe
CNC Jedi
*****
Offline Offline

Posts: 3818


^ 8.5 pounds on my own hand poured bait.


View Profile WWW
« Reply #1 on: August 15, 2019, 15:54:39 pm »

RS485 probably is more accurate because it sends specific digital commands, but all of my VFDs on CNC machines are controlled with a 0-10VDC signal and direction relays on my breakout boards.  

My new saw will have VFD that is controlled by a POT I am sure.  

P.S.  My only direct experience with RS485 was between medium range control boxes for an ammonia and temperature monitoring system in a pretty large cooling plant.  The plant manager wanted me to "fix" it.  I found his controller programming was all over the place.  When I went through and cleaned up the programming everything worked.  Just for good measure I pulled all the wires one at a time, cleaned them, coated them in dielectric grease, and put them back it the barrier strips.  He was kind of annoyed with me I could tell when he said, "All you did was reprogram them."  I was kind of annoyed when I said, "That's all that was wrong with them."  I have used RS422 (similar) for controlling PTZ camera systems, but when cameras also support coaxitron over the video cable its much more reliable.
« Last Edit: August 15, 2019, 16:00:45 pm by Bob La Londe » Logged

Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2225



View Profile
« Reply #2 on: August 15, 2019, 17:23:26 pm »

Yes, the value is sent directly and the VFD sets the exact rpm. And RS 485 is an industry standard and noise resistant (to a certain level). Which cannot be said about USB. I am testing the reliability now with live jobs.

I have another project in working condition using the PWM signal from Mach3, fed to a MCU which measures the duty cycle and then sets a digital potentiometer on the output to the VFD. And it works. But the linearity (maybe on the VFD side) is not very good. While the voltage set by the potentiometer is precise, the rpm are not so. At exactly 50% duty cycle (1/2 voltage) the rpm are 12000 within a ~100 rpm tolerance. But going down the error increases in positive direction (higher rpm) and going up the rpm are less than the expected.  I am going to write another firmware version using frequency from Mach 3 and spindle set to be commanded by step and dir. We'll see.
The problem with digital potentiometers is that almost all are made for maximum of 5 volts and I can't use the 10v input which will give a wider scale.
Logged
Bob La Londe
CNC Jedi
*****
Offline Offline

Posts: 3818


^ 8.5 pounds on my own hand poured bait.


View Profile WWW
« Reply #3 on: August 16, 2019, 20:42:46 pm »

I lot of the higher end breakout boards come with a 0-10VDC source on the board.  Tuning takes some time, and RPM usually can't be "exact" across its range, but I have found I can adjust it dead on (+/- 0.5-1.0 RPM)  at a particular speed.  On the machines I use TC tapping heads I dial in the speed I want to tap at.  Usually 500RPM.  From then on I know its accurate at two speeds.  The one I dialed in and balls out. 

Logged

Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5677



View Profile WWW
« Reply #4 on: August 17, 2019, 21:33:30 pm »

Hello

Something to know: If you control the spindle speed via PWM 0-10V and if you do not have an encoder that return a feedback speed to Mach3 NEVER use the "calibrate spindle" tool ! ... you'll get fanciful speeds after calibration !

If this happens, delete the Linearity.dat file in the Mach3/macros/your_config_name folder (a correct file will be automatically recreated by Mach3)

++
David
Logged
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2225



View Profile
« Reply #5 on: August 18, 2019, 10:30:48 am »

Instead of 0-5v and 0-10v inputs the Chinese developers could easily implement direct PWM/frequency input on one pair of terminals. And even galvanically insulated via an opto coupler.  But somehow they missed this option and my guess is because they just copied another design.
Logged
Bubba
CNC Jedi
*****
Offline Offline

Posts: 2707



View Profile
« Reply #6 on: August 18, 2019, 12:24:03 pm »

and my guess is because they just copied another design.
******************
+1  Wink
Logged

My 2ยข
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.099 seconds with 20 queries.

Copyright © 2018 HexRay Ltd. | Sitemap