Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: vithanidevesh on January 30, 2014, 09:22:47 AM
-
Hello Friends
I am new here. I am going to revive an old CNC Devlieg using MACH controller. My drives are DC servo drives for Axes and spindle. All are old analog drives. As of now i am not going to replace drives as all drives are healthy.
I am going to use one breakout board for control with PWM to analog convertor for all axis drive
I am also using S7 200. I want to know what control i should use with PLC and what from MACH? Should i use toolchanger program in PLC? or Mach will take care of that?
-
You can not use PWM for axes I am afraid. You have two options, get Step/Dir capable drives or get one of the external controllers that output analogue signals. Oh there is a third option, the YAPSC which takes step/dir and converts to analogue but have heard mixed results with it.
Personally I would go the external controller and it would probably work out about the same price or less than getting new drives.
Hood
-
Thanks for reply
I am using PWM to analog convertor for drive. External controller is good option I agree but as of now installing new drive will cost huge that i dont want to invest. Orignal controller was GEFanuc which is not light up after giving supply so we decided to go for Mach controller. My customer has only 1-2 specific job which he want to run on this machine. These are the drives used originally and i think its good to use with mach also
-
Just want to know something. My existing machine is horizontal milling machine. What i have to set to use Mach for horizontal?
-
Now i want to take Step/Dir pulses in to PLC but for that i want to know what is the frequency of this pulses generated by Mach?
What will be max frequency ? can i take this signals to PLC using Modbus?
-
What are you trying to control via Modbus/PLC?
Hood
-
I want to control all axis using plc
I dont have step/dir controlled drive so i want these signals in plc and plc output will control drive
-
You cant use Mach to control axes via a PLC, well not if you are wanting Mach to plan the trajectory. It may be possible if you write a plugin and send commands via the plugin but it will not be pulses.
Your PWM not work?
Hood
-
No :-[ :-[ :-[
Actually i thought to use PWM to analog convertor but found Step/Dir pulses are not PWM. Now what i understand is, Step Pulses are fixed width pulses but with having varying distance between pulses. isit correct? Now what i think to test is - give this step pulse to PLC as Input, program PLC in such a way that it will generate output for this distance between pulses. This will be almost PWM pulses, and then use PWM to analog converter. Do you think this will work?
One more thing - If this all not work, is it possible that i set speeds of drive manually and preset them with External POT and feed those data to MACH. After all MACH doesnt look whether motor is running or not, then can i use fixed setpoint to my drives and just start stop control with MACH
My machine is too old and having motors of 20Hp and 40 Hp so replacing drives will cost me much.
Whats your suggestion on this?
-
Your best option is as I said at the start, get a controller that will work with Mach and output analogue +/- 10v control signals to your amps.
CSMIO/IP-A is what I use.
There is also
DSPMC
Kflop with Kanalog
Galil
and there is also a DIY option, YAPSC, but I have heard of varying results from it, from working ok to not working at all.
Hood
-
Mach3 step pulses can be converted to an analog voltage using a digital potentiometer. We are currently doing this for our laser diode drivers to modulate laser power. http://www.picengrave.com/Laser%20Setups.pdf
Maybe our circuits can be used for controlling servos, too.
John Champlain
-
Do you have encoder feedback John, Is there a way to close the loop with that feedback?
Hood
-
Hood,
I thought all that was done by the servo controller, and all that would be needed would be for Mach3 to supply an analog voltage to the existing controllers. I didn't mean to add noise to this discussion.
John
-
No problem John, I was curious if your circuits could do that and was asking.
With a position type drive then yes all that is handled in the drive but the drive will take Step/Dir or CW/CCW or be set up as Encoder follower.
For an analogue amplifier or drive to close the position loop your control has to do that, ie the control reads the encoder position and feeds the drive/amp with analogue commands to move it or keep it where it is, ie the controller has to close the loop.
Hood
-
Your best option is as I said at the start, get a controller that will work with Mach and output analogue +/- 10v control signals to your amps.
CSMIO/IP-A is what I use.
There is also
DSPMC
Kflop with Kanalog
Galil
and there is also a DIY option, YAPSC, but I have heard of varying results from it, from working ok to not working at all.
Hood
oK THANKs for quick response
And what about second option i asked? can i just plugged some pot and give fix value to Axis drives to run at fixed speed? My client is not going to run machine for full application. He needs only 1-2 specific Jobs to work on
Regards,
Devesh Vithani
-
You can have a pot connected to the axis but you will not have any real control over the position, it would be fine for a spindle but not an axis. Even load would affect things as there will not be any closing of the loop for position so I would say you need to either try and do it on the cheap by trying the YAPSC or use one of the proven controllers.
Hood
-
Is this step pulses are PPM??
-
Sorry dont know what you are meaning.
Hood
-
Please have a look at this attachment
I am thinking to use something like this. Step will be converted to PWM as shown. Does it looks OK? and then this PWM can be converted to analog easily using card I already have. I am not able to take test as of now because i am waiting for SSR so that i can hook up this 5V Step pulse to PLC which required 24V as input
Only catch is speed of Input. PLC requires 13ms for changing state from 0-1. Does this OK? what is the time range for this Step pulse signals? I mean how many pulses will be there in say one min or what is the max and min frequency of these pulses?
-
If you are wanting to have any kind of precise positional control over an axis, let alone multiple axes then trying to do it via PLC and Mach or any other method you have mentioned, is wasting your time.
If you want to simply have positional control to set positions then use a standalone PLC, if you require the flexibility that is normal in a CNC machine then use one of the devices I mentioned above.
Hood
-
Does all of them work with MACH?
I am just surfing them but found not much details in KFLOP - is it works on MACH?
-
The Kflop paired with the Kanalog can be used with Mach to control analogue amplifiers/drives. You will also likely need to do a bit of scripting if using the Kflop/Kanalog.
If using the CSMIO/IP-A or the DSPMC then it will just be all done in the plugin and Mach config and no coding required for normal setup.
Hood
-
well DSPMC is 16 channel which i dont need and CSMIO/IP-A is looks good
Any other option for 4 axis + spindle ?
-
Some models of Galil are 4 axis but they are expensive new so you would be wanting to look for second hand ones. There are only certain models of Galil that work with Mach so you will need to check on the Galil section of this forum for suitable models.
Hood
-
Hello
Sorry for asking again. Just want to clarify something. If i can use any converter which can convert step/dir to analog, cant i use PLC for same? I am already using PLC for other work
Just thinking if i can give step signals to PLC and generate analog output from PLC itself
Or can i use this??
http://diycnc.co.uk/html/spindle_2.html
-
The YAPSC is fed from the parallel port, has encoder feedback and closes the loop to the servo. If your PLC can be fed step/dir signals from the parallel port (not Modbus) and has feedback and has PID tuning in it then it may work.
No you cant use the diycnc board, it is just a simple step/dir to analogue control, it has no feedback, no PID to close the loop and is simply a means of controlling a spindle that only requires rough commands and no precise positional control.
Hood
-
Sorry but i am just confused. I thought mach works on open loop only. I am going to use parallel port then where should i connect encoder? And which encoder you are talking about? My motor already have encoder and connected to drive
From where i can get that YAPSC card?
-
Ok Mach itself is Open Loop.
Servos however require closed loop.
If your servo drives are step/dir then the loop is closed in the drive, yours however are either Velocity or Torque mode so the position loop has to be closed and with Mach that means either something like the YAPSC (low end solution) or in a controller such as the CSMIO/IP-A or DSPMC etc (High end solution)
In your system because you have Velocity or Torque mode drives then the encoder needs to go back to the control, often however the drives themselves need a speed reference and that, in your case would be from the motors encoder. So encoders go from motor to drive then normally the drive will have Encoder pass through connections so that you can also feed the control with the encoder signals.
So to summarize you need to close the velocity loop in your drives but the position loop needs to be closed at the control, that is why you can not use a simple step/direction to analogue board as there is no way to close the position loop.
Your cheapest option is YAPSC your best option is one of the controllers I mentioned, anything else is wasting your time as you will end up getting nowhere.
I do not know where to get the YAPSC, I saw you tried to contact the guy that designed them, he will be the only source as far as I know.
Hood
-
Ok now i understand what you were trying to explain
This means now i have two options. One is to use PLC and do lot of programming for close loop control and second is purchase controller as you suggested
Second option sounds nice - need some guidence fr that also
I checked and found manual is not available in english fir this. Another thing is, what else i need to consider while i am buying (i mean breakout board, etc)?
Thanks for your sound advice
-
The PLC route would require that you have some form of motion control card in it, usually they are expensive and the resolution would likely be limited as you would have to use the parallel port/
Regarding the CSMIO/IP-A, there is only a connection manual in English but the manual for the CSMIO/IP-S will show you how the normal I/O connect/
Things you would have to check is whether your drives have encoder output connections and that they are suitable for connecting to the CSMIO/IP-A, ie 5v square wave, preferably differential.
You would not require breakout boards with the CSMIO as it has isolation included and comes with the connection boards, but as I said check out the IP-S manual for details of normal I/O
If wanting rigid tapping it would be required you also get the Enc module as well.
Hood
-
Ok I will check my motor encoder. In existing system, in addtion to motor encoder, there is one more encoder for each axis which will give feedback of motion of that axis. Do i need that encoder here? Do i have to connnect this encoder to the controller?
-
Ah Ok that will likely have been the encoder that went back to the original control, so that would be the one you would use for the CSMIO/IP-A assuming it is suitable.
Hood
-
i have one MPG existing which was connected with old controller
I dont know much about usage of MPG in Mach. Just confused a bit with setting window in Ports and Pins. How should i wire MPG and what is to be set in Mach? Explain me the when i should set in Encoder and when in MPG field
-
It all depends on what you are using, is it the parallel port or an external controller?
What output does the MPG have?
Encoders are meant for inputting encoders to Mach so that they display in the Encoder DROs. they are only for information and user functions, Mach does not directly act on them. As an example I have a height setter for setting up my tool height offsets. I use the encoder input in Mach to feed the linear scale of the height checker, that way I can enter the height offsets into Machs tool table direct from the tool setter.
MPG settings are meant for MPG, ie encoders that are meant to control manual motion of an axis.
Hood
-
My original machine design has one control box with start stop buttons on that. CAN i do this things using MACH with those Signals? I mean i can start stop JOG machine with MACH from Key Board but is it possible to do same things using Signals - say from terminal or from PLC via modbus
-
Yes, you can use OEM triggers or Brains or even the macropump.
Hood
-
Any example or documant available? Sorry if i look dumb but this is first time i am working with mach
-
For OEM triggers go to Config menu then Ports and Pins then Inputs and set the OEM Trigger to the port and pin required then you go to Config menu then System Hotkeys and set the OEM trigger you have just configured to the OEM code for the function you wish it to perform.
OEM code list is in the stick at the top of the forum and can also be found on the wiki.
Hood
-
Hello
I just tried MODBUS communication with Siemens S7 200 PLC (CPU226)
I used COM port of my PC for communication. I am not able to make communication running. I checked MODBUS data using MODSCAN and its fine in that
PLease find attached screenshot of my configuration and help me to make it running
-
I dont use the modbus plugin so really cant help with it I am afraid, I use the standard serial interface for modbus.
Hood
-
Hello
I am also not using any plugin
I want simple serial communication only so please guide me
-
You are using the Modbus plugin as you have it shown in the .doc you attached.
On Ports and Pins you must have the ModBus Plugin option chosen.
If you untick that then restart Mach you will get the Non-Plugin version.
Hood
-
ok now i got... i thought that was just optional and i was not knowing that just clicking that will select that option
I will try now that one
Thanks always
Regards,
devesh vithani
-
DO i need to take care of any special things? Like use only some addresses? or have to swap word or anything like that?
-
The start address you set in Mach is a decimal number, likely your PLC will be Oct and thus you will need to tell Mach the equivalent start address.
If you look in the example I posted in the oter thread you will see I have a start address of 1025 which equates to 2001 in my PLC, similarly the 2048 equates to 4000 in the PLC
Hood
-
My machine is Horizontal machine. Do i need to set anything in MACH for that? I mean how it will take care at the time of drilling? For vertical machine, axis motion will be different and for horizontal, it will be different
Is there any option for doing that?
-
If I am understandiong your question then your axes will be the same I would think, ie the Z will be the axis that drills, just as it is on a lathe.
The toolpath display however may show incorrectly in relation to orientation and nothing you can do about that except turn your monitor 90 degrees and make a new screenset up to reflect that.
As far as I understand, Mach4 will allow toolpath rotation but Mach4 is not here yet and when it will be no one knows.
Hood
-
Its ok for display. I am just concerned about operation. Will it be affected? I mean what if my Y axis is going to drill? DO i need to change in setting or just change the names of axis? I have seen some PLANE setting in General configuration. Do i need to change that?
-
I do not really know what is normal for a horizontal but generally the axes should be defined as you would a normal mill or lathe or.......
What I mean by that is the axis that machines with regards to the depth would normally be defined as the Z axis. On a mill that is usually the vertical axis which will also be the axis that runs parallel to the spindle. It is the same for a lathe, the Z axis is the one that is parallel to the spindle.
Hood
-
Ok
I tried once again for modbus and this time without Plugin enabled but it again not working
Here is my setup screen for same
Please help me to make this working
-
also i want to know - do i need any hardware board, or i can just wire directly to PLC?
-
You have to have the start registers that corresponds to your PLC I dont know anything about the Siemens PLC you are using but examples below show what I need for my Koyo PLC.
If you look at the below example of a part on one of my ladders you will see that the inputs to the PLC via Modbus are starting at 4000.0, so In Mach the outputs start register would be the decimal equivalent of that, ie 4000 Octal is 2048 decimal so my start register for Mach outputs would be 2048.
In the second pic that is showing the Outputs from my PLC via Modbus, they start at 2001.0 which in decimal is 1025 and that is the value I would enter for the start register for the Mach outputs.
Hood
-
BINGO... I GOT IT WORKING NOW
I WAS LOOKING AT OEM CODE FILES. MY INTENTION IS TO HOLD FEED OR TO STOP FEED. I FOUND CODE 111 IN OEM LED FUNCTION. HOW CAN I USE THAT FOR PROGRAM?
ONE INPUT ASSIGNED TO PLC - WHEN THIS INPUT IS HIGH, IT WILL BE LINKED TO OEM TRIGGER 1 AND I WILL INSERT CODE 111 FOR IT
IS IT CORRECT PROCEDURE??
-
Ok I think I am understanding what you are asking, is it that you want to have an output from the PLC via Modbus to signal Mach to Feed Hold?
If so then you do not use the LED in Mach.
You could do it several ways, via OEM triggers as you mentioned, via the macropump or via Brains or a combination of them.
With the OEM Trigger what you would do is set the port and pin number next to the OEM trigger you wish to use. Then in System HotKeys you would enter the OEM code for the function you wish in the box next to the OEM Trigger you are using.
Ok so for port and pin number, Port is 0 for Non-Plugin Serial Modbus and the pin number will be whatever the output from the PLC is, for example in my pic above you see B2001.1,B2001.2, B2001.3, B2001.4, so they would represent Pin 1, 2, 3 and 4 respectively. So if you were using B2001.3 then the OEM trigger would be set to Port 0 Pin 3
Now onto the OEM code for the trigger in SystemHotkeys. You are wanting FeedHold so you look to see what the OEM code is for the FeedHold button, it is 1001 so that is the number you would enter.
Hood
-
So this means i will not required any hard wiring right??
If my PLC address start from zero, i will have to set B0.1 or like that for pin
And what will b port no for plugin enabled serial modbus? I succeded with plugin enabled - not tried with non plugin option
I have OEM code list but i think its not updated - what i found is excel uploaded by you in 2008
Can you attach latest list you have?
-
If I recall correctly, if using the plugin you can not use OEM Triggers or I/O via Ports and Pins, you need to use Brains.
The OEM list I am using is that one you mention, I copied it from the Mach Wiki at the time so there may be some updates there, you will have to check and compare.
Hood
-
How can i do that witg brain? Because i couldnt found anything for feedhold in brain
-
see pic.
Hood
-
does Flood/Mist control works as auto or i have to control it?
-
what this user LED does? Can i consider those as Output ? I mean for example 86- x enabled - can i take this as feedback when x axis is enabled in mach?
-
I watched tutotrial about tool change.. its a long script written for m6 but nothing written in my software. do i need to write it manually? i am going to use PLC for tool change. Which command i should transfer plc?
-
does Flood/Mist control works as auto or i have to control it?
M7/M8/M9 control mist/flood
Hood
-
what this user LED does? Can i consider those as Output ? I mean for example 86- x enabled - can i take this as feedback when x axis is enabled in mach?
Not really sure what you are meaning but you can use the LED for other VB if you wish.
Hood
-
I watched tutotrial about tool change.. its a long script written for m6 but nothing written in my software. do i need to write it manually? i am going to use PLC for tool change. Which command i should transfer plc?
You will need to write your own M6 macro,
mine is below, as you can see its relatively simple but that is because all it is doing is sending a signal to the PLC and waiting for one back.
'Toolchange macro for Chiron FZ12S
If GetSelectedTool()= GetCurrentTool() Then
End
End If
Code "G53G0Y310Z-5M3S200"
While IsMoving()
Wend
SetTool =GetSelectedTool()
tool = GetSelectedTool() Mod 12
If Tool = 0 Then
Tool = 12
End If
Do
Call SetModOutput (tool,1)
If GetInput (tool) Then Exit Do
Sleep 10
Loop
Call SetModOutput (tool,0)
SetCurrentTool( SetTool )
Hood
-
I should say however that if you are using the Plugin for Modbus then I am not sure the GetInput() and SetModOutPut() will work.
I have a feeling that you cant use VB with the plugin directly and need to use User LEDs in your macro in conjunction with a Brain.
Hood
-
I am using one LPT port of mother board itself and second one is PCI port
PCI port showing addres E000 to E007
Do i need to remap this? I tried usiong 0xE000 but Mach is getting nothing
One more question - I am using 5 axis. I can Jog 4 from MPG of MACH(using TAB key of keyboard) but how to Jog 5th Axis?
-
If you are using the PCI port then E000 is what you should enter.
You will need to add buttons to the screenset to jog other axes.
B axis is OEM 189
C axis is OEM 190
Hood
-
You mean 0xE000?
Sent from my iPhone using Tapatalk
-
And can i rotate spindle in jog mode? Manual?
Sent from my iPhone
-
No I mean E000, you do not enter th 0x
If you are meaning Jog the spindle from MPG then the only way would be to use SwapAxis() and treat it as an axis.
Hood
-
hello hood
my motors have brake
how should i control them? should i use RUN to release the brakes? is there any code for individual axis run feedback? RUN will ON when cycle start is pressed
-
Normally the brake will be controlled via the servo drive, you could however control it from the enable outputs.
Hood
-
Yes i am doing it using output but i am using RUN signal
Is that any signal specific for axis only? So that i can control axis brakes independently
Sent from my iPhone
-
I do not know what drives you have but as said earlier it is normal for servo drives to have a means of enabling/disabling a brake.
If your servo drives do not have that option then the best option would be to have the brake connected to one of the enable outputs in Mach. That would mean when when you take Mach out of reset the drive would get enabled and also the brake would be released.
If you require the brake to be only released at specific times then you would have to do something different but without knowing exactly what you are trying to achieve it is impossible to say what would be best.
Hood
-
No I mean E000, you do not enter th 0x
If you are meaning Jog the spindle from MPG then the only way would be to use SwapAxis() and treat it as an axis.
Hood
I wrote e000 but its automatically taking 0xE000 and my second board doesnt work at all
Sent from my iPhone
-
No I mean E000, you do not enter th 0x
If you are meaning Jog the spindle from MPG then the only way would be to use SwapAxis() and treat it as an axis.
Hood
I wrote e000 but its automatically taking 0xE000 and my second board doesnt work at all
Sent from my iPhone
OK I got it working. Charge Pump interlock Jumper was set wrong in second card
By the way, any one has set the MPG mode for 5 axis. That MPG which is shown while pressing TAB key
-
In Default MPG, code used are 307/8 for Push to jog X/y but its till A only. What if i want to add 5th axis button on that?
-
Hood.. Can you help??
Sent from my iPhone
-
Afraid not, if there is no OEM for that then it would seem there is no built in function in Mach.
Hood
-
Then what should i do for jogging 5th axis??
My normal operation will be jogging only so i need simple jogging function
Sent from my iPhone
-
Maybe use a MPG?
Hood
-
External mpg?
Sent from my iPhone
-
Yes.
Hood
-
and, how should i connect it?
Its already have one MPG - not sure whether i can use it with mach or not
What type of input is required by Mach for MPG to work? what settings needs to be set in Mach?
-
You can, if I recall, have up to 3 MPGs connected to Mach. You should find settings from Ports and Pins. Also I think the Tab screen has options on it for setting the MPG up.
Hood