CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > WoodWorking Machines > DIY-CNC Router Table Machines


DIY-CNC Router Table Machines Discuss the building of home-made CNC Router tables here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 10-20-2009, 06:22 PM
 
Join Date: Oct 2005
Location: Australia
Posts: 80
scotta is on a distinguished road
Huanyang VFD RS485 / Modbus

I recently received my Huanyang VFD from linearmotionbearings2008 and was quite impressed with the quality of the drive compared to the first Xin Ye drive which went bang.

I am trying to get the RS485 / Modbus communications going and up to now have not had a lot of success.

VFD Settings:
PD001 = 2 (run commands to comm port)
PD002 = 2 (operating freq to comm port)
PD163 = 1 (slave address 1)
PD164 = 1 (baud rate to 9600 b/s)
PD165 = 3 (8N1 for RTU mode)

Hardware:
USB to RS232 / RS485 converter

The RS485 converter has four terminatls Vcc, GRD, A and B. I have connected the A and B terminals to RS-, RS+ respectively. I was not certain about the ground requirements and left this unconnected to start.

My first attempt was to use Spindle Talker, which gave some run time errors even with the VB6 runtime libraries installed.

I have Realterm Software with the additional spy functionality so was able to monitor the serial data on the port. Spindle Talker did not seem to send the full string, just the first three sets of data.

So, I am now using Realterm and manually entering the command string.

The comms seem to be working as I get a 00 response from the drive when sending data, and odd data when turning the drive on and off. However when I send a data string such as 01 02 03 00 0B B8 7F 0C I still get a 00 response??

I'm hoping that someone who has got the comms working can double check my setting and maybe give me some pointers.

Thanks in advance

Scott

Last edited by scotta; 10-20-2009 at 07:07 PM.
Reply With Quote

  #2   Ban this user!
Old 10-21-2009, 01:31 AM
 
Join Date: Dec 2004
Location: usa
Posts: 1,665
TOTALLYRC is on a distinguished road

It is possible that this drive is not fully Modbus compliant. Peter Homman is the guru of Modbus and may be able to help.
Mike
__________________
Warning: DIY CNC may cause extreme hair loss due to you pulling your hair out.
Reply With Quote

  #3   Ban this user!
Old 10-21-2009, 12:00 PM
 
Join Date: May 2007
Location: USA
Posts: 16
pbeamtn is on a distinguished road

Modbus should only require 2 wires. You do need to make sure you have "+" and "-" connected properly on both sides. Unfortunately, without more documentation, it is impossible to determine whether "A" is "+" or not. Having the wires reversed will invert the data, and communication will not work. If you don't know for certain how "A" and "B" match with "+" and "-", you could reverse the wires and see if you get something more reasonable.

I use the program Modscan to troubleshoot Modbus stuff. I think you can still download it here:

http://www.win-tech.com/html/modbus.htm#MODSCAN

It is an ancient program and the free version is time limited, but it will allow you to poll some registers and see if you are getting reasonable data.

RTU is time sensitive, so you really can't type it in manually. Data packets can be variable length, so the protocol uses silence on the line to determine when a packet is complete. I'm not sure if you are typing things byte by byte in Realterm, but that won't work. Using something like Modscan will compile the packet with the proper CRC and timing and send it out on the line.
Reply With Quote

  #4   Ban this user!
Old 10-21-2009, 05:28 PM
 
Join Date: Oct 2005
Location: Australia
Posts: 80
scotta is on a distinguished road

Thanks for the relpys, I have confirmed that A and B go to RS- and RS+ as when swapped I get no response from the drive at all, all is silent.

I'm using Realterm to send out the full data string (pre entered) and the data that I am sending is what is published in the manual and what others have been talking to the drive.

Thanks for the link to the Modscan, I'll give it a go.

Thanks

Scott
Reply With Quote

  #5   Ban this user!
Old 10-27-2009, 02:39 AM
 
Join Date: Oct 2005
Location: Australia
Posts: 80
scotta is on a distinguished road
Success!!!

I have been banging my head against a brick wall with this for the last week or so, have done a lot of googling and learnt a hell of a lot about RS485 and modbus at the same time.

And a big lesson learned - don't beleive everything you read! Make you own measurements and checks.

Today was the turning point when I borrowed a USB osilloscope and actually started seeing the data transmission. And the simple solution - SWAP TWO WIRES!!!

The labelling of the RS- and RS+ terminals on the drive and the A and B terminals on the USB converter are not as expected.

Matching the potential of the terminals (relative to ground) was the key, ignoring the labelling. A [+5V] --> RS+ [+5V], B [0V] --> RS- [0V] and Ground -> ACM. The comms still work with the 120ohm termination resistor as well. And SpindleTalker also works as it is no longer receiving the 00 response (which was not coming out of the drive but the converter itself)
Attached Thumbnails
Click image for larger version

Name:	Huanyang MODBUS.jpg‎
Views:	1282
Size:	227.7 KB
ID:	92026  

Last edited by scotta; 10-27-2009 at 02:44 AM. Reason: spelling
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 10-28-2009, 02:44 PM
 
Join Date: Jul 2008
Location: Canada
Posts: 216
analogman is on a distinguished road

Scott are you going to be driving this from Mach3? Will you be able to drive it directly or require some layer of software in between?
Reply With Quote

  #7   Ban this user!
Old 10-28-2009, 08:35 PM
 
Join Date: Oct 2005
Location: Australia
Posts: 80
scotta is on a distinguished road

I'm a linux guy, so will be using EMC2. This will be the next step but with the non-standard function codes of the VFD this will be a challenge...


Scott
Reply With Quote

  #8   Ban this user!
Old 11-09-2009, 12:49 PM
 
Join Date: Jun 2005
Location: norway
Posts: 53
henrikw is on a distinguished road

Scotta, any luck getting it to work?
Reply With Quote

  #9   Ban this user!
Old 11-10-2009, 01:33 PM
 
Join Date: Sep 2005
Location: nl
Posts: 4
michel pet is on a distinguished road

any news jet??
Reply With Quote

  #10   Ban this user!
Old 11-10-2009, 04:12 PM
 
Join Date: Oct 2005
Location: Australia
Posts: 80
scotta is on a distinguished road

I think the Huanyang engineers were off drinking coffee when the Modbus standard was being handed around. Anyhow, I have been doing heaps of research on how to drive the VFD with EMC2.

I started with ClassicLadder but due to the non standard function codes and data length descriptor this was going to be a lot of work. A big thanks to Jayson from the Mechmate forum who sent me his working ClassicLadder binary. My main problem with modifing the ClassicLadder was that if a compliant Modbus device was also to be used on the same system then the ClassicLadder modbus routines would be so twisted that it would make it unusable.

The solution that I am now progressing is to make a user space hal component. This is slow progress as I work for myself and the day to day hum drum of making money to live gets in the way. To date I have a hal component that loads and exposes the VFD control and status registers as pins.

As far as the modbus side goes, I started with the latest version libmodbus and attempted a hack, the only drama being is that libmodbus has been so well developed to be Modbus Standard compliant is that is is pretty locked up with only a few publically accessable routines to connect to.

I went digging and found libmodbus version 0.0.1 and now have rewritten this to use the Huanyang structure, and am just getting into the debugging stage now.

If there are any gurus out there that are exsperts in parsing xml config files in Linux, I am thinking of using a xml file to pass all the config data to the component rather that command line options. This will be more flexible and should allow any / all of the drive parameters to be configured during startup. A handy thing if the VFD is used to drive different motors on different machines, eg a router and a mill or lathe. At start up all of the motor parameters ( poles, frequency, base rpm etc could be configured by the serial connection). A little ambitious maybe.

First to get things talking with EMC2.

Scott
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 11-11-2009, 10:47 PM
 
Join Date: Dec 2006
Location: Australia
Age: 30
Posts: 103
Matty Zee is on a distinguished road

Hey Scott, maybe you should contact Jayson from the Mechmate forum. He has successfully got EMC2 to talk to his HuanyangVFD. See here
For those using Mach3, i have written a plugin to talk to the Huanyang VFD. I will post it on the Mach3 forum and a few days. Its being beta tested at the moment.

Cheers
Matt
Reply With Quote

  #12   Ban this user!
Old 11-12-2009, 03:47 AM
 
Join Date: Oct 2005
Location: Australia
Posts: 80
scotta is on a distinguished road

Matt,

Jayson was kind enough to give me his working ClassicLadder file but this is not the nicest way of getting things working as it nobbles the standard Modbus.

The hal component I'm working on is kinda like a plug in for Mach (except that it needs to be complied as a kernal module). This will allow other standard modbus equipment to used the ClassicLadder interface.

Going to be slow going as work is heating up with silly season.

Scott
Reply With Quote

Reply




LinkBacks (?)
LinkBack to this Thread: http://www.cnczone.com/forums/diy-cnc_router_table_machines/91847-huanyang_vfd_rs485_modbus.html
Posted By For Type Date
Tips for Newbie Huanyang VFD users - Page 13 - Woodwork Forums Post #0 Refback 10-04-2010 08:21 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem- Huanyang HY02D223B goes POP! stevespo Phase Converters and VFD 1 09-26-2009 02:12 PM
Need Help!- Huanyang HY02D223B 2.2Kw VFD gillyhyde8888 Phase Converters and VFD 7 09-11-2009 06:46 PM
JRKerr 3PH Controller with Moxa RS485 Zathras Servo Motors and Drives 1 01-20-2008 09:17 AM
rs-232 and rs485 bus eloid Mach Software (ArtSoft software) 1 03-12-2007 10:39 PM
RS485, educate me please phantomcow2 General Electronics Discussion 6 01-07-2007 12:28 PM




All times are GMT -5. The time now is 07:26 AM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361