Compressor system controller (Arduino / ESP32 based)

Please register or login

Welcome to ScubaBoard, the world's largest scuba diving community. Registration is not required to read the forums, but we encourage you to join. Joining has its benefits and enables you to participate in the discussions.

Benefits of registering include

  • Ability to post and comment on topics and discussions.
  • A Free photo gallery to share your dive photos with the world.
  • You can make this box go away

Joining is quick and easy. Log in or Register now!

kaiserb

Registered
Messages
10
Reaction score
4
Location
Mansfield, TX
# of dives
200 - 499
Hi everyone,

I researching the best way to control an Alkin M32 compressor system with a non PLC microcontroller. I have read a couple threads on here from 2020 (Compressor controller) but have not found much else for creating a DIY controller.

Thoughts and ideas?
 
M32 or W32?

your non-plc comment, is that the compressor currently doesn't have a PLC or that you don't want to use a plc?

What are you trying to control specifically? There isn't a whole lot going on with an M32 so you can break the e-stop circuit out to different controls so you would know if it stopped on a pressure cutoff, low-oil, or the actual stop button, but that's about it on the stock pump. You can start adding sensors for interstage pressure to be reported, temps, etc.
If you just want to be able to start/stop it from your phone or schedule on/off times then you can use one of these guys in place of the manual start switch
 
The compressor currently has a problematic PLC. This is the second or third time in the past 5 years that the PLC has decided to stop working etc. and countless times we have had to maintenance the PLC with tightening up wires, finding basic faults etc.

Switching out the PLC based system over to an Arduino based system will be easier to maintain and a bit more flexible.

Right now the system has a 5 inputs (Oil P, Pressure, Temp, E-Stop and overload) and 4 outputs (Motor relay, Fan, Drain Control, and Warning Buzzer)

I am not worried about running things from a phone, or using BLE functions. Trying to get a basic Manual ON / OFF and Estop and run sensors to the rest with an interrupt relay to fault the compressor if Oil or Temp etc gets out of spec. Also a would have fault readouts on a small LED screen for easy fault finding etc..
 
Since you're already on a PLC, you really have to stay on a PLC, at least in terms of functionality. Programmable Logic Controller, it controls outputs based on programming parameters of logic inputs, so you still need to have all of those inputs and outputs controlled.
What you are asking for in the last paragraph is exactly what a PLC does. You can replace the PLC that came from Alkin with another PLC which is what you're asking about with an Arduino, but you will still have the same inputs/outputs and you'll have to write the programming for it yourself. You won't however get away from loose wires and chasing faults. You have a high vibration device and that means stuff is going to get shaken loose, problems are going to occur, it's the nature of the beast. You can move the PLC off of the machine or try to isolate the vibrations, add ferrules to the ends of the wires, etc. but the only thing you're doing by changing to an Arduino/Rpi etc. is just changing the interface.

If you're going down the path of DIY, start here. You have the 4 outputs you need and it gives you some spare inputs. RS485/Modbus screens should be compatible
 
Thanks for the heads up looks like I could use Arduino IDE or Platform IO. I will just have to learn the language of ladder programming etc. I like the options of being able to program the unit directly through a somewhat modern interface.
  • Arduino programming language via IDE
  • IEC-61131-3:
    • Ladder Diagram (LD)
    • Function Block Diagram (FBD)
    • Sequential Function Chart (SFC)
    • Structured Text (ST)
    • Instruction List (IL)
As for the current PLC: the original PLC system was built by a local company that is now out of business thus access to the existing ladder programming is non-existent. Thus the thought to move off the PLC to a different set of controls via Arduino with Python / C++.

Regardless the control box needs to be vibration isolated. The wiring diagram is pretty straight forward either way.
 
Thanks for the heads up looks like I could use Arduino IDE or Platform IO. I will just have to learn the language of ladder programming etc. I like the options of being able to program the unit directly through a somewhat modern interface.
  • Arduino programming language via IDE
  • IEC-61131-3:
    • Ladder Diagram (LD)
    • Function Block Diagram (FBD)
    • Sequential Function Chart (SFC)
    • Structured Text (ST)
    • Instruction List (IL)
As for the current PLC: the original PLC system was built by a local company that is now out of business thus access to the existing ladder programming is non-existent. Thus the thought to move off the PLC to a different set of controls via Arduino with Python / C++.

Regardless the control box needs to be vibration isolated. The wiring diagram is pretty straight forward either way.
depending on the existing PLC you may be able to pull the programming out, but it's going to be really simple with some low and high alarm, and low and high limits for each of the inputs, and then programming outputs based on those limits. I'd start down with that Opta, make sure to get the one with RS485 so you can put a screen on it and then start experimenting. The manual should give you the control limits for temp/pressures though you can obviously narrow that range as well, and I would probably program a delay function for the fan that says to run for say 5 minutes after shutdown occurs unless the e-stop button is pressed to help cool the thing down more evenly.
Other advantage of staying with this is that if/when the motor dies you can put a 3phase motor in with a VFD and be able to control the vfd.
 
Thanks for all your help... IDE downloaded and Opta ordered.... will advise when I get a bit further along and have parts in hand.
 
Ok I am back... so far I have purchased an Opta with the RS485 modbus option. It was really nice that Arduino corp thought ahead and includes licensing with the units so no cost software was a plus.

I spent a weekend learning Ladder Logic and Function Block programming and managed to create a rudimentary set of operating instructions for an Alkin W32 compressor. I found this website super helpful to get familiar with the coding schema PLC Simulator Online

I removed the old defunct GE (now Emerson) PLC from the unit and using the wiring diagram I created a few months back set up the existing sensors on the new PLC. I also reused the 24v power supply, and motor start / latch relays.

For inputs I have:
  1. E-stop (NC)
  2. Start (NO)
  3. Stop (NC)
  4. Oil Pressure Sensor
  5. Motor Overload Sensor
  6. Temp Sensor
  7. Air Pressure
For outputs I have the 4 relays set to:
  1. Motor
  2. Auto Condensate Dump
  3. Warn Light
  4. Warn Buzzer (will likely change this as no one likes a buzzer)

The program ladder runs a basic loop to start and run the motor until sufficient air pressure is attained. There is a secondary ladder rung that opens the ACD, every 15 min for 30 seconds. Other loops run simultaneously checking for E-Stop or sensors out of sync and for a Startup one time functions and Stop button one time functions.

Overall the project was much easier than I thought as the compressor is back on line and humming along.
 
https://www.shearwater.com/products/swift/

Back
Top Bottom