2015. május 31., vasárnap

CNC motor driver 10. - Logic Psu build

Yesterday I soldered the parts into the board, I realized three mistakes, what I made.
  • The designed connectors are bigger, than what I wanted. So I 'll have 3,96 mm spacing connectors, instead of the 2,54 mm ones.
  • Drilled a 1,5 mm holes for the connectors instead of the required 2 mm ones. Fixed easily.
  • There is an additional LC filter at the output of the circuit. I designed a 100uF/6,3V B size tantalum capacitor into it, but I bought 100uF/10V D size ones. I was thinking. If I not solder this now, will this prevent me from trying the circuit out? Not. So I just keep it this way, and buy new caps on Monday.

As I finished the build, I wanted to test it. I was specially interested in the noise generated by the circuit.
As I had no cap in the output LC filter I soldered an old 100uF cap directly to the testing 470ohm load resistor, and tried to figure out the noise generated.

It was so low that I can't find it in the enviromental noise picked up by my oscilloscope.

And finally the output voltage is good enough.

2015. május 30., szombat

Bench Power Supply Repair

Starting yesterday evening, continuing today morning, I tried to repair the power supply.
I can tell, this was a really strange experience.
I wasn't able to find a service manual, or a schematic for it, so I needed to jump into it blindly. Opened the box. It has a huge toroidal transformer in the center, a board with two big heatsinks, capacitors, power transistors, and rectifiers at the back, and two stacked boards screwed to the front panel - this is are the control boards.
As I have no schematic drawing, I tried to isolate the problem. My first idea was, to change the connectors on the two, electronically identical (I guess) sides. With this I can localize the problem - controller part or power part.
Every attempt I take to switch the sides was failing. When I switched the connectors, the controller was working, but the channels hasn't started. Then I found a single transistor (or a dual diode, I don't know) connected to the power board with a connector and not soldered in. When I disconnected, the relays of the dead channel started to work. Switched slowly, but worked. Reconnected the device, and the relays still worked. The channel, came back to live.
When I switched off and on, the output switch, it the originally dead channel was always working, but switching on, was much slower that the good ones. After switching it on and off several times, the channel became as fast as the other.
Strange. The power supply is totally functional now.

One thing became clear. In the near future I'll have to buy or build a lab power supply, because this is not a satisfactory situation.

2015. május 29., péntek

CNC Motor driver 9. - Miscellaneous things

In the last weeks the project not advanced so much, but various things happened around it, what I want to write about.

Logic PSU
In the mean time I designed the test circuit/board for the power supply of the low voltage parts of the circuit. The MCU, the measuring amplifiers, the display will run from 3.3V (I planed to use 5V supply originally, but the display I'm using is not able to run from it). This supply finally not as cheap I wanted to have. It was clear that I need a switching mode supply, and a chip with high voltage capability. I know that a few hundred milliamps is not to much, and the whole circuit is powered from the mains and not batteries. This is a good candidate for some three leg standard regulator or LDO, but...
Always, that but.
the whole circuit will run from a single 48V supply. Generating just 100mA with a standard regulator means you have to dissipate 4.47W on the regulator. In addition the standard three leg regulators are not designed for 48V input voltage.
So the decision is to use HV buck regulator. Especially the LM2594HV-3.3 model from TI.
I designed a circuit around it:

And a PCB for testing:

The finished board (population come later):

MCU Arrived
When I started this project I selected Nuvoton's M054LDN for it. It has 16+4K FLASH what looked enough to me. I have an M0516LDN based development board in my hands, so I started to write the code on it. As the project advanced it become clear, that the code will not fit into the 16K. There is two factor behind it: the character table used for the graphic display, and the floating point library used by the PID controller.
But there is a problem. At the local reseller I just found the M054LDN and the M0516LAN and not the M0516LDN. This A instead of D means something here. It is the revision of the device. Together with other changes the rev D. has FIFO capability on the SPI interface what I'm extensively using for the display driver, and really don't want to throw it away.
So I looked around, and found what I needed on the AliExpress.
It arrived also this week:

There is some comments on the Hackaday.io page of the project from Andrew and Hacker404 about suggesting to use Back Electromotive Force to measure the rotational speed of the motor without sensors as a more standard approach, than the one I used. Here is two article explaining this technique:
As I decided to keep developing the controller based on my idea, really think this as something worth to try.
Here I collected the advantages and disadvantages of BEMF against my techniqe:
+ Way much simpler circuitry required for the control and measurement
+ Lower frequency can be used for the PWM control what decrease the switching loss and increase the possible precision (at 10kHz with the same MCU I can achieve 2500 steps instead of the current 250)
- Less precise measurement. There is several factor reducing precision (noise, measurement timing, calibration requirement)
- Calibration requirement at the enduser. With my method you just need to find out the number commutator segments, and you ready. With BEMF, you have to go through the entire rotational speed range and match the measured voltage with a measured rotational speed (optical encoder, hall sensor, etc.)
- Noisier operation. The motor running from low frequency square wave produce more noise than running from clean DC.
- Not possible to use 100% duty cycle. Need time for measurement.
Anyway. I think it worth to try this method, after finished the current one.

2015. május 28., csütörtök

New win!

It looks like I've my lucky days now. SOS Electronic who is a regional electronic parts distributor, just notified me:

"Dear valued customer,
thank you for your interest. I´m glad to announce you, that you´re one of winners of the new SHT31 sensor. Please let me know which version you´d prefer as a free sample (analog or digital). "

I went for the digital. Waiting to arrive.

We are talking about this puppy:

I just hope, it will come on a breakout board, otherwise I should enhance my QFN soldering skills.

CNC Motor Driver 8. - V2 Testing

On the weekend, I finally get to run the first test on the V2 MOSFET driver.
I just connected it to the bench PSU, and the MCU, added a resistive load (a 470Ohm/5W resistor) to it. Switched on, and...
Nothing happened.
Looked around, trying to find the error.
On the input, the PWM signal was there.
On the low side small FETs the signal was there.
On the MOSFET's gate... nothing was there.
I turned the board to see the soldering side...

After soldering the MOSFET and the diode, it started to work perfectly.

Bench Power Supply - Died

My Bench Power Supply died today. I tried to work with it and the CH2 went to CC mode immediately. When I turn the knob on it without load I can measure maximum 0.5V on it.
I've to find a schematic diagram for it (or just try to repair without it).

2015. május 25., hétfő

CNC Motor Driver 7. - New giveaway

It looks like the jury of the Hackaday.io likes my project. A new week passed by, and I received a new giveaway from them. I got a $50 giftcard from the Shapeways. I still think what can I do with it now. Actually as my 3D Printer is nonfunctional, it should be spent wisely.
As Mike Szczys from Hackaday said:
"I hope you'll use for your Hackaday Prize build"
I was thinking, what would be useful specially for this project. Than I decided. The controller will be fitted into the original control box of the CNC machine. Because it will require some metalwork to fit in the large display I intend to use, and the metal cutting in this case will involve some hand tools like my Dremel, it will produce not so nice looking edges. This should be covered somehow.
So I'll design, and order some custom made plastic frame for my display to get a nice look after the metalwork.
And again, encourage everybody with bright project ideas to build and share on Hackaday.io. You will not regret it. Good for you, good for the community.

2015. május 18., hétfő


Some time ago I stopped to use cheap mostly Chinese multimeters. For most of the guys who is working with electronics it happens time to time, that something is required to measure around the household mains supply.
Anybody, who think this kind of multimeters, are good enough for them, definitely should see this video:

2015. május 15., péntek

CNC Motor Driver 6. - WIN!!!

This project is also available on the hackaday.io. And I also submitted it to the Hackaday Prize 2015 competition (this time I intend to finish this project, not as my last year entry).
The Hackaday is giving away things to the participants of the competition every week. This week they given away 125 Teensy LC board for the participating projects.

And, I'm one of the lucky ones (maybe not lucky just my work is soooo good - joking).
Anyhow, it is great, thank you guys!

And, I encourage everyone, who fill that he/she works or would like to work on great projects/ideas, to register on hackaday.io and share his/her work there.

2015. május 14., csütörtök

The Grid

This is one of the biggest scam of the internet era, or the solution for my never done, never worked websites. I intend to find it out.

Thay claim to build websites based on AI technology instead of army of designers.

2015. május 13., szerda

DevEnv - LightUp - followup

It looks like my previous problems with LightUp gets handled.

Two days ago a Kickstarter update come. Two major things in it:
  • The public beta of the LightUp Code what is basically Scratch for Arduino what supports the LightUp MCU and in addition Arduino boards
  • The new Faraday Kit what contains the new LightUp MCU modul, what is programmable through Bluetooth. It looks like an iPad will be enough for programming, no desktop and driver hassle needed anymore
And yesterday also the new Kickstarter campaign for the Faraday kit started, what I put on the right side in the blog also.
Well done guys!

2015. május 8., péntek

Router repair

To be honest, I've confusing thoughts about repairing various electronics equipment. Some of the people tell, just trow away what is stopped to work. Others tell, to repair everything. As I see the world goes to the first direction. Less and less electronic equipment gets repaired. It is just not the cost of the repair, but also energy efficiency issue. I'm somewhere between this two. I think we should consider each time, various factors.
To the people who say throw away and buy a new one:
What if we have a Wi-Fi router. It aged, but not to much (already Wi-Fi N based). Likely 3-5 years old. A new one costs $50-70. Died. Low cost, throw it away.
What if? The problem can be identified with just looking on the board:

and the repair costs ~$0.2 and 10 minutes work?
The dead cap - originally 680uF:

By the way. May I ask the dear manufacturer why a hack they are using the cheapest crap capacitor in the most critical part of the circuit?
The 20 cent is the price of the cheapest crap at the local store, but...
You can get a Panasonic with 8000h endurance for 15 cents/piece in 1000 pack at Farnell (what is not cheap).
Cap changed, router works.

2015. május 5., kedd

CNC Motor Driver 5.

I planed to build the new motor driver during the weekend, what unfortunately doesn't happened. It took an additional week. What I want to mention here, that together with the motor driver I also designed a new measurement circuit. This one is able to measure not just the rotational speed but the current (it was also in the previous but untested) and the voltage of the motor. In addition I included the necessary protection diodes what was left out from the previous one, and a configurable fifth order low pass filter to test the filter for the final design.

Here is the schematic diagram:

And the PCB design:

The first weekend achievement - etching the boards and collecting the parts:

A week later - the boards cut, populated:

The next things to come (not necessarily in this order):
  • Test this two boards
  • Design a home made pcb for MCU+Display
  • Add additional filtering into the adjustable DC
  • Design and build the last missing piece - the high voltage input 3.3V PSU
  • Test and tune the PID controller code
  • Move to the final PSU from the lab supply
  • Put everything together - write the code for the rpm setting from G-Code
  • Write the code for the voltage/current/power measurement
  • Design and order the final boards
  • Build everything into the original controller box