# PLC/HMI Balancer & Emeter Design Thread



## jaspersk (Jun 26, 2008)

I have thought about this some more and I think I have a method that would work and only require one digital output card (versus 2-4 I listed in my first post). I have asked Lee via EVDL to look at it and also posted it on Automation Direct forum to see if it would work. 









One weakness would be that the resolution of the first battery would be 6/4096 but the resolution of the last battery would be 120/4096 or 0.03V. It would be smarter to have the common in the middle of the pack and source one way and sink the other. This would provide a measurement resolution of 0.015V. Splitting hairs?


----------



## jaspersk (Jun 26, 2008)

I have taken another crack at it. Let me know what you think?










I am double posting here and EVDL. Is that against forum rules or am I OK?


----------



## jaspersk (Jun 26, 2008)

No responses but looks like lots of people are watching this thread so I'll just keep replying to myself. 

I decided I was making things too difficult for myself trying to use solid state. I am going to keep it simple. I made a purchase so I am committed now. See bill of material below. I got it all for $325. Gotta love Ebay.

I have 4 isolated analog inputs. Two will be dedicated to continuous pack voltage and current measurement. I have 24 isolated relays that will be used to feed individual batteries to the other two analog inputs. I was planning to buy a fancy graphic display. The same person I bought all my stuff from had a $30 4 line, 20 character display so I decided it would be smart to start small. I'll add a 5A DC/DC which will be used to automatically charge the lowest battery and keep everything in balance.

It should be a few weeks before I get anything built, programmed and tested. Hopefully, I'll post some success here by the end of the month.

Ebay Automation Direct Price Description
380113198586 D4-440 $79 CPU
380113076810 D4-08B $19 8 Slot Rack
250414720580 F4-08TRS2 $39X3 8 Point Isolated Relay cards
380112125559 F4-04ADS $79 4 point isolated Analog in
380111885892 Display $30 4 line 20 char display


----------



## ftaffy (Mar 13, 2009)

Looks good, have to admit its a little outside the scope of my knowledge but will follow with interest as i am currently crash coursing myself in an attempt to understand how to feed battery etc information into a computer... no going well. Will watch your thread with interest!


----------



## Dennis (Feb 25, 2008)

Using PLC's is a very good idea both in ease of program ability that even a non-programmer can program a PLC with simple ladder logic and proven reliability in the industrial environment.

In fact a VERY good book on PLC's and programming is: _Programmable Logic Controllers_ by Frank D. Petruzella. ISBN-13: 978-0-07-829852-3


----------



## Dave Koller (Nov 15, 2008)

Ok keep going! I am doing a similar route but right now am knee-deep in motor mounts, and welding lol


----------



## jaspersk (Jun 26, 2008)

Dave Koller said:


> Ok keep going! I am doing a similar route but right now am knee-deep in motor mounts, and welding lol


Cool. Someone to talk with! I have my PLC up and running on the bench. Unfortunately, I am a little time constrained so I haven't started programming it yet. My significant other had a discussion with me last week that started with "I have had enough of the car!"  I think I haven't been giving my family the attention they deserve so I need to back off of the car project a little bit. 

My next two weekends are booked but I hope to have it up and going the first week of June. My only big concern at this point is how the PLC inputs will respond to the noise on the line but they have a lot of isolation in them so I am hoping it won't be an issue. I bid on a 6" color HMI on Ebay but lost. That isn't so bad though because I think I want long-term to get one of the carputers with the media and everything else on them that someone else on here has been working on. For now, I have a $30 4 line display that I will use.


----------



## Dave Koller (Nov 15, 2008)

jaspersk said:


> Cool. Someone to talk with! I have my PLC up and running on the bench. Unfortunately, I am a little time constrained so I haven't started programming it yet. My significant other had a discussion with me last week that started with "I have had enough of the car!"  I think I haven't been giving my family the attention they deserve so I need to back off of the car project a little bit.
> 
> My next two weekends are booked but I hope to have it up and going the first week of June. My only big concern at this point is how the PLC inputs will respond to the noise on the line but they have a lot of isolation in them so I am hoping it won't be an issue. I bid on a 6" color HMI on Ebay but lost. That isn't so bad though because I think I want long-term to get one of the carputers with the media and everything else on them that someone else on here has been working on. For now, I have a $30 4 line display that I will use.


WE ALL have the "look" once in a while about the "car" ! Anyway I am using an Arduino to do all that with opto-isoators - and trying to eliminate the PCM - I have a similar thread here somewhere.. Search for it as no one answers me also..... 
Dave


----------



## Wattmotion (Sep 10, 2008)

I read your thread Dave about the Arduino and wanted to go that route but chose a PLC since I have the background. I am using a Unitronics 350 PLC display combo. Easy to program and very inexpensive. I have a shot of it here: http://www.wattmotion.com/html/instrumentation.html

The only down side is the screen is only about 2"x3" but I figured once I perfect the unit I'll upgrade to a larger screen. I have 12 batteries now but will be upgrading to 24 so the relay or analog input route is expensive and messy. I am working out a step mulitplexer or sequencer that scans each battery in mS as Jaspersk mentioned. 

The PLC will pages to display speed, rpm, battery charge / disharge trends, or just about anything else one can dream up. As far as battery charge management, I'm going with shunt regulators over each battery with feedback (optoisolated) back to the PLC.


----------



## jaspersk (Jun 26, 2008)

Wattmotion said:


> the relay or analog input route is expensive and messy. I am working out a step mulitplexer or sequencer that scans each battery in mS as Jaspersk mentioned.


I would be interested in the details once you get this figured out. I am using relays to start with because I need them to do individual charging (rather than shunt regulators). However, I'd still like to have quicker readings so let me know how that works out for you. I didn't have a good feeling how to multiplex using solid state switching into a solid state input. I wasn't sure if I'd get accurate readings with leakage current and voltage drop across the multiplexer.


----------



## Wattmotion (Sep 10, 2008)

I have some concerns with voltage drops as well and building the first one with DIP relays since the current will be almost nothing. 
So you are using the relays to regulate charge as well as monitor? Are you building a system similar to Lee Hart's with a PLC?


----------



## aeroscott (Jan 5, 2008)

Iv'e been watching with interest . Over my head at this point . I'll be doing my junk yard run this AM . found a couple of PLC's so far . I just don't know what I'm looking at most of the time . Some have said PLC's were over kill . I like over kill . Is the cell tower equipment using AD's ? It's all shielded big bucks stuff . I run across lot of industrial control , mostly older relays , medical X Ray , MRI , mail handling , some newer stuff . can you point me in the right direction . unlimited (at a $1.00 / pound ) sounds like it would be 100 channel isulated and shielded AD for 100 cell lithium pack . Thanks for the great work . I said AD is that wright ?


----------



## jaspersk (Jun 26, 2008)

Wattmotion said:


> I have some concerns with voltage drops as well and building the first one with DIP relays since the current will be almost nothing.
> So you are using the relays to regulate charge as well as monitor? Are you building a system similar to Lee Hart's with a PLC?


My starting place is to build the exact functionality of the Lee Hart battery balancer but with hardware I understand.


----------



## jaspersk (Jun 26, 2008)

aeroscott said:


> Iv'e been watching with interest . Over my head at this point . I'll be doing my junk yard run this AM . found a couple of PLC's so far . I just don't know what I'm looking at most of the time . Some have said PLC's were over kill . I like over kill . Is the cell tower equipment using AD's ? It's all shielded big bucks stuff . I run across lot of industrial control , mostly older relays , medical X Ray , MRI , mail handling , some newer stuff . can you point me in the right direction . unlimited (at a $1.00 / pound ) sounds like it would be 100 channel isulated and shielded AD for 100 cell lithium pack . Thanks for the great work . I said AD is that wright ?


If I had access to an industrial controls junkyard or price was no option, I'd figure out how to have an isolated analog input for every battery. 

I have no idea what they use in cell towers but it would surprise me if it was an industrial PLC. I also don't think you'd find it in any medical x-ray or MRI equipoment. Mail handling, maybe.


----------



## aeroscott (Jan 5, 2008)

I found one in A mail handling machine . now i need get A idea of what these isolated inputs look like .Also found out the old cell towers were analog to digital the new ones are digital .


----------



## jaspersk (Jun 26, 2008)

aeroscott said:


> I found one in A mail handling machine . now i need get A idea of what these isolated inputs look like .


If you are not sure what you are looking for, I don't think you will find it. What type of PLC are you hoping to use? Rockwell or Allen-Bradley would probably be the most prevalent. Depending on which type of PLC you find, there are different card numbers associated with different PLC systems.


----------



## aeroscott (Jan 5, 2008)

I think it is Mitsubishi , it's a pretty common one on ebay . But lots of Seamons , Idec izumi , Emerson from cell tower bms . Bradly , Allis Chambers , Square D, I'm seeing newer stuff as companys down size or close . lots of opto islator's . solid state relays are rare in dc outputs but i find them . I've started to Google searh , lots of time needs to spent .


----------



## Wattmotion (Sep 10, 2008)

Remember that any PLC you buy will require programming software. Allen Bradley, Siemens, and all the big brands have expensive software, usually starting at over $1000 a copy. Some of your smaller compact brands such as Unitronics or Koyo give you the software or charge a small nominal fee. If you're not in that industry where you have access to the software tools, your best bet would be to look at the smaller units.


----------



## aeroscott (Jan 5, 2008)

very good point !


----------



## Lordwacky (Jan 28, 2009)

Hi guys I'm just starting my build but I'm loving this conversation. I want to do something similar in my build. I want to track various parameters and dump them all into a data logger, and or display for realtime viewing. I personally was thinking about just using a net book or integrated carputer connect to a few DAQs. Using some VB code. I don't have a lot of experience but it seems to me that more full fledged computer/daq system would be more scalable and only slightly more expensive then the PLC route (netbooks are less then 300 these days). Any thoughts?

thanks
Mike


----------



## Wattmotion (Sep 10, 2008)

Lordwacky said:


> using a net book or integrated carputer connect to a few DAQs. Using some VB code.


I've done some data collecting using a computer, DAQ modules and a little software. You're right it is more expensive, namely the cost of the DAQ modules. I have also found that if the computer isn't industrial built, a notebook bolted in a car will more than likely fail from the vibrations. PLC's are made for industrial use, the rough enviroment. I think you would be further ahead but using an integral PLC / display unit in cost and durability.


----------



## jaspersk (Jun 26, 2008)

For you guys looking at data acquisition, a friend of mine sent me some helpful links:

http://www.weedtech.com/ Nice Data Acquisition System

http://www.labjack.com/labjack_u12.php DAQ system

http://fusioncontrolcentre.com/FusionStore//catalog/faq_help.php - Good site on computer/physical controls integrations.

http://www.phidgets.com/products.php?product_id=1117 – Voltage Sensor for use with their interface kit/boards. The boards have relay outputs with USB interface, used with a conventional pc instead of a plc. Like this one. http://www.littlepc.com/products_fanless.htm 

http://www.hallsensors.de/CYHCS-OL-RW.htm


----------



## Lordwacky (Jan 28, 2009)

Awesome links thanks a lot!


----------



## Wattmotion (Sep 10, 2008)

yes, thanks for the info on DAC modules, this makes them a little more affordable. I also ran across this link for some VB code and using an Allen Bradley DF1 protocol. Look up any of the videos from _arj3090_. Here is the link to one of them: http://www.youtube.com/watch?v=CiPzqc5jDlE

I have an AB 500 that I have thought about using in an EV but did want to spend the money for some expensive display.


----------



## eRev (Jan 10, 2009)

The contents of this thread parallels my efforts for designing in a supervisor computer to monitor, effect run parameters and provide data logging for my EV.

I chose to go with Galil Motion's RIO PLC primarily because it has all the digital and analog I/O capability needed, it is industrial grade with opto-isolation, it is small, it has Ethernet connectivity (for PC data dump) and is smoken fast to handle real-time events.

The only short-coming is that DC power input is 16-30 volts (or there-abouts). Galil is actively working on a 12VDC variant which should be available soon.

Anyway, for under $400 it has promise. Programming wise, the command set is a bit cryptic, but managable given its strengths. Here's a link: http://www.galilmc.com/products/rio-47xxx.php


----------



## Wattmotion (Sep 10, 2008)

I like this size and amount of analog inputs on this unit. The 24vdc input can be fixed with a small DC to DC converter. The only downside I see is there is no simple interface to display data real time. You would have to write some VB on another computer and then provide a display. I really think this Unitronic unit is the way to go, it has the color HMI screen built into the PLC. It has digital and analog I/O, serial, SD card, optional ethernet, optional cell phone connection, modbus and the software is free. I am doing a project now using them and the software is great to use since you can jump between the ladder and the HMI configuation all in the same software window. I have a 350 model now for my EV but I am thinking about upgrading to the 750 which has a larger screen. Here is where I buy mine here in Toledo:
http://www.ampsic.com/products-services-plc-hmi-programming.php


----------



## kittydog42 (Sep 18, 2007)

I have a lot of experience with PLC's and HMI's of many different brands. I specifically have Automation Direct software for both their DL series PLC's and C-More Micro HMI's. I would be happy to help you with programming. I think the idea is good.


----------



## jaspersk (Jun 26, 2008)

Just an update. I have the PLC up and running in the car with an Optimate 4 line display in the dash. It is reading out amps and voltage. I still need to write an algorithm for state of charge. Any recommendations? 

The one small adjustment I had to make from the original plan is that I had trouble reading out voltage directly into the 0-5 input card. The voltage would not match Fluke readings when drawing current from the Pak. I decided to use some signal isolators and now everything is happy. I got each of these for around $25 on Ebay. The first one takes 0-50 mV from my shunt and converts it to 4-20mA for input to the PLC. The second converts 0-200 VDC into 4-20 mA for pack voltage.


















The next job is to get the balancer in place so I am monitoring voltage on each battery and charging the lowest. I have been side tracked for a few weeks while I work on installing a battery charger built from a DC drive.


----------



## kittydog42 (Sep 18, 2007)

With all those DIN rail mounted and industrial components, you will need a UL508 sticker on your car when you are done!

Finding those signal converters for $25 each was good, because normally, such devices would likely cost over $200 each. That is probably the main reason not to use a PLC/HMI combination - it tends to be expensive, but you may be able to mitigate that if you can get the balancing function to work with a minimal hardware cost. That will be your break-even point, as I see it. 

Of course, I still have these grand plans to make a car from all industrial components one day...AC motor, VFD, PLC, the whole works. It will probably be a waste of money, but fun nonetheless. Like an Erector set on wheels!


----------



## jaspersk (Jun 26, 2008)

A sent a co-worker of mine some pictures of the car because he was interested in what I was doing. He reply was very short: "110.12" That is a reference to code which reads: "Electrical equipment shall be installed in a neat and workmanlike manner."  To date, the NEC covers eletrical vehicle charging stations but it doesn't cover vehicles or I might be in trouble. 

My original plan was to develop a plan that could be duplicated by others and easily beat the price of other 'off-the-shelf' solutions. Unfortunatley, the only way I can make the project successful is by depending on Ebay deals. That means no one will be able to copy it verbatim but hopefully for industrial control folks like ourselves, we can at least learn what is possible. I'll post some details about my DC drive battery charger once I get that completed. I believe strongly that is a GREAT deal for anyone that has basic knowledge of drives. I'll have a charger that can take 115 or 230V input, 97% efficient, and can output 2-25 amps all for about $250. That is Ebay pricing again but the drive is the only unique part. The other parts are just a shunt, a voltage alarm, and an inductor.


----------



## kittydog42 (Sep 18, 2007)

The charger may be another story. AC drives are not that expensive. What HP drive are you using for your charger?


----------



## jaspersk (Jun 26, 2008)

kittydog42 said:


> The charger may be another story. AC drives are not that expensive. What HP drive are you using for your charger?


I am using a 3HP FlekPak Plus for charging so I am expecting it will output 15 amps. It is an older Reliance DC drive. I got it for $65 plus $10 for shipping. It had never been used. 

I wanted to do a VFD on the main drive motor but couldn't find something that I was familiar with that had a common DC bus voltage low enough to run off batteries. Plus those are a little harder to find cheap on Ebay unlike the DC drive for a charger. I gave up and decided to go with a Zilla. Not as fun or challenging as diy with a VFD but not a bad choice either.


----------



## rafaelMankilla (Oct 29, 2010)

Hey i just jumped into this and seems super interesting someon had mentioned their screen was to small. Here is a cheap HMI that might help http://www.anaheimautomation.com/pr...item.php?sID=347&serID=2&pt=i&tID=998&cID=414


----------

