Current limiting through h-bridge IC

I have been learning electronics on the fly, partly from EEVBlog and other sources.
I am also a part time knife maker, where I have had the requirement to etch metal.
This process is normally accomplished with DC 24v at about 1.5A current to remove metal, and then switch to AC to darken the etch. This is done using a piece of felt dipped into an electrolyte, generally salt water. Anyhow: works ok with my lab PSU for DC and then switching to a big block transformer for AC, but then thats not a fun integrated solution is it :slight_smile:

SO: I’ve begun, through trial and error and magic smoke, to design a microcontroller based version of this which would allow me to switch from AC to DC and also alter output voltage. Thus far, I have finished the variable DC voltage part, but am now facing an issue where I would actually like to prevent the circuit from going above 2A output, whether its in DC or AC. By that token, I also want to prevent the system from failing due to a short of the 2 output leads.

I have drawn what I have built in Eagle, and I am attaching a screenshot of my circuit thus far (I have mediocre Eagle skills to this day).

Could anyone comment on what I could do to impose a max current of 2A along with shield this against shorting the leads?
Somehow I dont think controlling current via code would be timely enough as opposed to hardware control. Perhaps that perception is wrong however…

Firstly that H-bridge already has short-circuit limiting at about 10A from what I can see.
Using a simple series resistor on the output can give a crude and simple current limiting, perhaps
10 ohm 30W would be good.

You have various mistakes in the wiring of the LMD200 which it will not tolerate well...

It requires 1uF ceramic + 220uF electrolytic decoupling from Vs to ground if you are going to use it to 2A

You forgot to wire the brake input to ground, so it'll be braking at random

You can add a current sense resistor to pin 8 and monitor the current

Your bootstrap capacitors C2, C3 are labelled as 10pF, not the required 10nF indicated in
the datasheet.

Your voltage dividers are useless, the output voltage will be 24V or 0V depending when you
sample it. What are you trying to sense with the ADC for the DC case? For the AC case?
Why not just sense current instead?

Also you haven't posted any code. Be aware that the bootstrapping nature of the LMD200's
internal circuitry means that if fast PWM is required, it must not have too high
a duty cycle. However for slow switching (say 100Hz or so) the internal bootstrap circuitry will suffice
without problems due to switching losses.

[ actually, thinking some more, you could, if using current limiting resistor, sense the voltage after
the resistor, that might be useful.

Anyhow: works ok with my lab PSU for DC and then switching to a big block transformer for AC, but then thats not a fun integrated solution is it

Your lab supply is probably current-limited. Is there an adjustable current limit? ...A power supply with an adjustable current limit would be ideal. I assume it has an ammeter ("amp meter")? It's not easy to build a power supply with current-limiting so it's best if you can power your H-bridge from the lab supply.

Then, you'd just need to make sure the H-bridge is "over-rated" to withstand the worst-case current.

A regular transformer will simply burn-up if you short it or "pull" excess current for too long...

I'd imagine the biggest "danger" is a short circuit during set-up or removal. Maybe make a blinking LED to remind yourself to turn-off power before moving things around. (A good lab supply should withstand a short, but I'm not sure about the H-bridge because the current-limiting may not be instantaneous.)

Or, if a resistor doesn't mess-up normal operation too much__* a resistor is a foolproof current limiter.__

BTW - I'm surprised you're getting 1.5A at 24V! There must be a LOT of salt in the water and/or the knife & plate(s) are VERY close together!

* A series resistor along with your regular plates & electrolyte setup creates a [u]voltage divider[/u]. So for example, if the resistances are equal the voltage & current to the etching bath would be cut in half. If the resistor value is low compared to the bath-resistance it will have little effect during normal operation.

For one thing, you are posting for help with the LMD1820 application and have not posted the datasheet, which , if you read it, shows a
2.7k ohm resistor connected to pin-8 of the LMD1820. If you read page-8 (coincidence) of the datasheet,
it says pin-8 is the current sense output (377ua/A), (through the 2.7k ohm resistor). So , if you know
Ohm’s Law, you know that V = I*R, so if you:

Let R = 2.7k ohm
Let I = 377uA = 0.000377 A
Let I10A = 10* 0.000377 A = 10.179 V

So that tells you that if you connect the 2.7k Ohm resistor as shown on page-7 , (which means you have
to cut the trace going to pin-8 on the breakout board) then you will have a 0 to 10V analog Current signal
that can then be processed to detect 2A, using a simple Level Detector, (or more directly, an arduino analog input to detect 2V on that line, which corresponds to 2A current).

Why all the breakout boards (retired) online have the current sense connected to GND I cannot say , but if the current sense output is simply a low level variable current source (0 to 3.77 millivolts), which
is too small to measure directly with the arduino analog input, hence the need for the 2.7k ohm resistor
(shown in the schematic on page-7 of the datasheet) to convert the current sense voltage to a 0 to
10V output. Since 10V is too high for an arduino running on 5V (double in fact), the resistor would have
to be half the value shown in the schematic, (1.35k), which would output 5.0895V at 10A.

So where are you exactly in your development phase ?
Do you have anything more than a schematic ?
Do you have any parts ?
Have you built anything ?
Have you tested anything ?
What exactly do you have ?
What exactly have you done ?