2020. április 25., szombat

GP-IB 5. - V2.0 Board

When I wrote the previous part of this post, one of my friends complained, that was to short. I can promise. The current one will not be.

Prelude
I already have several GPIB boards on my desk. Actually I have 1.0, 1.1 (and now 2.0) version of my board. One of the 1.0 boards doesn't work correctly. I meant, I need some diagnostics into the firmware to track down the problem. So I wrote a diagnostics extension to the current instruction set. It is able to manipulate the GPIB pins directly (I tried to resolve the error of this board, but the results were inconclusive).

v2.0 Board
To step forward, I soldered in the next generation board. It also need some software modification as it use ATMEGA32U4 instead of the ATMEGA328P on the previous one.



Everything went easy. Too easy.
The ISP programming was successful immediately. The software modifications took less than five minutes. The board upload worked, just right after fixing one single easy to handle bug.
Connected to my test HP3478A multimeter. Run a scan command. It immediately found the instrument and reported back the reading. The only gotcha was the reading characters appeared one by one slowly.

Next day - troubleshoot
I was thinking one unsoldered pin, and reading timeout cause the problem.
Fired up the diag mode, and realized that the D1, IFC, SRQ and ATN always reporting back high logical level, whatever I do.
Tracking down the issue - playing with the other boards - just came out, that the diag mode doesn't handle certain pins correctly. Modified the diag mode. It resolved the issues on the 1.0 and 1.1 boards, but not on this one. The D1 and the ATN issue remained.
Later on, somehow I figured out that those are used on the Arduino Leonardo board (what I was using as configuration and the bootloader of it) as RX and TX LEDs for the USB communication. Holly shit.

Redesign or fight?
The dilemma came here. I've two options:
Either I redesign the board, and send to manufacturing once more, or fight with the Ardunio bootloader, core, whatever. I chose to fight. Reasons:

  • Design and manufacturing has costs, and need several days (or even weeks) until the new board arrive
  • The ATMEGA32U4 has two externally accessible full 8 bit ports. Those can be used for faster communication with direct port manipulation. Unfortunately those LEDs are use one pin of each of this ports. So if I don't use them, I lose the speed here.
  • Digging deep is fun. I can learn a lot from it.


Blame the bootloader
Actually I don't know why, maybe I read something on a forum, I was thinking, I need to modify the bootloader, and it will resolve the problem (maybe the serial use it for the communication, I don't know)

New bootloader
First of all Identified the source code of the bootloader. It is located here (https://github.com/arduino/ArduinoCore-avr/tree/master/bootloaders/caterina). Checked the Makefile it also need a library called LUFA for the USB communication. I also checked this out. Added the latest Win64 compatible avr-gcc and make.
I tried various ways to point the Makefile to the LUFA, all of my attempts failed. Also it missed grep tool. I felt like the Windows is a dead-end for this build.

Switch to Linux
Didn't wanted to build a linux machine, or add a Hyper-V based Linux. So I fired up the Subsystem for Linux and installed the Ubuntu 18.04LTS from the Microsoft Store.
Installed avr-gcc, build tools, make, etc. on it.
Found the filesystem location of the Ubuntu in the Windows filesystem and copied the source code over.
It wasn't work. I got various permission issues with the copied files, so I gave up and cloned the repos once more.
Trying to compile gave the same errors as on Windows without the grep problem. After several path modifications, adding the USB VID and PID finally it started the build. The result was a catastropy:


The bootloader in question was built last time 8 years ago. Both the avr-gcc and the LUFA library stepped forward since.
Figured out what tag was used originally, switched the repo to it. Now the bootloader compiled successfully.

Testing with the new bootloader
I didn't wamt to hack it into the Arduino IDE so I flashed the bootloader manually to my board. Uploaded the code also. And....

and it failed.

Hack the core?
No. Even I figured out that the problem is probably in the USBCore.c, I didn't wanted to hack it. It wouldn't create a future proof solution.
Looking around and thinking lead me to create a custom Arduino board specification for my project.

New board config - not yet
First of all I wanted to have something I can learn from. I found an ATMEGA32U4 based custom board from ArachnidLabs (http://www.arachnidlabs.com/tsunami/), and the git repository for it: https://github.com/arachnidlabs/arachnidlabs-boards
It turned out immediately that I need a stable place to to host the json and the package zip. Something I can count on that will be there for a while. Something can be accessed without any authentication voodoo (like OneDrive).
As the AVR-GPIB project of mine hosted on GitLab, I was looking around there. As Github has Github pages, what a surprise, GitLab has GitLab pages.
I read through the documentation, it was still not clear, how to setup the GitLab pages.
Created a repo named suf.gitlab.io, put the files in there. Nothing happened.
Ok, it looks like I need a gitlab-ci.yml for building the site. This isn't surprising concept to me, as in the last few years I'm working as DevOps engineer. Writing Jenkins CI/CD pipeline scripts on daily bases.
Wrote the script, pushed the repo, failed. Some naming wrong. Corrected.
Next. Building correctly. The site still give 404 back.
After many tries realized, that my files from the GPIB subdirectory landed into the root of the site. I was thinking that it is because the root has no files in it, just the GPIB folder. So added an index.html.
The previously successful build failed again.
After reading many things, several trials, came out, that the only approach what is working, to add everything to a newly created temporary folder and rename (mv) it to public, what is the designated name of the publishing.
So my GitLab pages site born: https://suf.gitlab.io
It is small, it is yellow, it is sour, but ours (I know it is not got through in English, as it refers to an epic Hungarian movie from '69 - https://en.wikipedia.org/wiki/The_Witness_(1969_Hungarian_film)).

New board config - now really
Created the json, modified the pins_arduino.h (pointing the LEDs to two not externally exposed MCU pins), built the package, created the hash, added into the json, uploaded the whole thing to the GitLab, added the json to the Arduino IDE, went to the board manager and...
nothing happened.
Repaired two things looked like bug: name of the json. I don't know if it is a requirement, or just a kept convention, but renaming don't harm.
Realized, that I didn't change the length of the package file in the json, so now I did it.
Push to GitLab, back to Arduino, my config appeared in the Board Manager
Install: failed. There must be a single folder inside the package.zip.
Changed the required things, push to GitLab. Install now works.
Try to upload the code I wrote.
Getting weird inconclusive errors, communication problems. Switched back to Arduino Leonardo, getting the same errors. It smelled like problems with the Windows COM handling. Reboot resolved it.
Try to upload once more. There are missing avrdude parameters. Various parameter related issues. Finally I added into the package.txt whatever I found. It looks like that the ArachnidLabs config was written for an earlier Arduino IDE what doesn't require those parameters.
Now the board upload works.

Try it out
GP-IB diag functions now work as I expected. We are ready!!!!
Noooooo.
The diag works, the communication with the instruments, not. Enough! Sleep!

Next day
It was something itching in my mind. Tried out the previously working boards. Stopped working those too.
Either my HP 3478A multimeter died, what I'm using for the tests, or the diag modifications what I did in the code later on, disrupted the communication.
Figured out soon: the diag was buggy. Fixed it. Now the v2.0 board works.

End of this story.
Will continue with the further hardware and software development of the GPIB adapter.

2020. április 14., kedd

GP-IB 4.

Nine month. Today exactly nine month ago written last about my GP-IB adapter (http://pakahuszar.blogspot.com/2019/07/gp-ib-3.html). Its been a hard delivery.
I'm announcing proudly the birth of the working GP-IB interface software. It still need to learn and grow. Things are missing from its skills like device mode and USBTMC capability.
Both the father:


The mother:



And the child:
https://gitlab.com/suf/suf-electronics-gpib

In good shape:



And waiting for a long and prosper life.

2020. április 9., csütörtök

HP 3488A

This will be a long association chain. Just follow!
It is started with a picture on facebook about a Kenwood analog two channel AC voltmeter. It can be nicely used to check stereo audio equipment channel differences. I love the concept, but still I'm not an analog meter guy.
I was thinking. What if I pickup one of my digital bench meters and develop some desktop software around my own (still in development) GP-IB USB adapter, and add an uncontrolled MCU based channel switch. Uhh, this sound ugly, in addition, this is not the post where I will explain it. Just get it, I'm developing it, and publishing soon.
So go back: I chosen one of my HP 3478A 5.5 digit multimeter for this. And here come a few things.
  • I need a switch for the project
  • The display of the 3478A is a heap of crap without backlight
  • I don't want to kill the original display on those unit, so get something similar, cheaper.

As usual I was looking around the eBay. And look what I found. Two HP 3488A. those are loaded with cards (usually you can find it empty), for €102 delivered. So I bought it immediately.
It is a good practice for the display modifications, if they work (the seller didn't guarantied it), can be used as a switch for the project above, and also for other purposes. Also, it nicely fit into my test equipment collection.
So here they are:



First of all, I removed all of the cards, cleaned the units (get rid of all of the stickers, dirt)
Let see the inventory:

  • Two HP3488A units. One of it miss its power button. No stands.
  • Two 44471A General Purpose relay cards. One of it even has the connector block, the other don't
  • Two 44470A Matrix relay cards. Both of them with connector block, just from one of the blocks the plastic insert was missing

One misterious, HP branded, and hacked - some (not even nice) modifications are made by one of the previous owners.
This is the mysterious card, I would appreciate, if somebody can give me any info on it:



After a bit cleaning, I tried out the units. for the first smoke test, both looks like working, the self tests are succeeding, I can hear the relay click from console, and from remote GPIB commands.
As you know, I'm in the 3D design, and printing for a while.
Here I needed two missing plastic parts. One for the power switch replacement


And one for the connection block insert.
I designed both, in my regular OpenSCAD:



 Here they are printed:


Left is the original, right is the printed:


Now, the power button in its place:


Project of getting in shape the HP 3488A units now completed.

2020. április 1., szerda

2kW Bench Power Supply 2.

Please don't look for the first part under the title above! It was published as Few stories ...
It took a while to go further with this project.
I built and tested the my delay circuit mentioned here.


Works as expected.
Done all of the cabling, mechanical work, needed for the assembly.



I was choosing a C20 connector instead of the regular C14. The two power supplies can consume maximum 3kW, so I felt that a bigger connector is needed.
After almost of a year skip, I restarted my 3D printer. So I created a 3D printed back panel:


I made a short video shot to show how the delayed startup of the two supplies works:


So, this unit is working now. The only thing is missing, the computer control.
The two units originally has two separate optically isolated USB to Serial units. I wanted to solve this with one USB port. So, I ordered a dual channel FTDI module, what unfortunately not yet arrived.
The USB port already assembled to the back, it just waits for the module and an optoisolator board design from me. This will be the second phase of this project.

2020. január 3., péntek

Hi-Fi rack - Motorized turntable tray 2.

As the tray started to work, it is time to create a proper controller board for.
Based on the electronics I built from Arduino UNO, CNC Shield and breadboard, I designed one, with some changes:
- Added a few additional connector, to allow me to use it for different purposes
- Changed the stepper motor controller from DRV8825 to Bigtreetech TMC2209 module. Added the possibility of the UART control
The Schematic design:


The PCB Design:


And the 3D view:


I have a few additional board to design. So I'll order my designs together, to reduce the shipping cost.

2019. december 30., hétfő

Two problems - one solution

As usual I'm building several things in parallel.
In my last post I was writing about the switch on problem of my dual power supply. This is the first thing need a solution.
A few month ago I bought a 1,5kW variac for a bargain price (€50 what is a joke if I add that this unit even has isolated primary and secondary winding).




When I tried to use it, realized, that it immediately switch of the circuit breaker. Too much inrush current (huge iron core).
For the first problem I need a timed switch circuit, what can be controlled by a low current switch circuit. For the second problem I need a classic soft start unit.
If we dig a bit into the operation of the circuits we will find that those are similar. In the first we need to switch on the high power side after a certain amount of time. In the second the system will be switched on immediately just through a pack of power resistors, what will be shorted after a certain amount of time.
So If I separate the the switch of the controlling power supply from the high power side with a switch, I'm ready.
In the delay switch unit I'll left out the power resistors and control the small PSU from the front panel switch. In the soft start unit I'll populate the power resistors and shorting the small PSU to the high power circuit (and add an external, high current capable mains switch).
During the design of the circuit I went a bit further. Added two of the units above to a single PCB. Those can be used either in master-slave mode (adding only one mains input, one power on switch, one low power PSU but two different delays with two relays) or it can be used as two fully functional units if we cut the PCBs two side.
So, the whole design is complette now. I'll order the PCB in a few days (I've a few other things in my head and I want to pay only a single shipment cost from the manufacturer).
The schematic diagram:


The PCB design:


The 3D model of the board:


This is first of my designs what have a complete 3D model. I was able to use the OpenSCAD -> scad -> FreeCAD -> step workflow for creating models for my own part designs easily.

2019. december 29., vasárnap

Few stories - Build something on it.

I'm building something. As usual.
I'm telling a few stories about things - unusual? I don't know.

1. I'm fundamentally an IT guy. Most of my life I worked in various companies fulfilling various IT jobs. This dates back when I was head of the IT plus sysadmin at a company called "Láng Holding".
This was before the internet era (just to understand, the internet was existing way before some of the younger or not core IT people thinks). So it dated to 1998-1999 (Before the dotnet boom).
We acted as a usual holding company. Mainly working as financial/legal entity. One of the biggest IT challenge at those days was to have the countries laws, the country wide corporate registry available electronically for our employees. At that time this information was not available on the just starting web.
There were a company who provided this information on subscription based CDROMs.
A usual computer has only one CDROM drive (mostly non today), but I needed more, centrally on the server. So I bought a nice SCSI box with four drive bays and four SCSI CDROMs for the task.
Those days passed. We finally closed this company, and the box above landed in my loft (together with many old IT things).

2. A few weeks ago I ordered two identical 60V/1500W DC power supply modules from China. As I didn't wanted to pay the higher shipping cost of DHL, I ordered them separately. It costs $99 each.
This was a good test of the local post, how they handle the customs. I can tell: randomly.
The first one I ordered landed at customs, and still didn't arrived to me. The second one I ordered landed in my house without customs handling.

3. Back in 2017, I ordered a Ruideng DPS5020 power supply module from Banggood. After a few month it become clear, that it will never arrive. So I complained, they resent it, and after a while both arrived. I agreed with them to keep both instead of sending one back.

As you may realized by now I want to build a dual channel 0-50V/20A power supply to my lab. This is in my mind since 2017.
As I have both the lab supply modules and the huge mains power supply for it, I started to think, what would be the best possible enclosure for it. All the ones I found at the local suppliers and the online sources were too big and too costly. Then come into my mind the forgotten SCSI box from the loft:


Removed everything from inside:


Built two power modules from the Ruideng controller and the 1,5kW PSUs added some aluminum profiles:


Mounted it into the box above:


Here come a few problems:
1. I started to think. The box has 3kW PSU inside. I think, the original power switch will never be able to handle around 15A current.
2. I don't want to switch those PSU simultaneously on, because the mains fuse will not handle the inrush current
3. I want to control the PSUs from a PC, but on a single USB port. So I need to change the USB/RS232 adapter came with the units to something else.

As you see the build almost finished, I just need to address those issues. Especially to first two. Those will come in a later article.