Sign in to follow this  
Followers 0
David Nelson

electric vehicle help

4 posts in this topic

I have a EV project i have been playing with for a little over a year now, but now comes the time when i need to start wiring for my plc. (yes i said plc) I have a compact logix and a panelview 700 to put in but i am new to both of these. what i need to know is this. what cards do i need to monitor dc voltage from 12 to 50 volts with a compact logix? is it possible? my plc is just a processor and 1 input and 1 output card. money is very tight as of lately so my purchasing has stopped for now but i would like to get an idea of what i need to get later. any help or cool ideas to use it for is appreciated

Share this post


Link to post
Share on other sites
You'll need an analog card. And since you voltage range is well outside the "typical" range of +/-10 volts, you've either got to provide a voltage divider or look for a different card. A voltage divider will just be a pair of resistors connected in series to ground (several kilohms) with the analog input tied to the junction between the two resistors. The voltage will be V=V*(R1/R1+R2). Remember that the analog input has some resistance too so be sure that your resistors are at least 10 times smaller than the input card resistance or else it will interfere with your divider circuit. Alternatively you can use the resistance of the analog card AS the second resistor, providing for the most simple circuit (put a resistor in series with it). That's if you go for an analog card. Most of the time industrially you'd use a 4-20mA input card and get a converter rather than messing around with voltage inputs because voltage inputs normally have all kinds of calibration concerns. This works but as you've probably already determined, all the analog cards I can suggest are pretty expensive. If you want an analog card and you are not willing to pay AB's prices for them, then it depends if you have a free Ethernet port or a free serial port, with serial being the lower cost approach. If you have an Ethernet port, I can highly recommend www.acromag.com. They have some of the lowest cost analog and digital I/O cards available and handily beat AB as well on performance (far less noisy). Prices are online. If you have a free serial port, then you have a couple choices. Either way, go shopping for serial data acquisition from www.bb-elec.com. If you go with the "custom" approach, they have a couple analog cards for about $75-$100. If you want to go with standards, then use Modbus/RTU. Download the free implementation of Modbus/RTU from Rockwell's sample code database. Then use Advantech's ADAM cards. That's just about it for the "standard" solutions. What follows below are the nonstandard ones. They are about the same cost, but you won't have to tie up either an Ethernet or serial port. And depending on how you do things, your experience and skills, and what you have laying around, you might be able to do this for under $25-$50. The other approaches are pulse frequency modulation, pulse width modulation, or using a microcontroller to talk over the digital I/O. The advantage here is that you can just use one of the inputs on your I/O card. The downside is that you've got to be careful about timing and timing jitter since you just jettisoned all the nice formatting that comes with a direct digital interface. However, we're talking on the cheap here. How you would use this is that you will have a "voltage to frequency" or "voltage to pulse width" converter circuit attached to one of your digital inputs. On the software side, you either need to use a high resolution timer to measure the pulse width, or else use a timer and count the number of pulses to convert the signal back into an analog value. How well you do this step controls what kind of resolution and noise you get from this sort of implementation. I suggest you implement the code in a seperate timed task (perhaps even a triggered task) since otherwise your performance will be a variable that is dependent on scan rates, unless you make the whole system so slow that scan rates are simply a non-issue. As to the voltage-to-frequency/pulse width converter, the cheapest approach I can think of is the good old 555 timer. If you google "pulse width modulation 555", you are going to get dozens and I do mean dozens of hits. There are plenty of example circuits out there showing you how to make this work. The 555 timer is very old, very well known, and very versatile depending on how you wire up it's 8 little pins. This little chip has been around doing this kind of thing since it was first designed back in the 1970's. The microcontroller approach is to essentially build a poor-man's analog I/O card. Here are some examples of what is available in the microcontroller world: http://www.nanocore12.com/ http://www.parallax.com/ http://en.wikipedia.org/wiki/BASIC_Stamp http://www.microchip.com/stellent/idcplg?I...amp;nodeId=2551 http://www.micromint.com/ It is easily possible to get a low end microcontroller for under $100, even assembled onto a board that could do what you want , even without the PLC. They can be programmed in a variety of languages (everything except ladder logic). These are usually the processors of choice for folks doing stuff with hobbyist work including robotics and electric vehicles. Typically other than for interfacing to a drive, you wouldn't be using a PLC in an electric vehicle in the first place. You can easily set a microcontroller up to speak Modbus or an ASCII protocol via a serial port but we're not interested in that. You can also handle any manner of handshaking via the I/O cards you already have. For instance, you could use 2 outputs and one input to transfer data digitally. One output is "reset" and the other is "pulse". Program the microcontroller to collect the input data into an integer and a counter. Whenever it sees a 1 on the reset line, clear the counter and reach the analog input. Then every time it sees a 0-to-1 transition on the "pulse" line, increment the counter. The input bit to the PLC (output on the microcontroller side) is set with the bit position in the analog value. So on the PLC side, to read a value, you pulse the reset bit. Then pulse the "pulse" bit and read the bits on the input line one at a time until you've read the entire integer from the microcontroller. I suggest you download the manuals for the BASIC stamps at a minimum. Those little books are amazing. They give you dozens of examples of how to do various things with them. Theoretically you could also do the same thing with an FPGA. I'd only suggest that if you are extremely comfortable with Verilog or VHDL and mixed signal design. If you are, then you wouldn't be asking the question. Unless you are using an analog input card or a microcontroller board that has lots of on-board creature comforts, you are going to have to do some circuit construction. I can suggest three simple approaches if you haven't done this kind of thing before. First, there are spring-loaded bread boards available. They look like this: http://www2.tech.purdue.edu/at/courses/aem.../breadboard.jpg The downside is that some of those prototype boards don't hold up well to vibration over time. The second technique is called wire wrapping. http://en.wikipedia.org/wiki/Wire_wrap It's great for those who know nothing about soldering. You can make extremely dense circuits this way and it is highly useful for non-RF permanent one-off's and prototypes. It is much less trouble than a circuit board and the tools are simply a piece of fiberglass board with punched holes, a spool of wire wrap wire, and a simple wire wrap tool (which should be <$10 even for a good one). You also need specialized wire wrap sockets for every component because you can only wire wrap onto square shaped pins. Back in the 1960's and even the 1970's, this is exactly the technique that was used to assemble many very large digital logic (computer) circuits that were single-use. This is probably mechanically the strongest and most reliable system that you can get for what you are trying to do, but it can be almost as expensive as the prototype boards. The third technique is "dead bugs". This works fine for the size circuit you need. See the pictures on this web page for an illustration of the dead bug technique: http://qwiki.stanford.edu/wiki/High_Freque...Op_Amp_Circuits Be forewarned: you must be an expert with a soldering iron and I highly recommend getting a tube of eutectic solder if you want to use dead bugs. The good part is that you can probably build it out of just the stuff you have laying around with no special parts or anything, which also keeps the cost very, very low. I wouldn't even bother buying a copper or fiberglass board...any handy piece of metal or plastic will do, even an existing surface in your equipment! The bad part is that dead bugs are relatively fragile...they squash easily :). All of the components and tools you will need can be bought from www.newark.com, www.mouser.com, or www.digikey.com. I have used all 3 interchangeably but for this type of product, I'd lean towards Digi-Key or Mouser (and I really dislike Newark's catalogs).

Share this post


Link to post
Share on other sites
Thank You Paulengr, that is a wealth of info i will be checking into all of the tips to see which may work best as well as be the cheapest. i will update as i go. thank you again

Share this post


Link to post
Share on other sites
Dave As an EV guy myself let me see if we can start off with basics. 1. What kind of car truck - weight etc 2. What do you want it to do - pull stumps drive in neighborhood, city street and freeway, drag race etc 3. What is the motor type and nameplate HP RPM etc 4. What are you using for controller 5. Battery voltage is really 50? I wonder if you are getting overly complicated with controls and display. PLC may be a good thing depending on how much you want to control and how complex your system is. I know it is easy to make things too complicated - tend to do it myself - dang I get tired of discipline and self control. Mine is gonna be 56 Chev pickup 5,00 GVW AC 3 phase 3550 RPM 50 HP motor, probably Hitachi SJ 300 VFD vector drive, 325 V lead acid. Dan Bentler

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0