RS Logix500 - Astronomical clock

How about a look up table that you populate once based on data for your target area?


The LIM block you are using can refer to different points (indirect addressing) in the table, maybe 52 entries, one for each week in the year? But then you have to calculate that value...Or just 12, one for each month since the month can be directly referenced in the status file.
 
o_O


http://www.plctalk.net/qanda/showpost.php?p=152343&postcount=5



What you need is a pseudo Julian date calculator (see link above). This will calculate the day of the year, eg 1-365 - its not necessary to calculate the full julian date, the the year day.

Divide the result by 2, and use that to index into four look up tables: sunrise hour, sunrise minute, sunset hour, sunset minute.
The lookup tables change the sunrise and sunset time every other day (hence the divide by 2) (every other day because the lookup table size is limited to 256 words.) You can google the local sunrise/sunset times to find the values to populate your table.


eidt to add: I recommend you not mess with daylight savings time and use standard time tables and leave the PLC on standard time year round.

But I have to ask, why are you using a PLC? There are commercial products that can do this for you.

Also, here is your time table from US Naval observatory web site:
 
Last edited:
Syncing

While you can calculate or use a lookup table for the exact value, no one has mentioned perhaps the largest variable. Most PLCs don't keep clock time all that well. If you will be doing this without a light sensor, you will probably need some method of syncing the clock time to an external standard if you don't already have one.
 
Not being able to turn down a challenge, and since I had some time to kill while waiting for Miss America (aka daughter) to finish dance classes this evening, I downlaoded the local sunrise and sunset times into Excel and used a macro to create four tables that I then exported as text files and then combined into a file with a .SLC extension so it could be imported as a library file to create and fill data tables N101, N102, N103, and N104 (included so you can see how its formated). The four tables show sunrise hour, sunrise minute, sunset hour, sunset minute for every other day of the year for my location. The times will vary depending on where you live. Get times for your location at http://aa.usno.navy.mil/data/docs/RS_OneYear.php

Then, using the julian date routine from the earlier post and adapting it for a MicroLogix 1100, I built this quick and dirty program that should work for turning lights on approximately ten minutes after sunset until approximately ten minutes before sunrise. (I didn't test it, banged it out in a hurry, and make no warranties)

With the ML1100 the date/time can be set using the keypad on the front of the PLC.
 
Hello

I did this with an AB PICO in several car dealers lots. It has a ton of 7-day clocks in it and the timers and counters. I basically set it up for the 4 seasons with months. This replaced a 4 chanell electronic clock. One of the lots has an expensive astro-dial I installed when it was new 7 years ago. I have not touched it since then.

Leon
 
Why Re-invent the wheel

There are many companies that sell ATC (astronomical time clock) controls for lighting. I installed one of these in a previous job I had.

To answer some questions on why don't you just use a photocell, the simple answer was money. We had a parking lot for contractors that were on a 12 hour shift (7 to 7). The ATC would turn on the lights at 5:30 am then off at dawn, then turn them back on at 30 min before dusk and off at 8:30 pm. Didn't turn them on at all on the weekends when no one was working. The money savings was well worth it. These relays (clocks) cost about $125 (that was 10 years ago) and installed on the lighting contactor controls. Programming was in minutes as was as simple as when on and when off.

Even though it is neat to do this with a PLC, I would probably choose a commercially available product for this kind of installation. If there are any changes in the future, then that would cause someone to have to edit the ladder logic in the plc, but if you had a off the shelf item, then the customer could easily push a couple of buttons to change how it operates.

By the time you add a couple of relays, output card and wiring, you could probably buy this thing.
 
Last edited:

Similar Topics

Hello everybody! I've managed to get the astronomical clock algorithm so I've implemented it in RSLogix 500, but I have a "math" problem: I have...
Replies
1
Views
2,175
So basically i have 2 queries : 1. I have a program file of S7-300 PLC which i want to migrate in RSLogix500.In short i want to convert my simatic...
Replies
15
Views
252
I've got a Micrologix 1100 with ethernet and I'm trying to configure communications to a Fanuc R30iB controller. I'm pretty sure you have to set...
Replies
0
Views
109
So here's my situation, I have been tasked with modifying the logic to mimic a button press in the PLC. I have two identical machines however one...
Replies
6
Views
548
Hello, I'm new to programming. I'm using RSLogix500 to modify an existing program for a SLC500. My plan was to use one of the existing inputs...
Replies
26
Views
2,010
Back
Top Bottom