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! > Machine Controllers Software and Solutions > LinuxCNC (formerly EMC2)


LinuxCNC (formerly EMC2) Discuss LinuxCNC (formerly EMC2) Controlers here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 11-29-2010, 07:28 PM
ninefinger's Avatar  
Join Date: Sep 2006
Location: Canada
Age: 38
Posts: 316
ninefinger is on a distinguished road
MODBUS control of VFD

I'm trying to get control of my GE -Fuji Electric VFD model AF300-E11. It will talk (and listen to) MODBUS so I figured I'd give it a shot at using the MODBUS in EMC2 to control it (versus a 0-10V analog output card and fwd/rev relay)

1st - has anybody done this for this series of VFD?

2nd - rather than starting from scratch I'm going to "try" and work from prior examples such as:

gs2_vfd

OR

does somebody have a classic ladder clp file they can share for any MODBUS control that I can look at as an example - I've looked but not found one?

3rd - this will be strictly an EMC2 effort as I have checked out communications so I know that works...(unlike some cheap VFD's I've been reading about on other threads)

Unfortunately my programming skills are rather weak - though I do know a bit about MODBUS as I've had to fight through it for work purposes.

I'll use this thread to publish any positive results I get for the benefit of others with this series of drive (got mine from here Variable Frequency Drive, AC Motor Drives, Pool Pump Motors, Marathon Electric 3 Phase Motor, Teco Westinghouse Distributor

BTW my initial objective is to have the following controls:
Spindle stop, on-fwd or on-rev, spindle speed,
and to read the following:
Spindle speed
(pretty basic list...)

Mike
Reply With Quote

  #2   Ban this user!
Old 11-29-2010, 07:45 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

I assume you are using serial modbus?
here is the basic idea:
EMC Documentation Wiki: ClassicLadder Ver 7.124
What version of EMC are you using?
Its been a while since I used modbus with CL but some are using it.
Running EMC / CL in a terminal will give much more info while debugging modbus
Chris M
Reply With Quote

  #3   Ban this user!
Old 11-29-2010, 08:27 PM
ninefinger's Avatar  
Join Date: Sep 2006
Location: Canada
Age: 38
Posts: 316
ninefinger is on a distinguished road

Thanks Chris,

Yes to be clear I'm using the Serial Modbus (RTU).
EMC2 is up to date (v 2.4.5 on Ubuntu 10.04)

****EDIT - udpate manager was running - its now 2.4.6 if that makes any difference) - ***

I've had a look at the wiki - unfortunately I'm such a newbie at this it isn't much help - I really need a "worked" example to play with and break to get the hang of it (classic ladder that is) ie somebody has made the connections in classic ladder to their VFD via Modbus.. From there I can usually find my way to rework it for my application (ie my vfd's function codes, registers etc)

The other option is to hack somebody else's work such as the gs2_vfd.c that is referenced in the manual. Looks like that is the way I may end up going (though I still would like to learn the classic ladder interface)

Cheers,

Mike

Last edited by ninefinger; 11-29-2010 at 08:32 PM. Reason: added info
Reply With Quote

  #4   Ban this user!
Old 11-29-2010, 08:32 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

modbus configs are so specialized for each vfd.
I will look to see if I can find my modbus example for a yaskawa vfd.
do you have pdf docs for your vfd?
CL does take a bit to get used to.
Reply With Quote

  #5   Ban this user!
Old 11-29-2010, 08:41 PM
ninefinger's Avatar  
Join Date: Sep 2006
Location: Canada
Age: 38
Posts: 316
ninefinger is on a distinguished road

I do have the pdf for the drive, but not on this machine ( it did take a whole bunch of searching to find it so I hope its still on my other machine). I'll post it here when I go upstairs.

If you do have an example I would really appreciate it - I'm a bit slow on the programming stuff but I usually get from point a to point b eventually...

Thanks,

Mike
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 11-29-2010, 09:54 PM
ninefinger's Avatar  
Join Date: Sep 2006
Location: Canada
Age: 38
Posts: 316
ninefinger is on a distinguished road
pdf of the manual is in a zip over here...

I don't have the manual on my machine but thank goodness I posted it to the zone for safe keeping! (albeit in a place that wasn't where I thought it would be...)

http://www.cnczone.com/forums/732560-post11.html

Mike
Reply With Quote

  #7   Ban this user!
Old 12-01-2010, 07:28 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

It's not clear to me from docs if 8n1 (8 bit data,no parity,1 stop bit ) serial signals are supported.
currently CL only supports this.
Have you connected to this inverter with modbus before?
Can you check the settings of :
H31 slave number
H34 baud rate
H35 data bits
H36 parity
H37 stop bits.

Boy are the docs written poorly for modbus!
Reply With Quote

  #8   Ban this user!
Old 12-01-2010, 10:00 PM
ninefinger's Avatar  
Join Date: Sep 2006
Location: Canada
Age: 38
Posts: 316
ninefinger is on a distinguished road

Originally Posted by chester88 View Post
It's not clear to me from docs if 8n1 (8 bit data,no parity,1 stop bit ) serial signals are supported.
currently CL only supports this.
Have you connected to this inverter with modbus before?
Can you check the settings of :
H31 slave number
H34 baud rate
H35 data bits
H36 parity
H37 stop bits.

Boy are the docs written poorly for modbus!
Hi Chris,

Boy, I wasn't expecting you to wade through that manual - been there done that! I did connect up briefly with my laptop and a terminal program. I sent the example of an invalid message and got the proper error response message so I left it at that. (page 12-9 of the users guide..) I do have a GE program for configuring the drive via the RS485 so I can use that to prove the communications - but its on my laptop at work (the laptop is a windows machine)

I just tried a terminal program (moserial) on the linux machine - and I get the same as before:

send: 01 03 03 31 00 14 14 4E (request 20 bytes of data)
receive: 01 83 02 C0 F1 (error response)

Here are the configuration data as it stands now -

H31 = 1 = slave 1
H34 = 1 = 9600 baud
H35 = 0 = 8 data bits
H36 = 0 = no parity
H37 = 0 = 2 stop bits

8n1 is supported I believe - I will test it now by reconfiguring the drive.

If you have your yaskawa VFD example please post it so I can have a look - it might be the piece that lets my brain put together all the pieces

Thanks for your help with this!

Mike
Reply With Quote

  #9   Ban this user!
Old 12-01-2010, 10:11 PM
ninefinger's Avatar  
Join Date: Sep 2006
Location: Canada
Age: 38
Posts: 316
ninefinger is on a distinguished road
8 N 1 not supported..

Chris

Turns out you can't set 8n1 - the drive automatically sets the stop bits depending on the parity - no parity is 2 stop bits, even or odd parity is 1 stop bit.

Does this mean the whole idea of using Classic Ladder is dead in the water?

If so I'll try the other method - hacking up the gs2_vfd.c file I copied from somewhere...

Mike
Reply With Quote

  #10   Ban this user!
Old 12-01-2010, 10:32 PM
 
Join Date: Nov 2005
Location: Canada
Posts: 465
chester88 is on a distinguished road

I check the source code and it is possible to set different values for data, stop bit, and parity. It just hasn't been tested or documented.
i haven't found my USB drive with the modbus ladder tests on it yet.
I may just build a little one to suit testing for you to try.
next thing you need to find out is Linux's serial port address. Are you using a serial port or a usb serial converter?
Where in Canada are you?

Chris M
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 12-02-2010, 10:33 AM
ninefinger's Avatar  
Join Date: Sep 2006
Location: Canada
Age: 38
Posts: 316
ninefinger is on a distinguished road

The serial port is /dev/ttyS0

It works throught the moserial program I downloaded moserial - GNOME Live!

I just haven't tried to actually control it yet as that requires figuring out the CRC to go with the command sent - I'll bring my laptop home tonight as it has my little tool for doing the Modbus stuff (crc calculator) as well as a GE program for configuring the drive via the RS485.

BTW I'm in Ottawa
Reply With Quote

  #12   Ban this user!
Old 12-04-2010, 07:35 AM
ninefinger's Avatar  
Join Date: Sep 2006
Location: Canada
Age: 38
Posts: 316
ninefinger is on a distinguished road

I was controlling the VFD through the GE configurator software on my laptop last night.

At the same time I was snooping on the serial port and recording a log file for future refference of the commmands that were being sent.

Unfortunately the GE software does a lot of monitoring of the drive and is reading continuously so picking out the write commands is a bit tedious. If I get a chance I'll post up some of the commands it sent cause they don't make a lot of sense to me (though I was doing this at midnight so maybe that was the problem).

From memory an example command started as:

01 30 31 06 53 .......

I get the 01 - address 01 but then 30? I can't find anything like this in the manual for a function code?
31 - lost me here too
06 53 - From the manual S06 is operation command so 53h = S in Ascii
Note - i may be reveresing the 06 53 as this is from memory... I'll correct it when I can confirm what I recorded - too many pc's!!!)

Went back and I can't view the log I recorded as its and unknown format to windows and I need some sort of program to read the log file

I might get to this tomorrow and do it all live with multiple pc's to try and get as much as I can written down..

Mike

Last edited by ninefinger; 12-04-2010 at 08:34 AM. Reason: added info
Reply With Quote

Reply




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
USB Modbus I/O Using PIC rdhopkins PIC Programing / Design 7 05-02-2012 07:23 PM
Modbus to run GS-2 drive? mecheng10 Mach Mill 13 05-13-2009 08:59 PM
Mach3 with Hitachi VFD using Modbus swinn Mach Software (ArtSoft software) 2 11-28-2008 12:44 PM
EMC2/Modbus......HELP! pauldkeeton LinuxCNC (formerly EMC2) 5 02-18-2007 04:47 PM
modbus device Drew Machines running Mach Software 14 02-11-2007 01:59 PM




All times are GMT -5. The time now is 05:00 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