Please help me programming with Mitsubishi Melsoft GX Developer

burtgummer

Member
Join Date
May 2017
Location
Belgium
Posts
21
Hi everyone,
I'm new to ladder programming and I may have been too ambitious thinking I could do a full plc program by myself.

My father has a manual block making machine that I wanted to automate, but I can't get the plc to do exactly what I want despite reading on your forum and in the manuals.

It would be great if someone could help me with this program, here is what the program is supposed to do:

Before starting the machine the loading trailer and the compactor piston are retracted and both are pressing a limit switch indicating that they are at their idle position.

Machine operation:
(1)Emergency stop is turned off
(2)On/off button is turned on
(3)Loading trailer moves forward
(4)Loading trailer moves backward
(5)Compactor piston moves downward
(6)Compactor piston moves upwards
(7)Wait time: 2.5 seconds
(8)Program repeats from (3) until on/off button is switched off.

Detailed explaination:
Emergency stop is turned off
On/Off switch is turned on (if this button is turned off during operation, cycles should finish normally and the program should stop with both loading trailer and compactor piston pressing the limit switches at their start position).
Program checks that the limit switches are both pressed
Loading trailer moves forward during 3 seconds then stops
Loading trailer moves back to it's original position and activates the limit switch (if fails to activate the switch whithin 4 seconds the cycle should stop an alarm is activated).
Program checks that the loading trailer activated the limit switch then compactor piston moves downward until a pressure switch closes (if fails to get a pressure signal a timer of 5 seconds stops the cycle and pulls an alarm).
If everything went well and the pressure switch gave a signal then the compactor piston moves up and reaches the limit switch (then again time delay protection, alarm)
Machines stays still during 2.5 seconds then repeats the cycle.

Alarm can be programmed as coil -(Y07)-

It is important that if the the on/off switch is turned off at any moment that the machine is able to finish it's cycle then stops awaiting the next start.

If the emergency button is pressed the machine should stop moving immediately.

My plc is a GX1s-20MR with 12 X inputs and 8 Y outputs.
GX Developper version: 8.50C

Thank you for your help, best regards,

Burt Gummer
 
Hello,
just an update on my work, here is how I programmed the thing, I'm sure it's not the best way to program it, but it seems to do the job when I test it on the plc, still I can't get the program to repeat itself when it arrives to the end and I still have to implement an alarm using the output -(Y07)- when the program doesn't get feedback from either the limit switches or the pressure switch.

http://imgur.com/DjuS2by

DjuS2by.png


Any help would really be appreciated, take care, 🍻
Burt Gummer
 
Well sadly I can't say I got any feedback from forum members, still I finished the program and wanted to share it with the community in case someone needs parts of it.


zX9JiRy.png


See you, 🍻
Burt Gummer
 
The only reason I have replied is that I am extremely worried that you have not considered the safety implications in automating a compactor .
I don't think any members are likely to give you programming help on such a dangerous machine . YOU MUST CARRY OUT A RISK ASSESSMENT AND A METHOD STATEMENT . There may be other safety steps to take before running this machine . I am not aware of all the regulations in your country / state . A non - safety PLC MUST NOT be used to stop this machine in an emergency . The wired control circuits must stop the machine .
You have not mentioned guards which should be safety interlocked before the machine can run . A simple E-Stop button is not safe .
Paul
 
Hi Pal,
The emergency stop is also controlling the hydraulic pump of the machine, so if there is any problem it's not just a plc based safety.
If you read my program you may have noticed that at the end of the cycle there is a counter that is activated (Y006), this relay not only activates a counter to monitor the amount of blocks that were made, but it will also power a buzzer indicating that the operator can remove the block and power a light that will illuminate the unloading area.
Finally two operators will work on the machine, one will unload the blocks, the other one will be ready at any moment to press the emergency stop in case there is a problem.
Surely it's a dangerous machine, but all industrial machines are dangerous, a crane, a bulldozer a truck. If you drive you must be conscius that your simple presence on the road may kill someone, no one is immune to accidents there is just a limit to what can be done or no one would be doing anything.
I could add a laser barrier in front of the unloading area that shuts down the pump but I don't have it and can't find it in shops, still I think the safety isn't an issue on this machine, we ran some tests and the unload time is enough, plus the crushing phase comes after the loading phase and it's doing a lot of noise, I highly doubt that someone is going to leave it's hand in the machine while operating.

Finally, this actual configuration is temporary, I ordered my hydraulic block with 6 solenoid controllers and am only using 4 at the moment, and when I recieve the last parts for it I will install an automated unloading system with a transport belt.
I finished the program one week ago with no help at all, and came back to share my work not even expecting a thank but wanted to help people new to the software, at least I thought it was the purpose of the forum, now if you think that it's better to keep people ignorant and let them make mistakes or hurting themselves feel free to cancel my whole publication.
 
And that is the opening statement for the defence M'lud.
It was safe because I said it was safe..end of.
If they put their hands inside while it's running it is their own stupid fault.
 
Hi Burt, thanks for posting your finished code(which l haven't tried to follow because you haven't commented it, which for people unused to the software makes it more of an effort to follow).
But, the BIG BUT, as you are aware, safety is paramount and as such, you have supplied code that you wish others to use and as such for good coding, should have a complete description per line what the rung is doing.

I think you are being maybe a bit/very harsh on your assessment of the possible lack of help you received, which is unfortunately as if you look at the number of posts you have compared to some on this forum. While on this issue, if you you look at posts, l would be surprised if you will find some of these Gurus (my words for these helpfully guys. We are talking of most probable the, in particularly the high post number people, the best PLC programmers in the world, let alone how free they are with there help) will not supply code for a project ( there is a reason for that, which l hope you will see coming).
But, again but, l hope you have fully understood all the safety concerns of this project and have not left your self:beerchug: open to litigation when/maybe/hopefully never, the machine malfunctions due to your code/ or lack of safety products incorporated into the PLC or the need for a safety PLC.
Not say you, but again, many people/ anyone, can write a program to run anything they like because they can. It is only when someone is injured or worse, that the repercussions are felt.
So l sincerely hope you have considered all/ not what you think might happen, possible failures or operators mistakes that can and will happen.
Sleep well, but please rethink your last paragraph.

"I finished the program one week ago with no help at all, and came back to share my work not even expecting a thank but wanted to help people new to the software, at least I thought it was the purpose of the forum, now if you think that it's better to keep people ignorant and let them make mistakes or hurting themselves feel free to cancel my whole publication."
Regard
Kevin, stay safe
 
Last edited:
And I as a seasoned Mitsubishi programmer will say - your code is very bad.

All SETS's and RST's, not a good idea.

What happens when an output sticks on (or welds itself closed) which they often do if they are driving hydraulic solenoids directly.
Will the stop button cut power to the ram?
 
Now you may have him thinking Ronnie,"what is a directly connected solenoid to a PLC output", surely it can drive it without failure, its only 24 volts, l can play with this voltage as much as l like, no law against it, "is there"
 
Hello PLCnovice61,
Thank you for your reply, I have read a little on the forum and indeed there are some very kind and competent people, and in general content is of great quality compared to what we usually find on internet.
I spent most of my life working with dangerous equipment, lathes, milling machines, cnc machines, I buit 2 CNC milling and plasma machines of my own conception one weights 3 tons and has a gantry of 3 meters and 500kg moving around that could easily crush a man, so I am very aware of risks involving the use of industrial machinery.
I get it that not everyone understands the risks involved using these kind of equipments, the program I shared is custom built to my equipment specs, and of course nobody should just take it as it is and and use it without adapting it to his needs. I shared it so beginners could see the logic behind different functions, see how to trigger an alarm, make a program cycle etc.

Some comments are displayed under the blocks of the program but I can add detailed explainations of each line if you think that would help the community.

Regarding the safety issue, there is one thing people should think about, any dangerous equipment is built with safeties, but none is 100% safe and the main reason for that are over complexity and final product price, you may all have seen the super table saw that has a built in safety that blocks the blade before any wound occurs if the blade detects a finger. Well I bet that in 10 years people will still use old table saws with no safeties al all and those tables will probably still be available in stores.

Only someone working behind a desk can think that you can avoid 100% of accidents by overthinking safety procedures.

For my part I think that the procedure I chose for the safety part is already enough for the task, is it the best way to operate the machine? no as it involves human interaction who are known for not being as reliable as robots, can it be perfected yes absolutely as any equipment you will buy in a toolshop.

@Ronnie, the solenoids go through secondary relays, each solenoid eats up 37 watts at 12V.
And yes the emergency stop cuts power to the hydraulic group.
There is a switch that allows manual operation or the solenoids to move the parts back to home position, the program also includes checks for homing positions to avoid collisions.

It's nice to get a reply stating my program is very bad now that I finished it knowing that I came here to ask advises in the first place and got no answers.

I might be wrong but why do I sense irony in all of your messages, do you enjoy bashing people you don't know?
 
@Ronnie if you read my program you could clearly see that SET and RST are logic functions for cycles and not relay controls... so your point is invalid, contacts will not stick, if the PLC has a processor failure then the operator could simply press the emergency button that cuts power to the hydraulic group.

[edit] I read your comment again, and I may have misunderstood your remark, are SET and RST unreliable for cycles?
 
Last edited:
HI Burt,
"Regarding the safety issue, there is one thing people should think about, any dangerous equipment is built with safeties, but none is 100% safe and the main reason for that are over complexity and final product price, you may all have seen the super table saw that has a built in safety that blocks the blade before any wound occurs if the blade detects a finger. Well I bet that in 10 years people will still use old table saws with no safeties al all and those tables will probably still be available in stores. "

You have been looking into my shed and saw without protection of any sort apart from me keeping the fingers away.

Well you sound confident in your code and have previous experience (more so than me in building a CNC and more likely most here haven't built one, maybe programmed one)) l wish you the best.
Re- comments to code, you can never have to much, so any additional comments would help anyone wanting to follow.
Regards
Kevin
Regards Kevin
 
I'm not specially confident about my code since it's the first program I do in ladder programming still the machine seems to operate fine for the moment, and believe me I'm the first one concerned about having a final product reliable that won't harm people and I'm the one making all the tests and triggering errors on the machine to see if the program logic works fine.
I am very interested in the last message from Ronnie Sullivan and hope he will give me some advises on how to do something better than using RST and SET the way I did.
 
Hi Burt, l think what he will explain is if you use set logic to latch on outputs, when the power goes off, they stay set and when program/power is restored, outputs are ON.
So the suggestion would be to use "sealed/latched ON" outputs instead of "set". I apologise l haven't really looked at your code so unsure what is going on, l am just offering general advice,as most here would, except they have way more experience than l.
Regards Kevin
 
Last edited:
I understand Kevin, I programmed the emergency button so it resets all M functions, and especially the cycle timer to 0 so the program can't go on, if the pistons are not in their homing position when the Estop button is depressed the program will only trigger an alarm and can't be started until the manual switch is used and then everything is set to home position.

I'll edit the picture containing my program to separate and comment the sections to make it more readable, any input on how I should do things will be highly appreciated.
 

Similar Topics

I'm hurting here and really need help. I have an old machine running a AutomationDirect PLC 405. I have a data collection system that is...
Replies
7
Views
1,648
  • Poll
Micrologix1100 PLC with rslogix software. Does anyone know how to use a single turn absolute rotary encoder as if it were a multiturn encoder...
Replies
2
Views
1,397
I have a conveyor whose speed varies between 20 and 50Hz through a PLC (HMI). I need to program a code with a timer whose value will vary between...
Replies
26
Views
4,177
Hello Guys, I'm new to PLC programming and a course I'm currently studying has asked a question and requested we use a shift register. The...
Replies
20
Views
5,936
Hello! I am extremely new to PLC programming and would be incredibly grateful for anyone's input and/or advice. I am not entirely sure how much...
Replies
18
Views
5,758
Back
Top Bottom