Skip to main content

Topics

This section allows you to view all Topics made by this member. Note that you can only see Topics made in areas you currently have access to.

Topics - Bertho

1
Project development, ideas, and suggestions / Digitally Controlled Bench PSU
Hi all,

Many electronics people will build a bench power supply at one point in their professional or hobby career. I too have made a couple over the years. However, most of the time I used what was available in the shop(s) where I did my work. One type of PSU in particular always fascinated me: a digitally controlled PSU. No potentiometers, but a keyboard where you punch in the numbers and get exactly that.

Those digitally controlled PSUs are rather expensive toys. Of course depending on the actual accuracy, but they are not the cheapo China stuff you often see. So I started wondering what it would take to design one on a reasonable budget. 25 years ago, when I saw the first digital PSU, it would have been all too expensive for a hobbyist to come by. Most of the electronics are now affordable and it should be possible to, at least, "take a cursory design look".

Attached is a schematic that should show my thoughts so far. [attachment=0]

The design is for 0...30V and 0...3A (90W) controllable at ~1mV and ~0.1mA steps. The actual accuracy is still out for testing and I assume that noise and non-linearity will be a factor to look at when time comes. The basic design allows for 0...42V (max 45V) and (at least) 0...4A, but then all the components should be re-calculated to match such setup. Also, some components need to be voltage matched for a higher input voltage.

The design is a dual control-loop where the first stage is a switching PSU which is fed back to assure a 2.5V drop over the secondary analog control stage. The secondary stage is also responsible for the current limiter. The idea here is to reduce the power loss in the BJT (Q4) in the analog stage. A differential amplifier feeds the switching PSU feedback line to settle at Vout+2.5V. Estimated power loss is 12..15W (max) with a constant 3A output current, where the regulating BJT is responsible for 7.5W. The current limiter is a differential amplifier over a high-side sense-resistor, which controls the same regulating BJT.

The whole setup is controlled by devices on an I2C bus (and one shutdown signal) on a 6-pin header. Both the output voltage and current are set by two 16bit DACs on the I2C bus. The resulting output in both voltage and current are measured back with 15bit ADCs (16 bit differential), also on the I2C bus. Finally, another 12bit 8-channel ADC (I2C) measures auxiliary parameters such as input voltage, switcher voltage, limiter voltages and up to 4 temperatures (with NTCs).
There is no active down-regulation of the output voltage. There are only bleeders on the output capacitor(s). It may be necessary to do active control. I have not yet decided (tell me if you think it is required).

An auxiliary power supply for +12V, +5V and -12V is used to supply the various components on the board.The 5V part is powerful enough to be used to power a small CPU board with I2C and the user- and computer-interfaces.

The main PSU board, without the 2x30V/100VA power-transformer, is estimated to cost somewhere around $75 in components. No exact calculations have been done yet.

My question would be if you'd like to comment on the design. Any comment is welcome. Especially welcome are the "D'oh!" design error comments ;-) There may be some component values that are inaccurate or plain wrong, which would be nice to know.
2
Project logs / Fruit machine, 7-segment one-armed bandit
I was revisiting the first program I ever wrote and decided it was time to redo the project with "modern" micro tech. The Fruit Machine is a One-armed Bandit (slot-machine) implemented with 7-segment displays. It has 4 displays to represent the "reels" and two for the credits.
[attachment=1]
The reels can be held in place after a roll to increase the chances of a win. A winning combination are three or four equal  symbols in a row (or two 'o' on the right). A "bonus" feature lets you wager double.

The hardware is a simple AVR processor with 7-segment displays in a matrix. Nothing breathtaking or complex.
[attachment=0]

A more complete write-up can be found my homepage at Fruit Machine, including firmware source. A youtube video, shows how it works.

Have fun (hacking).
3
General discussion / Push button toggle switch, old style
Hi all,

I recently answered a question about how a specific circuit worked and I was so intrigued that I just needed to write down my findings and share it.

The circuit uses a single (cheap) push-button to make the output toggle with debouncing and no-delay switching. The circuit used originally two NOR-gates and was embedded in a mixer-table. I boiled the circuit down a bit to get to the bottom and this is the result:


The original NOR-gates were used to be able to do predictable power-up behavior as well as global set/reset functionality. The elegance of the circuit is brilliant IMO.

A full write-down and timing-diagram is on my homepage at http://www.vagrearg.org/content/switchtoggle. Have fun looking and enjoying pre-microcontroller era ingenuity.
4
Project logs / 504 Segment Clock
I have had no clock in my house ever since I scrapped my VCR many years ago. However, I did miss a visible clock and wanted to make one. But when you make something, it must be special, at least that is my opinion.

At some point I was being silly and got the idea of making a 7-segment clock, but then a bit different. The result became this:
[attachment=1]
[attachment=0]
Features include:
  • 72 7-segment displays in three rings; inner (hour) ring 12 displays, middle (minute) ring 24 and outer (seconds) ring 36 displays
  • Light sensor for adaptive display intensity; lighter during the day, dimmed at night
  • Movement sensor for waving interaction; show time/date with a wave of your hand
  • Each segment individually addressable with 256 levels of intensity
  • Ethernet connectivity for remote control and power entry
  • NTP synchronization for (near) perfect time
  • Some blinkenleds for indicative purposes
  • Buttons and RTC for off-line time-keeping
  • 3D printed case in four sections with Plexiglas cover and back
The whole clock is documented further at my homepage: http://www.vagrearg.org/content/504segclock
There are still a few things to fix. Currently this is iteration three and there will be a fourth (and hopefully final) one. It does look nice, if I may say so myself ;-)
5
Tools of the trade / gcmc - G-code preprocessor/meta-language
Hi all,

Every time I need to create G-code for a CNC mill I get quite annoyed with the ancient syntax and hopeless format. Especially when I need to have dimensions in both mil and mm, to match PCB designs, it becomes a mess very quickly. I looked for a meta-language/preprocessor/compiler, but came up with nothing.

Time to create one!

I created a small compiler with a context-free grammar and procedural format, which runs scripts to make G-code for a CNC mill. It supports variables and advanced math (scalars, vectors and vector-lists) including mil/mm unit-conversions. You can find the code at my git-repo: https://gitorious.org/gcmc/gcmc

A bit more complex example:
Code: [Select]
SAVEZ = 5.0;
HOME = [0, 0, SAFEZ];
feedrate(100.0);      // Set the feedrate (F) to 100mm/min
goto([100mil, 100mm]); // go to (G0) location x=100.0*0.254mm, y=100mm
move([-,-,-10]);      // move to (G1) location Z=-10mm
move([-,-,SAFEZ]);    // move to (G1) location Z=5mm
goto(HOME);            // go to (G0) home position
The compiler code is far from finished. All it currently can do is generate G[014] codes. Arcs are yet to be implemented. However, there are quite a few built-in functions to support programming (trigonometric, standard math, unit conversion). Documentation is non-existent as of yet. The below example should help a bit for now. The grammar is designed to be familiar (very much C-like).

Please let me know any comments you may have.

An example is attached:
[attachment=1]
[attachment=0]
6
Project logs / NoLoop galvanic isolator
Hi all,

I had a problem some time ago with a nasty ground-loop and that cost me the USB port on my old laptop. It took me a while to realize what had happened and it was a generic problem we all run into more often than we think. Time to solve this particular problem once and for all and make generic isolation for Serial and SPI ports.

The idea of the isolator is to use a standard chip (RF-coupling) to isolate the signal lines. A switching power transformer is added to have power from the primary side transferred to the secondary side. This powers the isolating coupler and has enough "bite" to power other stuff too.

The NoLoop Serial is pin-compatible with the standard FTDI breakout (Sparkfun/Adafruit/FTDI). The NoLoop SPI differs in that it has one input and three outputs, whereas the NoLoop Serial has two inputs and two outputs.

The power supply converter and isolation coupler can do level-shifting as well (from 5V->5V, 5V->3V3 and 3V3->3V3). It cannot do step-up conversion, though, primarily because the FTDI internal 3V3 LDO supply would not be suited for that anyway.

A more full description is available at my homepage http://www.vagrearg.org/content/noloop including the schematics. I also listed the first small batch on Tindie.

Serial version:
[attachment=3]
[attachment=2]

SPI version:
[attachment=1]
[attachment=0]
7
General discussion / Constant divide/modulo done fast
Hi All,

A recent project required divide-by-10 and modulo-10 functions. The divide/modulo combination is required when printing some number in decimal. Normally, you get lazy and use the compiler's built-in functions for generic operation. However, they are slow, really slow and fill a lot of space in the flash. Since many operations are divide by a <constant> or module <constant>, there must be a better (faster) way to do so, and there is.

After a quick search I came across http://www.hackersdelight.org/divcMore.pdf and that makes constant division fun again. I created the following code (slightly modified from their implementation):
Code: [Select]
#include <stdint.h>
/*
 * Divide by 10 with remainder.
 *
 * Use the recurring reciprocal 8/10 = 0.1100 1100 1100...
 * See: http://www.hackersdelight.org/divcMore.pdf
 *
 * This routine runs in constant time in about 128 clock-cycles (or 16us @
 * Fosc/4=8MHz). Normal division/modulo would take many thousand cycles.
 */
uint16_t dm10val; /* Input/output div 10 */
uint8_t dm10rem; /* Remainder of div 10 */

#ifdef HAVE_MUL
void divmod10(void)
{
uint16_t q = (dm10val >> 1) + (dm10val >> 2); /* First approx. */
q += q >> 4; /* Second approx. */
q += q >> 8; /* Third approx. */
q >>= 3; /* div 8 to get 1/10 */
dm10rem = dm10val - 10*q;
q += (dm10rem + 6) >> 4; /* rounding compensation */
dm10rem = dm10val - 10*q; /* Actual remainder */
dm10val = q; /* Result */
}
#else
void divmod10(void)
{
uint16_t q = (dm10val >> 1) + (dm10val >> 2); /* First approx. */
q += q >> 4; /* Second approx. */
q += q >> 8; /* Third approx. */
q >>= 3; /* div 8 to get 1/10 */
dm10rem = dm10val - ((q + (q << 2)) << 1); /* rem = val - 10*q */
q += (dm10rem + 6) >> 4; /* rounding compensation */
dm10rem = dm10val - ((q + (q << 2)) << 1); /* Actual remainder */
dm10val = q; /* Result */
}
#endif

void func(void)
{
dm10val = 1234;
divmod10();
do_something_with_result(dm10val);
do_something_with_remainder(dm10rem);
}
The above code gives you val/10 and val%10 in one go. I tested the snippet on several small CPUs, including PICs and AVRs, and it runs in 60..80 clock-cycles (AVR) or 100..140 clock-cycles (PIC) and also depending which cpu you have. The code is slightly faster on CPUs that have a mul instruction (compile with -DHAVE_MUL).

The good thing about the code is that it runs in constant time. There are no jumps or loops. The use of globals makes it not re-entrant, but that is a small price for speed in the small cpu world. You can of course adapt it yourself.
8
General discussion / Groundloop blowups
Hi all,

I got to think a lot about ground-loops a couple of days ago while working on a current measurement project. For that I hastily made an optical isolator with what was at hands. However, the problem is a very common one, especially with the use of computer interconnects from left, right, up and down.

For you who are not familiar with ground-loops: A ground-loop comes into existence when you connect devices together and have multiple paths for ground-currents to flow. For example, you have devices connected  A-->B-->C-->A. Each connection carries a ground and that makes it ambiguous for a ground current from A-->B to take a path A-->B or A-->C-->B. If one path is a high-current connection, then you may actually blow up the secondary path. Ground-loops may also come from unexpected places, such as the earth connection from the power-outlet.

A "big" ground-loop is through the mains connection. Who does not know the feeling of two computers that will tinkle your fingers if both touched at the same time? How many printer ports I destroyed on computers with a missing equalization connection (power-outlet's earth). At the same time, some of my attached electronics once got destroyed because of the earth connection, causing a ground-loop. I also blew up my old laptop's USB (you know, that nasty smell of burning electronics) and many other components on plenty occasions.

I am wondering how many of you have experienced problems due to ground-loops.
9
Project logs / Executive decision maker pro
Hi All,

I was indecisive recently and needed good advice from my Executive Decision Maker and it turned out to be a good session with lots of yes and no. It also confirmed that I like making Plexiglas boxes ;-)

That session made me reinvest a bit of time in designing a kit-version of the machine, dubbed Executive Decision Maker Pro. The first thing I did was make a box. With the PhotonSaw working, that should be quite easy. The box will get some rubber feet screwed onto the bottom (don't like glue).
[attachment=1]
The next thing was to redo the electronics on a real PCB (one-sided). The largest change in the electronics is that I got rid of the current-sources. The planned LEDs are of much better quality than the original one I made with 3rd choice components.
[attachment=0]
I haven't ordered any PCBs yet because I am still looking into all he engraving that should be on the box and not the PCB's silk. However, I took some mockup images as an impression how it looks. The Pro version is slightly smaller than the euro-card sized original EDM. The Pro version's PCB is 98.5x148.5mm and the box measures 110x155x53mm.
[attachment=2][attachment=3]

The Plexiglas box, incl. all mechanical stuff, would cost about $25,- and the electronics and DC-connector, including pcb, but excl. 12V wallwart psu, somewhere between $25 and $31 (depending volume); packaged as a DIY soldering kit.

Let me know if you have any comments, requests or are interested in a kit. The Intentional Synchronizer makes the device indispensable for your upstream manager.
10
General discussion / Re: iPhones consume more energy per year than a medium-sized
What a sensationalist headline...

The refrigerator has an average (continuous) power requirement (by the above number) of ~37.5W. The phone is estimated at ~42W. While the number seems high, there are many other (support) devices/computers at work for a computer network.

However, it is very unfair to blame this on one brand/device. Your laptop would probably do much worse and your stationary computer is again worse than that. Then how about your television? You may have it on for a few hours at a time, but when you then factor in all the broadcasts power consumption and support requirements for the broadcasts, then you would end up at a big number again. We can all play the big-number-game and haven't even discussed the production/recycling/disposal costs.

Each and every device we use uses (a lot of) power from inception to destruction. If you really are concerned, do not buy it. But then you should also remember that just looking at DP's homepage costs energy too, and a lot of it. The problem is one of social and economical proportion. Your reference to "may have an impact if resources become challenged by supply and demand" is only (mostly) the economical side of the story. Energy, as such, is not tangible in the sense that you can relate to it personally. That would be the social aspect of the problem.

Maybe, instead of using a one device scapegoat, we should look into improving on the problem in a more generic and global way. How we do that is a different discussion.
11
Project development, ideas, and suggestions / Core-memory emulation design question
Hi All,

I've been hacking a lot on flipdots, which some of you probably have seen. While at Ohm2013, I was talking about the internal function of the flipdots when the remark was made "that is just like core-memory". Well, yes, it is, so I tested it. You can see my write-up of using flipdots as core-memory at http://http://www.vagrearg.org/content/flipcoredotmemory.

The question, however, is one of design. I want to make a real version of flipdots-as-core-memory; one where you can read/write and see the actual content. That should be no problem were it not for the choice of components. I can use a) old-style 74xx logic, just in line with the old style of both flipdots and core-memory. Or, b) I can use a quick-and-dirty way by smacking a small micro-controller on there and do it all in software.

Option a) has charm, but is both more expensive, rather inflexible in operation and interfacing and harder to design.
Option b) is cheap(er), uses less space and is flexible for multiple types of interfacing, but there is some tension in the use of old vs. new components.

What should I do? Go for the easy/flexible way or for the retro way? Your input and comment is appreciated.
12
Project logs / Blinkring
Hi all,

An idea of a blinking earring was born while talking at the local hackerspace. Inger was playing with harddisk parts and wanted to make blinking earrings. She has been doing workshops making jewelry from old computer parts (very, very nice; she is not an engineer/technician).

Well, we were discussing a more advanced version and this is what I came up with and how it looks (31mm outer diameter):
[attachment=1][attachment=2]

The paperclip trick was inspired from matseng's idea (many thanks!) and it uses a standard cr2032 battery.
[attachment=3]

Hanging on my ear blinking: [attachment=0]

There are still some issues with the software and the documentation is of yet non-existent. These issues will be addressed and published on my homepage when I have it working.

I plan to sell these on Tindie soon. The first batch (30 or 35) will be available at  OHM 2013 (which I will attend, http://http://ohm2013.org) if I get it all to work.
13
Project development, ideas, and suggestions / Flipdot fun
Hi all,

I've been working on a flipdot project for the past 3 months and wanted to share some of the things completed so far. I think it looks quite good, if I may say so myself ;-)

For those of you who don't know flipdots, these are mechanical discs (black/white or black/color) that flip with a (semi-)permanent magnet which can be polarized in either direction. A large current must be applied to a coil to flip the magnetic field and the disc will flip. Flipdots are available in 1x7 strips and in different sizes and colors. The direction of the current through the coil depends on which direction you want to flip. The current must be kept at 350mA for at least 450 micro seconds for the permanent magnet to reverse polarity.

Preliminary testing is documented in more detail at http://http://www.vagrearg.org/content/fliptest.

The first project was a battery operated 1x7 flipdot strip that could flip at 1flip/s for some time.
[attachment=0]
[attachment=1]
Two AA batteries are used, each 2500mAh types. A small PIC16F1507 micro-controller controls the flip-program.

The hard part was to get the energy out if the batteries. To flip a flipdot, you need quite a bit of energy and some test showed that it needed at least 9V. The high voltage is generated with a step-up converter in current-mode. Step-up conversion using voltage-mode proved to be a very high drain on the batteries (>700mA for several ms) and would not perform well on old(er) batteries. The current mode charges 200microF of capacitance with a 20mA constant current up to 9.1V. This energy is then dumped into the flipdot-coil through a set of H-bridges to generate a characteristic LCR transient curve and that flips the dot. A second step-up converter is used to generate a stable Vcc for the micro-controller and ensures that no brown-out will occur with older batteries.

The system proved to be very robust and the first prototype device operated at 1.5flips/s for over 40 days (>5500000 flips in total).

At last call, I was asked if I could add a USB port on the device. I already had programmed a serial input on the PIC controller (the 16f1507 does not have a usart), so there was no great deal in doing so. An MCP2200 serial-to-USB converter with a mini-B connector was added and a couple of diodes to enable power from either batteries or USB. Finally, with my fingers itching, a PC control program (using QT) was created to control the device when connected via USB. That turned out to be a lot of fun with the ability to define a flip-sequence of choice at max. 40 flips/s.

The entire FlipDemo project is documented in more detail, including schematics and test data at http://http://www.vagrearg.org/content/flipdemo. Please feel free to comment on any part.

Next up will be to complete my 7x7 flipdot modules.
14
General discussion / Re: Need advice about Hardware engineer!
If you are doing it for the money, then you are in the wrong line of business (IMNSHO).

A good engineer (any field) has a spark inside to drive to do stuff with curiosity to look beyond the obvious and a sense of personal honor to do/make the right thing.

This may sound a bit cliche, but it does make out the difference.
15
Bus Pirate Support / BP to the (debug) rescue
Once again, the buspirate has saved my day. This is the buspirate I received as a 7400 competition price :-)

I've been working on a small flipdot controller which is supposed to talk serial, SPI and I2C all at the same time. Making serial to work is easy, but both SPI and I2C require properly formatted input streams to test with and are a bit more difficult to make out-of-the-box.

Luckily, the buspirate can do it all and enabled me to debug the protocols properly using no large expenditures. And, oh so much easier than hacking code for an ftdi module.
[attachment=0]
Today I'm all smiles ;-)

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01582485480session_write_close ( )...(null):0
20.01612617096ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01612617872Database_MySQL->query( ).../DatabaseHandler.php:119
40.06242756624Database_MySQL->error( ).../Db-mysql.class.php:273