PDA

View Full Version : Another Controller Design - an evolution



new2lights
12-04-2009, 09:40 AM
This project started 3 years ago. I bought a several plc components from a scrap dealer. The components communicated over devicenet from a plc. The outputs to the lights were isolated relay contacts outputs.

At the time, I had no idea that DIYC existed, I just new that people controlled their Christmas lights and I wanted to do it to.

1st year -
I wrote a programming and communications program in all things in excel using VBA. The excel spreadsheet would download part of the sequence (using GE SNP over serial port) to the plc controller (controller could not hold all of it), load the song into windows media player and tell the plc to go. That year all I had was 32 (on-off) channels and 3 songs.
I modified a mp3 car transmitter to play the music for people to listen to in their cars.

Brian W.

new2lights
12-04-2009, 09:53 AM
2nd year

I made another 32 channel enclosure (in October). Bringing the total channels to 64. It became painfully obvious that excel vba dialog boxes could not keep up with 64 channels when programming the sequences.

At this time I decided to write the programming software in VB.net and have the program export the sequence to a csv file for the excel program to communicate to the plc.

The show went to 5 songs.

In the middle of December, a problem started rearing its ugly head. The devicenet relay cards had met their cycle life (approx 750000 cycles). The channels would stick on and finally turn loose about 2 seconds after it was supposed to turn off. Then the channels just started failing on completely. I knew this problem was a possibility but I was in denial when I thought about it.

I knew this was the last year for these controllers and I wanted dimming capabilities.

new2lights
12-04-2009, 10:24 AM
Starting in April, I took a dimming light switch apart and figured out how it worked. I stayed away from other peoples designs (which btw are awesome on this site) because I wanted to get back into design work. I have never designed a PCB either.

In college I had a senior level class on the Motorolla 68HC11 microcontroller with various projects all written in assembly. The same year I had a networking class in all things MAP (outdated protocol at the time). So thinking about my controller, I really wanted to learn IP better because I use it extensively at work with AB Controllogix PLC's and this controller can be a great learning experience.

Searching the internet, I found that Rabbit had a wireless microprocessor and developement board for $79 (RCM5400W) so I bought one and began my PCB and software design.

In May, my plant where I work at in Spring Hill, TN was on the chopping block so I didn't pursue the design anymore because I didn't know if I would have a job or when it could end (no money) and I couldn't justify doing this if I didn't have a job.

This summer they announced the idling of the plant but I found out I had a job until the end of December. So after discussing it with my wife, we decided to go ahead with the project. This was at the end of August. So I started back again. I worked on the dimming circuit and used the design on DIYC. I have a great respect for all the designers here!!!! My circuit was a little more complex with snubbing. I set out to design the PCB board. I thought I was done when something in my head said to ask P. Short to take a quick look at the design. In his graciousness, he did and he had great constructive comments on the design. So back to redesign of the PCB. (I'm up to about 50 revisions on the PCB it seemed).

I chose all the components on the board and bought enough components to test with the rabbit. The rabbit is programmed in a quasi-C program and assembly. The rabbit's instruction set is a lot more extensive than the 68HC11 and it was fun to program. The design worked with minor tweeks.

I finally got the PCB's made at the end of October and ordered all of the components to complete 3 controllers. What a nerve racking experience. If I made a mistake on the PCB's as someone here has said, I would have some really expensive coasters. I have never really soldered anything of this magnitude before either. Software it easy to fix, but this hardware stuff is not so easily fixed and a huge unknown to me.

I have not even written the pc communications, scheduling, etc yet and it is the beginning of November.

Continued in next post...

new2lights
12-04-2009, 10:55 AM
I made the controllers and set out to test them (note 5 nights of soldering).
I tested each part of the circuit -


3.3 v 1.5 amp power circuit - it worked - whew been a long time since analog class (which I hated in college)
zero cross circuit - worked
all of the optoisolators and triacs - worked - amazed that there were not any shorts
connected controller - didn't work!!! - shorted out 3.3v ps circuit - after a huge panic attack and being calmed down by my wife, determined that the rows were swapped on the controller pinout -WHAT A STUPID MISTAKE - No one makes a readily available reversing cable at that small of a pitch. So I had to design another board to swap the rows (upper left hand corner of the picture.)
connected controller again with new board - SUCCESS
have not tested DMX in/out circuits yet - upper right hand corner


Back to programming the software. I started using TCP/IP sockets - the program worked great - lights dimmed, blinked, etc. However if the controller lost comm's to PC, it took too long to get connection back sometimes. Great learning experience but it is Nov. 15th and I have to get this working. I have not even written scheduling part yet.

I have now swapped to UDP - recovers better from comm problems - I now have it communicating pretty good. Finish scheduling software on last Saturday night.

The software is now communicating with 2 controllers out in the yard using wifi network. I am still using last years sequences and have noticed that these controllers are much faster that the relay modules and some sequences look different - you can see real fast blinking (the song time period is 50 ms).

I am still tweaking some of the VB program because the standard timers in vb are not easily set up for this fast of communications and I have to watch out for virus system updates.

This has been a great learning experience and it has given me a great respect for everything you guys do here (hardware and vixen). I also have to thank my wife who has put up with me during this (non stop every night since the beginning of Oct.) and my panic attacks. I have to apologize to my parents and in-laws for programming all thanksgiving. BTW my own Mom called me nerd by the end of the holiday.

The picture of the controller is in the enclosure used from the relay controller used in previous years. It controls 32 channels.
Note that I also noticed the thread on the plugable connectors - this controller uses them because I have used them at work and I wanted ease of wiring. I prefer the type that have screws that attach to board connector, but I could not find them on mouser at the time. These stay plugged in well and made wiring a breeze.

Brian

Trip
12-04-2009, 11:59 AM
awesome evolution, wish I had the motivation to attempt something on that level

dirknerkle
12-04-2009, 04:00 PM
Excellent work -- and in the true DIYC spirit!!!

Do you have a name in mind for this new controller system???

new2lights
12-04-2009, 06:16 PM
Excellent work -- and in the true DIYC spirit!!!

Do you have a name in mind for this new controller system???

I am nicknaming all of it Sparky - in honor of my favorite character in my favorite Christmas movie. I know how he felt with his lights...:p