Analog Control via PLC

Paul_NJ

Member
Join Date
Jul 2015
Location
New Jersey
Posts
9
I’m a retired volunteer who travels to Africa each year to set up solar installations to provide lighting in remote village orphan centers. I have need to add some automation to our systems, and I’m hoping to find some help in programming.

I recently purchased one of those Siemens/Crouzet “micro PLC” Chinese clones, this one from MicroDepot. It is programmable via block diagrams, and I was able to figure out enough to successfully use it to automate some digital stuff, such as a testing apparatus involving several stages of timers actuating external relay switches. So far so good.

What I’m hoping to do now is to employ it as a voltage controller . . . monitor a voltage, and if it is above a set level, actuate a relay. For example, in a normal condition, solar charged batteries provide night time lighting at nominally 12 vDC. However during the day, the batteries are being charged at 13.5 to 14.5 vDC, and I wish to disconnect the lighting system from local control. While we tell people not to turn on the LED lighting during the day because the higher voltages will cause premature failure of the LED bulbs, that isn’t always followed. And the LED bulbs aren't cheap, particularly when you have ship them 8000 miles.

I’ve not before employed analog control, and I’m not finding any (simple enough for a novice to understand) examples online to help with this. I purchased a 0-50 vDC voltage sensor to supply an analog signal, but that’s as far as I’ve gotten. Basically I wish to compare system voltage to a programmed setpoint, say 13 volts, and if it is reached to trigger a digital signal to activate an external relay coil.

The micro PLC has a number of analog function blocks available, eg Analog Threshhold trigger, comparator, etc, but I don't know which to use or how to set this up. If anyone can provide some guidance, or refer me to a site or document to help with this, I would greatly appreciate it.

PLC.jpg analog block.jpg
 
Give me a minute to look at the attachments as I'm not familiar with this PLC. But generally you scale the analog input for what the transmitter is scaled (0-50) then u compare that to your setpoint when to energize. coil.
-----edit------------------
so 0-100 analog signal automatically is 0-1000 internally. so 0-50 transmitter range and 13v setpoint. 13/50=0.26. 0.26×1000=260
so looks like your setpoint will be 260 and then 260-1000 energize output(set). 0-259 deenergize output (reset)
-----------------------------
Another thing to consider is failure. if energizing the coil allows power then if the coil fails all power will be gone. In this scenario I would say that failure should lead to power all the time. (way happens due to Failures is an important part to consider when designing any Control system)

and in all honesty if you wanted to keep it really simple you could just use a photocell to turn off the lighting power supply...
 
Last edited:
First of all, props to you for doing this.

I am not familiar with the PLC either, but know LOGO. So it should not be to different.

Could you post your program? Or send it to me in an email, you can send me a PM for the addy.

It would also help to know what the sensor is you bought. 0..50V -> 0..10V?

Generally speaking, as stated above, you would rescale the AI to show 0..50V once again. Then you compare as is with your SP.

I would love to help you with this, so please feel free to contact me.
 
Thanks for your responses. I've already purchased a voltage sensor . . it has a range of 0-50 VDC. Hopefully I'll get enough resolution to control at 13 vDC. It was the only one I had found that could operate at a 12 vDC supply.

I did consider a photocell, but year-round location, and security, are difficult issues in such areas, particularly when you're there only 2-3 weeks a year. I'd rather put a control in a box. Also, I'm hoping to use the same PLC for controlling a solar pump we're also installing for irrigation. Have to run the pump several hours on, several hours off. But that's the next project.

I purchased NO relay, 12 vDC coil, at 30A to shut off the lighting load.

I don't have a program yet . . . my first need was to determine which block to use to compare the current voltage the voltage sensor sees, to a programmed "setpoint". It seemed like the "analog trigger" might be appropriate, but I didn't know.

sensor.jpg DSC_7298.JPG DSC_7021.JPG DSC_5929s.JPG
 
Last edited:
Ok so with it being normally open if the coil fails or the transmitter fails you.can end up.with a no power situation. Since you are not.there often id suggest have it fail with power on so NC contacts and plc energizes it to.kill.the power output
 
To get back on topic here.

The PLC and transducer are already purchased.

As per your first pic, your analog input will be read as 0..1000 (int) for 0..10 V. So first thing you will do is take this value and multiply it by 5. To get an internal number of 0..5000.

Now you declare your threshold to be 1300. And compare these values.

You should build in a hysteresis because I assume your voltage will change once you open/close the relay.

Perhaps it would be advisable to install a voltage regulator to maintain a somewhat stable voltage.
 
Let us know the brand part number of the LED bulbs you are using
as I find it difficult to see your arrangement as worse than
the average car charging arrangement

Your bulbs should be able to cover the voltage ranges you have
but maybe someone can suggest options that will

If not then a scaled up 3 terminal voltage regulator would do the task
by limiting the peak voltage to the lamps
 
a very simple crosswitch is enough in daytime solar and nighttime the lights.
if they forget the switch they wont have light next day.
another possibility is to switch a voltage regulator in the daytime to keep the voltage down.
in night direct to get better efficiency.
 
Thanks to all for your suggestions and involvement. This September will be my 7th year working in Malawi, Africa. Over the entire country, 7% have access to electricity. The in-country group we work with helps orphan children (about 10% of the population). I thought lighting the centers that are used during daylight hours to feed and educate the kids in basics like brushing their teeth (what’s that?) might help give them a place to read at night and do homework. Some walk more than 5 miles to get there. We mount LED lights on the trusses supporting the roofs of the open air centers, 3 meters above the floor, so they have to be spot lights. The LEDs we use, in homemade fixtures, operate at 12vDC. With 200-500 active kids running all over the place, I decided against higher voltage wiring. We purchase generic MR16 base lamps for about 6 US$ each.

By the way, as some background, I’m a chemical engineer, and know a little about what can be done. But not a whole lot about how to do it. The guy I travel and work with is an accountant. This forum is the most technical “board of advisors” I’ve had the luxury of speaking to so far. I mean it.

We have provided lighting to 3 centers so far. Number 4 this year, as well as a solar powered well pump at one of the centers we’ve lighted. We utilize about 120-150 LED bulbs per center. Bulbs are 4 watts. We also provide charging capability for cell phones, which turned out to be more popular than the lights. Go figure. Some things are universal.

At one center, the bulbs have lasted 2 years so far. That’s almost 2000 hours per year. At our most recent center, they all burned out after 6 months. Replacing all the bulbs in one center is $1000 US . . . not to mention carrying them in and import duty. Solar control systems are the same at all of the centers. Batteries are charged to about 12 vDC, available to the bulbs at night. During the day, the controller’s charging algorithm sends 13.6 to 14.4 vDC to the batteries while the sun shines. LED longevity is a function of voltage and temperature. Does the extra 1.5 to 2.5 volts make the difference? Don’t know. Haven’t seen any published data.

What do you do when you install 20th century technology in a 18th century world, 8000 miles from home? And you’re there for 3 weeks, and leave till next year? Strict instructions: don’t put the lights on during the day. Who will tell you if that happens? Does it make a difference anyway? So process of elimination . . . let’s install controls to “lock out” lighting during the daytime charging period, in case the elevated voltages are killing us. We could do this on photocell control. But they are harder to locate reliably and protect against theft and damage . . . let’s control what we know is suspect . . . voltage.

So why did we lose $1000 worth of bulbs in 6 months at one center, and not the others? “We never use the lights during the day”. OK, maybe. But who knows?

I liked the voltage controlled switch mentioned as an economical alternative to PLC control, and would be good for 3 centers with only lighting. So perhaps we'll buy 3 of those. But a 4th center will now need pump timing control added to the lighting control after this trip. (And of course this is the center where all the lights burned out . . .). So in this location programming a PLC control is likely the best answer. By the way, can two totally independent control schemes be run simultaneously on the same PLC?

I’m glad I found you guys.

bulbs.jpg P1010650s.JPG DSC_5483.jpg DSC_5949s.JPG
 
Last edited:
Paul_NJ

I would satay away from a PLC in this application
keep it simple if something happens an 8000 mile service call is a stretch at best
I would look for a simple 24 hour timer 12VDC or even windup type
I would also hook up the pump to run only in the daytime while your charging this would also help pull the charging voltage down while it runs.
I have seen cycle timer with a time range over several days
give some more details on the pumps and your application and I may be able to find an alternate solution
Gary
 
I am kind of inclined to agree with GaryS on this one.

But..... if you are going to use that Logic Controller you show in your earlier post then the logic to do what you want is very simple. (See Below)
(By the way your controller is just a knock off of the Siemens Logo it is programed using "LOGOSoft Comfort" software.)


What you see below is from Left - Right

ANALOG INPUT
(0-50v scaled to 0-10v = .20 per volt so 12.5v = 2.5..... 0-10 is represented in the Logic Controller instruction as 0-1000.....so 2.5 = 250)

ANALOG THRESHOLD TRIGGER
This instruction receives the analog input at its AX and you put in your settings to the parameters for the Function Block.
Here I have it set to be ON between 0 - 249 so you can see that the Threshold Trigger is TRUE (RED LINE) when the Input Value is between 0 - 249......When the Input Value reaches >249 then the Analog Threshold Trigger will be False.

RELAY OUTPUT Q1
When the Threshold Trigger is True then Relay Output Q1 is True.
You will use this output to control the coil of your 30 amp relay to turn on and off the lights.


If you are dead set on using this Logic Controller, then just post what you need done for programing and there are several of us here who can do that for you and send you the file, or we can just post the logic like I have below and you can program it yourself if you prefer.


BCS

Africa Logo Analog.jpg
 
Last edited:

Similar Topics

I am having trouble with getting no control of my analog output signal. I am using the SCL function block to control my analog output. The logic...
Replies
11
Views
273
Hello, I am working with the PLC connected to analog devices such as ball valve or pumps. the PLC is Siemens S7. the analog input module is...
Replies
5
Views
538
I seem to be on here often lately but cant find specifics about my situation I am trying to control the drive using both ethernet and analog(for...
Replies
1
Views
766
Hey Guys, I have a pair of machines that we are converting from potentiometer speed control to PLC control with an analog output card. PLC is a...
Replies
6
Views
3,815
I keep getting the following error message when I build my project.{Elementary Variables} : The topological variable is incorrect I'm not sure...
Replies
4
Views
2,170
Back
Top Bottom