Sunday, August 24, 2008

Motor RPM sensor

Now we'll build a sensor for detecting the RPM of the motor. This number is important for safety of the motor, efficient when driving, and most importantly my power steering needs this value. Sure I could just spoof a number to make it happy but would much rather have the real value and display it on the original tachometer.

First off the sensor we will be using is a Melexis 90217 Hall-Effect Sensor. This is really a great sensor. It auto calibrates itself depending on the seen variations in magnetic fields and has a built in ADC. The sensor can be used in a few ways but in this case it seems easier to use the gear tooth pickup feature. Basically you can add a magnet to one side of the sensor and then by running metal past the sensor on the other side causes the magnetic field to pass through the sensor. As each tooth passes by it detects the tooth. Take the total count for a given period of time and divide that by your number of teeth and then convert that time frame to minutes for your RPM!

I picked up a few supplies from a local Tractor Supply and of course hardware store. I found a keyed collar that was 3/4" (secondary output shaft). I also found a 3/4" gear which I figured I could use. They also had the 1/4"x1" key I needed to lock the collar to the motor shaft. I also picked up a plastic spacer. I needed something to house the sensor that wasn't a material the magnetic force would be affected by. The long black thing is just some heat shrinking tubing.

I put some heat shrink tubing around the magnet so that the pins of the sensor wouldn't short out across it. Next I hot glued the sensor to the magnet.

The sensor and magnet were then placed inside the plastic collar and hot glued into place. The connector is attached to the sensor.

Here is a top view. You can see the sensor embedded in the spacer and hot glue.

Next I put a layer of heat shrink tubing around the whole thing (blue) followed by a few wraps of electrical tape. The sensor is ready.

Now we needed something to mount the sensor to that could be mounted to the motor. Again to avoid interfering with the magnetic field I choose an aluminum square tubing. It's easy to work with and doesn't need to be strong to only hold the sensor. It also allowed for the sensor and wire to be enclosed even further. I cut an oblong mounting hole so that it could be precisely adjusted above the gear if needed.

Here is the completed sensor assembly. It was a snug fit into the tubing but I added some extra electrical tap anyway.

I welded the gear to the collar and painted them to protect the steel from the elements. Not bad!

Here is the gear and sensor mounted to the motor. When I'm doing the final wiring I will protect the sensor wires in a loom. Right now I have a few extra washers bring the sensor out far enough. Later this will be replaced with the mount for my AC compressor.

Here is a picture of my setup testing the RPM sensor. Make sure you never apply more than 12 volts on this motor unless it's under load. You can seriously hurt the motor and yourself.

Here is the output from my debugger. I'm doing a 250ms sample in this test so my number needs to be multiplied by 240 to get RPM. If I was doing a 1000ms, or 1 second, sample I would multiply by 60. In addition I have 12 teeth on the gear so the number must be divided by 12.
98 * 240 / 12 = 1960.

In the final project a variance of the pulses, not RPM will be sent to the gauge and EPS unit. I think it was something like four pulses / revolution. I'll have to do some testing and compare my debugger numbers to the gauge to calibrate that.

Motor temperature sensor

The FB1-4001 from Advanced DC motors is far from having all the bells and whistles you'd hope for. In fact the only sensor it has is an on/off over heat sensor that is open until the temperature has risen too high in which case the circuit closes. This is great for a dummy light or buzzer but for those of us who want real numbers all the time you'll have to make your own.

I found a large bolt hole that I think was used to hoist the motor into the crate. It's a 5/16 course thread and looked like a good spot to mount the sensor. I bought a 1" 5/16 bolt, washer and a nut. The reason for the nut is so that I can shorten the bolt and then remove the nut which helps to clean up the threads after cutting them.

After cutting the bolt I drilled a hole down the center of the bolt. The sensor will be installed here later.

The sensor is a LM34 from National Semiconductor. There are quite a few ways to use this little guy depending on the temperature range you need. I'm just using the basic setup which allows for 5-300 degrees Fahrenheit. Each degree will change the output signal by 10mV. Then by using an analog to digital converter (ADC) you can get a nice digital readout of the temperature. Below is the sensor after connecting it to three wires and heat shrinking them so they can't touch.

Next I wrapped the whole thing in another heath shrink layer to hold it all together.

We are now ready to mount the sensor so I mixed up some JB weld.

I filled the hole with JB Weld and then inserted the sensor.

The other side of the sensor after JB Weld.

After it dried I applied a coat of paint. This is a steel bolt and will rust if not protected.

Finally here is a shot of the new sensor installed in the motor. Later when finalizing the wiring during install I will protect the exposed sensor wires in a wiring loom.

Here is the output from my debug terminal. I tried running the motor for awhile but with no load and only 12 volts going through it the temperature didn't rise. I did take the sensor and set it in direct sunlight and it went up 10 degrees in just a few minutes. The picture below is showing the ADC value that is being returned. It's a 12 bit ADC (0-5v) but you could easily go with less accuracy for the sensor.

Saturday, August 23, 2008

Clockwise vs Counter Clockwise

After unpacking the motor I found a few things that EV America put in there for me. First was a document with a few warnings and guidelines. One that caught my eye was that motor can't be run in CW rotation unless ADC or a representative has modified the motor. The motor comes ready for CCW rotation which is good for most vehicles, except Honda as they run in CW rotation. I contacted EV America and they gave me a walk through on changing the motor.
In order to make the change rotation you need to release the springs on the brushes and then remove the four bolts holding the CEH in place. You can then rotate the CEH. The far left holes pictured here were for the original CCW, the next hole is for neutral whatever that means, and the bolts are currently in the CW location. These holes change the timing of the motor and determine which way it will want to pull. I had no idea it worked this and just figured you'd hook the polarity backwards to change the direction. Not the case here, it will rotate the same way regardless of polarity.

Second I added screen (window screen) to the brush protector to keep out all but the smallest of objects. This will help prevent damage from small rocks flying up into the motor. The screen was attached with a hot glue gun and then I used scissors and a utility knife to cut it to size.

Here is a picture of the motor assembled again. I manually rotated the motor by hand to make sure it was smooth. I put some small 6 gauge wire on for a quick 12 volt test to make sure the motor rotated the proper direction. I say small on the wire because I will be running 2/0 wire which will dwarf the 6 gauge wire. 6 gauge wire is actually quite large. For example this was the wire I used to pre wire for my hot tub. You can also see in this picture the chain I attached using the bolt holes on each end to lift it out of the container.

Thursday, August 21, 2008

Vacuum system for power assited brakes

Ok here is probably the first EV part of the build I've done. I was going to wait on the vacuum system because you typically don't want to start planning where to place components until the motor is mounted. Overall from that point it's probably best to consider the larger items and work smaller to make sure you have room for everything. However, you may recall a spot in the far front left corner of the car where there was an emissions pump of sorts and I removed that. I just happens to be a great size to put my full vacuum system so I decided to get this piece of the project out of the way while I wait on the adapter plate/coupler pieces.

Below is a vacuum reservoir that I built. It's designed to store extra volume of less pressure air. Typically an ICE (internal combustion engine) will generate approximately 10-20 in/Hg and in large volumes so there isn't a need for this as the existing reservoir will hold plenty. With an EV we need to be as efficient as possible. This involves using a somewhat small and efficient vacuum pump that will build up the vacuum over time. When the brakes are needed the reservoir will be able to produce multiple uses of the brakes before becoming depleted at which point you'll loose the power assist and it's much harder to depress the brake pedal to stop.

The reservoir can be purchased but it's simple enough that most should create their own. All of the parts are easily found at a hardware store in the plumbing area. I used 4" ABS and the unit is about 8" to 10" long. In order to only have to deal with one hole that needed to be sealed I opted to use tees outside the reservoir. The one hole was thread with a tap and die set and a threaded tube was threaded using plumbers tape to help seal was ran through the top. On the inside a coupler was used allow me to really tighten things down. Plumbers tape was used on all connections to help avoid any leaks. The barbed fittings allow for hose to be slipped on and then using a ring clamp you can secure them well.

I made my own bracket that would take advantage of the existing bolt holes in the frame and would allow me to fully mount the complete vacuum system in one shot. I believe this was
48"x 1"x 1/8" flat steel and cost about $4 with metal leftover.

Here you can see the Gast vacuum pump secured to the mounting bracket. In addition you can also see some rather large ring clamps that will hold the reservoir in place.

A shot of the reservoir attached to the bracket.
Here is the assembly attached to the car. It's hard to see but all the vacuum lines have been attached. There isn't a special vacuum line. Anything that holds up well to the elements will do as long as the walls are not too thin in which case it could collapse under the vacuum. For all the major lines I'm just using a 3/8" ID black fuel line I found at the hardware store. You can also see a very small clear line. This runs over to the switch which is mounted to the back of the bracket. I forgot to take the picture of the switch being mounted but you can slightly see it where the red wire has the yellow shrink tubing sticking out. One of the barbed fittings was removed and capped before installation and after I had calibrated the vacuum switch.
To calibrate and test I hooked the hose my new vacuum system to the cars original reservoir and connected the battery directly. First I adjusted the switch until it turned off at 20 in/Hg. The pump is rated for a maximum of 25 but that usually means it will get pretty slow and take longer to reach that using more energy. Next I counted how long it took to bring the system from atmospheric pressure to 20 in/Hg ~25 seconds on average. Next I did multiple runs of pumping the brakes quickly to deplete the system. I consistently get five well assisted depressions of the pedal followed by two that were slightly stiffer and then after that it's much harder to press the pedal and the vacuum gauge shows depletion. Next I checked what happens after just depressing and releasing the pedal one time. Every time the pump would turn back on and take on average five seconds before shutting off. At first I was thinking this wasn't good and would prefer it to go two to three times before kicking back on but then realized a potential hazard with that. If I only have five good pedal depressions and releases and say three are used up what happens if I needed the brakes a few more times in a row in some emergency situation? I realized it turning on for a short while after each braking was really a good thing. Probably the only way to get away from this would be to have a HUGE reservoir where the pressure wasn't affected so much with each braking.

Here is a shot showing the line running up to the original brake reservoir (it's the new shiny black hose.
I still have to run an ignition lead to a relay near the pump so that it only runs when the key is on and I'll be using the wiring which was already in the area for the old pump. I'll be holding off on this until I install the rest of the electronics.
As you can see the overall system is very easy to build and straight forward. I used a Gast vacuum pump from EV America ($225). The switch was ordered from EV Parts ($23.50). Everything else was obtained from the local hardware store including the metal to build the bracket.

Adapter plate and coupler status

As I mentioned before I wasn't sure which route I was going to take on getting the plate and coupler made. For my setup it turns out I need six pieces machined total.

The coupler which mates the motor output shaft to the original flywheel. The flywheel has the clutch attached to it which then slides over the input shaft to the transmission.

The adapter plate is the second piece. It needs to be cut to match the outline of the transmission and have all guides and bolt holes drilled out. The center of this plate needs to be perfectly aligned with the motor and trany shafts to all fit together properly.

Finally I need four spacers. These spacers sit between the motor and the adapter plate. If you think about the original setup the flywheel is positioned a certain distance away from the mating surface of the transmission. This distance must be matched very closely so that the everything fits properly and the clutch still works. In order to do this I need to add an additional two inches of spacing between the motor and adapter plate. Each spacer and the adapter plate are made from half inch 6061 aluminum.

So I did some research and EV America has pre machined spacers and adapter plates. I called a local metal supplier to compare the cost of the raw metal vs their price and it's reasonable in my opinion for the time saved. Also if you were to go to Joe's machinging and have them create these with or without specs you'd probably pay more. If you can machine them yourself and need to save as much as possible then that's the clear path. I was quoted $350 for a 24"x48"x.5" 6061 sheet of aluminum. Add tax and you're closer to $375 or so. This assumes you don't make any mistakes maching and need to buy more. EV America has the adapter plates for $220 and the spacers for $90. I ended up paying $590 shipped.

Basically the spacers are ready to bolt on. The adapter plate has the inside hole and bolt holes for the motor ready to go I just need to do the transmission outline and guide/bolt holes. The couplers they sell are for cluthless designs so won't work for me, I want my clutch since I drive in the hills and will need to down shift. I can buy the raw metal for the coupler for ~$25.

My uncle has agreed to do the maching work for me. He doesn't have a lot of free time right now but since most of the parts needed are machined we should be able to finish the rest on a Sunday and be done with it. If we had to do it all I'd have to wait till after October for the help.

I plan to add some photos of all of this once they are machined and will show the assembly of them to give you a better idea of how it all works.

Helpful Links

I've added a list of EV related links on the right side of this blog. These are by far not all the sites out there but I find I use them the most for obtaining information, comparing prices and just passing time when I'm bored and planning things for the conversion.

Thursday, August 14, 2008

First round of parts arrive

I finally got some long awaited parts in this week. Below is the box the motor was shipped in. I'm going with an Advanced DC FB1-4001A. This is a dual shaft motor that can operate from 72 volts up to 144 volts. My goal is run it at 144 (room for batteries permitting).

This thing was really well packed.

Here is picture of the motor with my hand as a reference for the size. Amazing how small it is and yet it weighs in at about 140 pounds.

Here is a picture of the Albright contactor SW-200. It uses a 12v signal to trigger a massive contact point which will allow the 144 volts from the traction batteries to be sent to the motor controller. Two are used for added safety. One will be turned on with the ignition switch and the second will be turned on when the pot box switch is triggered (just as you begin to press the accelerator).

Not sure why this blog image uploader decided that some of my images were better off sideways. Here is the vacuum pump that will be used for the power assisted brakes. An additional chamber to keep a vacuum reserve will be built but I'll cover all these details as they are built and implemented later.

Here is the motor controller again picture with my hand for size reference. This guy weighs in at almost 20 lbs. I'm using a Curtis 1231C-8601. This can run between 96-144 volts and push a maximum of 500 amps. Do not confuse this with the other 1231C model which is only for up to 120v and 550 amps. The end of the model number is different but not always shown on some websites.

Here is a sheet of metal that the controller will be mounted to and a fan that will greatly help to remove heat from the unit. This should help the unit for many hours of operation.

Here is a picture of the Curtis PB-6 potbox. It will connect to the original accelerator cable and provide the motor control with the data for how fast I want to go. It's hard to see in the picture but on the left side of the picture are three little connectors. These are what I was referrering to earlier that will trigger one of my contactors that we need power.

Now that we have the motor the next major task is to find a machinist who can work some magic and mate my new motor to the transmission.

Sunday, August 3, 2008


So after doing some research on why the EPS light would come on it's exactly like a check engine light. There are a set of codes that can be displayed to help diagnose problems with the system. The bad part is you can't use your standard cheap OBDII tool to read and clear these codes. The only scanners that will work for sure are from Honda and you can't buy them. There are some 3rd party scanners that cover most of the functionality and on average you can own one for 5k. Now I figured I was really in trouble here. After going over the electrical diagrams and service manual in general for many hours I found the loop hole I needed. It turns out Honda installed a backup way to do all of this in case your scanner software wasn't up-to-date! It turns out the EPS was complaining there was no vehicle speed signal and no engine rpms. I reset the codes and then made sure both spoofed signals were in place and the problem went away. It also turned out I was only getting a partial assist boost. Once I removed the dtc codes the boost is now very noticable.

How to retrieve subsystem DTC codes:
1) Bring the SCS to ground. This is pin 1 (at least on this vehicle). Unless you have a scanner which can do this, simply take a wire and stick it into the pin 1 hole. Then attach the other end to a ground on the vehicle. I believe pins 12 and 13 are also ground and you might be able to use of them but I didn't test this.

2) Turn the ignition ON. All subsystems will now begin displaying their DTC codes through their indicator light in the dash. Note that if a system doesn't have any codes the light will remain on or off. The light will flash for each number so count the flashes. It will also alternate between slow and fast flashes per digit. For example a code of 23 would be two slow flashes followed by three quick flashes.

3) Look this code up in your service manual to determine the problem. Each subsystem also has a crazy way to reset it. The EPS involved turning the steering wheel full left to center a couple times with pauses in between.

Saturday, August 2, 2008

Oscilloscope and engine RPMs

I finally got the new handheld oscilloscope in to try and figure out what I was doing wrong in creating the RPM signal for my gauge and to enable the electronic power steering to work. The scope is a Velleman HPS10 and I picked it up new on ebay for $140 shipped. I didn't know what to expect never using a scope before but looking at the features I was pretty sure it would do what I needed. I'm really impressed with this scope for the money after using it. It showed me that my timer circuit I had built wasn't behaving as I thought it was :)

So ultimately what I'm trying to create here is the signal the RPM gauge wants to see. However, this signal comes from the ECM which it creates based off the crankshaft position sensor and they are not the same pulse. After trying a few different things my circuit still wasn't pulsing what the gauge wanted to see so I decided to simplify things and reconnect the ECM to the engine and crank it over while watching the signal the ECM generates for the gauges on the scope. Instantly I realized my problem. Unlike all the other sensors so far this pulse is NOT 5 volts, it's 12 volts. I was never creating strong enough pulses to be measured.
After building another quick circuit and increasing the frequency a bit I was able to get the gauge to move as I wished. At the same time I heard a relay click and sure enough I had power steering! I tested it a few times trying to turn the wheel without the assist and then turing it on to make sure everything was in working order. I did notice the EPS light is remaining on even after the "engine is started". In other words the RPMs are not zero and I would think the light should turn off now. I'll have to look into that next.