Hello Guest it is April 21, 2021, 02:38:57 PM

Author Topic: Mach 4 Machtric 2.2kw VFD Modbus  (Read 13782 times)

0 Members and 1 Guest are viewing this topic.

Mach 4 Machtric 2.2kw VFD Modbus
« on: January 14, 2017, 09:03:39 AM »
Hello guys I'm totally lost..
 
As I've decided to switch from Mach3 to Mach4,
to get rid of the old dying parallel port, A new problem have showed up, probably not just one,

I have very little experience with modbus, very very basic knowledge and nothing more and I really need some help to either understand, or to get it working,

I got the numbers hex/Deci,s registers and so on, but I don't know what to do with them?

There is no test modbus feature in Mach 4 that could help me determine the functionality of the settings,

And how to bind them to the spindle start/stop/freq buttons in the software?

Lua script/plc editor? Way out of my comfort zone,

I want to learn but..  I don't often find moments to research and learn,

And my English isn't the best as you guys probably have noticed.

Thanks.
Re: Mach 4 Machtric 2.2kw VFD Modbus
« Reply #1 on: January 14, 2017, 08:05:22 PM »
Hi Zuxztah,
what motion controller are you using? The one I use has features built in to control a spindle. I imagine every controller
on the market has some features to turn the spindle on and off at the least and most have a PWM output that can
be used to control the speed.

You could probably use MODBUS or similar but is more complex and maybe not necessary when getting started.

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach 4 Machtric 2.2kw VFD Modbus
« Reply #2 on: January 15, 2017, 05:32:28 AM »
Hello! Yes it's possible to run it trough pwm, I use 2 Different Chinese bob's, can't remember the name C10 maybe? at the moment I got everything hooked up with a Smoothstepper (ESS)

I could just wire up the start/stop cable and then control the speeds from my portable vfd panel,
But I want that automatic speed change feature, and smooth running operation with modbus, 0-10v  dosen't seem to run as reliable as Modbus

The biggest problem I have is to bind all the functions from mach4's buttons to send commands via modbus?

The LUA code that sends the commands to VFD when M4 or M5 is pressed  or when the frequency is changed?

I can run the vfd with any modbus communication software/serial monitor it's just the lua in Mach that's itching my brain, just like the old brains in Mach 3, I'm not able to figure it out,

 attachment is a mess, a old picture without the ESS


And some other pictures of the machine  :)

https://imgur.com/gallery/qc15q
Re: Mach 4 Machtric 2.2kw VFD Modbus
« Reply #3 on: January 16, 2017, 06:03:08 AM »
Hi Zuxztah,
Quote
, and smooth running operation with modbus, 0-10v  dosen't seem to run as reliable as Modbus

I'm not sure about that, many users run their spindles that way without problem.

If you want to run over MODBUS I can probably sketch it out, will use the manual for my Delta VFD which I imagine will be
similar to yours.

You need to set up your VFD

02 - 00
My wife left with my best friend...
     and I miss him!
Re: Mach 4 Machtric 2.2kw VFD Modbus
« Reply #4 on: January 16, 2017, 01:50:40 PM »
I really appreciate the help!

I want to run modbus to save I/O on the breakout boards and to eliminate EMI noise, haven't had any noise problems with modbus so far,


 I'm running modbus trough USB (USB - RS485) if you want I could give you access trough teamviewer or something to change all the settings directly in (Mach) on my computer, and if you want you could contact me via Facebook/skype or something if you want fast response, if you prefer that, it's important though that we post all the information and settings here on the forum  :)

The settings I use is:

P101: 5 RS485 communication (Frequency setting selection)
P103: 1 "STOP" ("STOP"Key lock mode valid)
P700: 38400 bps (Communication speed)
P701: 8N1 FOR RTU (Communication mode)
P702: 1 (Communication address/Slave address)
 
COM port 1 or 3 don't remember at the moment, and I'm also running the VXRouter.screenset

I had everything working in Mach 3 with some help from a guy on the CNCzone forum,

I can start and stop the spindle via decimal start:8192 and by sending decimal command:

10 Start CW
01 Stop
06 Start CCW
12 change Direction (While running)

And frequenc:  Start:8193 by sending decimal command 100-400 or 1000-4000 not entirely sure at the moment (Frequency in Hz)
100hz = 6000RPM
200hz = 12000RPM
400hz =240000RPM


The only thing that wasn't working was RPM feedback to the RPM window in Mach 3 (actual RPM)

The problem I experience now is that there isn't any test modbus function in Mach 4 so I'm not sure if it's working or not when I'm trying to add a modbus function, and I'm not familiar at all with LUA/PLC or any code at all (Linking to the M commands and conversion from RPM to Hz and  actual running speed feedback to Mach 4 (RPM window)

I've used a external serial monitor and sent all the Deci commands with good results,

attached all the manuals for the VFD,

Thanks again!

Re: Mach 4 Machtric 2.2kw VFD Modbus
« Reply #5 on: January 20, 2017, 01:30:58 AM »
Hi Zuxztah,
the manual files are empty. Sounds like you know how to programme your VFD.

If you read thru the manual you might find another function something like (my Delta VFD manual):
(3) 08H: loop detection
This command is used to detect if the communication between master device (PC or PLC) and AC
motor drive is normal. The AC motor drive will send the received message to the master device.

This function you could use to test your link. The link and the VFD will have to be present and working. You may need to
disconnect the spindle while you experiment if it would present a danger.

If you follow my suggestion there should be two registers in Mach4; spinCntrl and freq. They can be observed by opening
the Regfile Diagnostics page and expanding Modbus0 using Mach4 Diagnostic tab. If you click on a register you can also
manually edit it. As the MODBUS function are executed every 25ms or so any edits will be written to the VFD.

All that is required now are some LUA scripts to auto update the registers. If you have not already done so read chapter4 of the
'Mach4 Scripting Manual' which can be opened by clicking the 'Help Docs' button in the File Ops tab with Mach4 enabled.
I will re-read them myself and come back with some suggestions.

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach 4 Machtric 2.2kw VFD Modbus
« Reply #6 on: January 20, 2017, 03:08:39 AM »
Hi!. I'll try to post the manuals again, used the phone to attach the pdf's and that's probably the cause to not uploading properly,
Re: Mach 4 Machtric 2.2kw VFD Modbus
« Reply #7 on: January 21, 2017, 05:56:17 AM »
Hello! I've been fiddling with some of the modbus settings and set up a function with 4 (Write) Multiple Registers
Start CW
Stop
Start CCW
Cange Dir
And one single register for frequency control

, I'll post some pictures :)

Functions at 8192 doesn't seem to be responding? Reply time out.

And there isn't any value to add the (Decimal code) that Mach will send to the VFD (I guess it's in the lua code that determine what Decimal command to send)

And there isn't any way that I know of to send a command to the vfd to determine if the modbus setup is really working? More than the diagnostics window.

https://postimg.org/gallery/10d73mala/
« Last Edit: January 21, 2017, 05:58:00 AM by Zuxztah »
Re: Mach 4 Machtric 2.2kw VFD Modbus
« Reply #8 on: January 21, 2017, 03:46:43 PM »
Hi Zuxztah,
if I understand correctly you only require two registers to control your spindle:

slave reg 8192- contains the bit pattern to turn on or off the spindle and its direction
slave reg 8193- contains a numeric value for the frequency

I believe also that your MODBUS connection window (your first pic) should have 'use zero base addressing' checked.
I propose that the Mach4 registers are modbus0/spinCntrl  and modbus0/freq.
Your frequency setting function (your second pic) should have the slave address 8193 and the Modbus register should be modbus0/freq.

Your spindle control function (your third pic) is inconsistent. The function selected is 'write multiple registers', you only require 1 register word.
The slave address (the VFD is the slave device) should be 8192 and the Modbus register should be modbus0/spinCntrl.

In order to control your spindle you need to load the required bit pattern into modbus0/spinCntrl, ie one word transmitted but different values
for the required spindle function.

Does that make any sense?

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach 4 Machtric 2.2kw VFD Modbus
« Reply #9 on: January 21, 2017, 04:33:24 PM »
Hi, I don't know what I'm doing, no experience at all, the only obstacle now is = everything but at the moment  modbus0/spinCntrl and modbus0/freq, what are those? Script in screen editor or a txt/config file in the Mach folder?

I'm stating to understand

I thought I had to write to  modbus register (8192) with multiple registers and then define Reg 1 - 2 - 3 accordingly to the buttons in Mach via script in screen editor,

Like in this picture (IMG_0268)

Reg 1 is defined to button for  Spindle start Clockwise (sends Decimal 10 for start)
Reg 2 is defined to button for Spindle stop rotation (sends Decimail 01) and so on, but I've clearly got everything wrong, hahaha :P

Forgive me for my bad/basic English,