Thesis log‎ > ‎

Week 02 - Still waiting for parts, MAX186 12bit bipolar ADC, cable rack and LEM with CAN 2nd prototype

This is the second week of my thesis and I'm still waiting for some parts for my BMCs. So it's time to work on the sensors again.

Last week I've started to upgrade a LEM current transducer with a CAN node. The problem is, that I need to measure positive as well as negative currents respective voltages. One solution would be to use a bipolar ADC.

So I started to experiment with the MAX186. The MAX186 is a 12bit ADC with SPI communication. It can work in bipolar mode (with +-5V supply: form -4.096V to 4.096V, with 5V single supply: -2.048V to 2.048V).

This is the first test with function generator and MOSI (Master Out Slave In) tied to high. The high potential on MOSI leads to a command word of 0xff. See datasheet for more information.


On the oscilloscope, yellow is SSTRB (Serial Strobe Output) and blue MISO (Master In Slave Out). The blue strobes are the 12bits of the result, in this case 0101|1011|0111 which equals 0x5B7 or 1.463V.

Next step is to connect it to a AT90CAN128, feed it with the right commands and test the bipolar mode.

As a small distraction and relaxation, I build a rack for our cables. Normally, they were messed up in a corner.

This is the rack build out of frames I found in our storage.


And now with cables, sorted by colors and cable types.


After this, I had to build a socket for our charging station, which is standing in our show room.


Well, it's pretty useful, but not my task actually :) so back to work, back to the MAX186.

I made some interfacing test with the AT90CAN128 and after some tweaking in the source code, the SPI interface was set up and the result bits were shown on the oscilloscope. 
After this, I could focus on a bipolar setup, putting the information on the CAN bus and more importantly on a layout for my prototype board. I had a lot of noise on my bread board setup, so I tried to put everything closer and I've spent a filter for the ADC channel 0 pin (100nF).

This is how the second prototype looks. I put the MAX186 in the middle beneath the CAN eva board.


And here the back view.


Some connections are not ideal, but I'll fix this in the eagle layout for the final version. This version will be printed, so I can root through the pins and use transfixions.

The next test was pretty good and after spending a software filter (mean filter: mean out of ten values) only the LSB (Least Significant Bit) was floating.

This is the setup.


The current flowing through the red cable, which is put through the LEM, is transduced and the voltage drop across the shunt (50Ohm) is measured by the MAX186 (and by the multimeter in the left upper corner).
The measured voltage is send every 100ms via CAN and can be displayed by a CAN monitor.
This is the received CAN message with this setup. 111mV has been measured, positive direction. 


This is the received CAN message with a different setup. The connectors of the red cable have been interchanged, emulating a negative current flow. 117mV has been measured, negative direction.


The LSB is still floating, but I think it's satisfying. I'll try some more software filtering. I have the Winsorisieren filter in mind (canceling the lowest and highest values, which might caused by distortion, and calculating the mean out of the remaining values).

The source code to the second prototype can be found at the bottom of this page. Sorry for the missing comments in the source code, but this is not the final version. I'll add some comments later.

Well that was all for this week. I did some minor things, but nothing worth talking about, and a lot of reading and literature research.

If everything works out fine, I'll get the missing parts next week and can start with soldering the BMCs.
ċ
LEM_CAN_with_MAX186_v002_2012-06-12.zip
(84k)
Alexander Wegner,
12 Jun 2012, 07:11
Comments