Tuesday, May 8, 2012

HTOL power supply

Another quick project was to mount three 3.3V 55A power supplies in a project box for the HTOL testing I've been doing these days.

I bought an aluminum project box for $85 from an electronics surplus store and bought cheap digital Volt/Amp meters from Amazon.com to mount on the panel. And following is how it looks:



To measure high current the Amp meter measures the potential drop across a Shunt rated at 200 A, 0.75 mV

The current reading is fairly accurate and serves our purpose. The shunts can be seen in the following image:


And here is the link to buy them:

http://www.amazon.com/gp/product/B005HBBZEM

Monday, May 7, 2012

Using Prologix GPIB-USB Controller.











Following is a tutorial to access Prologix GPIB-USB controller in Python.
(Can be translated to any other programming language).






Disclaimer:


It was a quick and dirty project so please bear with me !




Description:


A cheap GPIB-USB controller to control GPIB enabled instruments. Based on USB to COM FTDI chip that converts data from USB to serial. So, you just have to read and write GPIB instructions over a virtual COM port.


In Short:


  1.  Instantiate a GPIB object by opening the COM PORT and fixing the baud rate.
  2. Then you need to select a device to write or query. Select the device address by "++addr<ADDRESS>" command
  3. Then you write or query command by writing it to the COM port and reading it back.
  4. To read back for querying you should write "++read eoi" before reading bytes from COM. This allows read until end of instruction is seen by the device.





For more details use the following manual:


DATASHEET






Python Code:




import serial
import sys


USAGE = '''
USB-GPIB.py: Utility to control GPIB instruments through Prologix
USB-GPIB interface.
'''


class spawn:

#instantiate new object for an instrument
def __init__(self,COM=3,BAUD=115200):
try:
self.ser = serial.Serial(COM,BAUD,timeout = 5)
except:
print"\a"
print"Exiting due to no connection with COM port. Check COM PORT!\n"
sys.exit(1)


#Select device to address
def SelectDevice(self,GPIBaddrs=9):
self.ser.write("++addr %d\r" %GPIBaddrs)


#write
def usbGPIB_write(self,cmd):
self.ser.write("%s\r"%cmd)

#Query
def usbGPIB_read(self,len):
#Read until eoi asserted 
self.ser.write("++read eoi\r")
read = self.ser.read(len).strip()
return read


if __name__ == "__main__":

#instantiate a gpib object
gpib = spawn(COM=3,BAUD=115200)

#Select GPIB device by mentioning the GPIB address
gpib.SelectDevice(9)

#Write on GPIB - Query Device ID
gpib.usbGPIB_write("*IDN?\r")

#Read bytes from GPIB  - Read back ID string
read_add= gpib.usbGPIB_read(80)

print read_add

#Select second GPIB device
gpib.SelectDevice(19)

gpib.usbGPIB_write("*IDN?\r")

read_add= gpib.usbGPIB_read(80)

print read_add




I guess the code is self explanatory. If you have any questions/suggestions please let me know.







It's sad that millions have died over the lies of politicians in 21st century.

And its too amazing to notice that human have repeated the same atrocities throughout the documented history, based upon propaganda.Yet, people seem to be apathetic to the find the truth and do believe in what these stupid demagogues say.

Ron Paul 2012!!!!!