0

I’m designing a circuit to control 4 electromagnetic coils and subsequent orientation of a sphere (pic attached below). I’m new to EE but thanks to this forum I’ve learned what and how to utilize PWM signals. I plan on using a L293D shield to send current to the coils; however, I need to be able to limit the current to the coils. The optimal current I need to send should be +/- 300 mA. Per the datasheet the L293D outputs 600 mA max.

My question: Can I simply regulate the current to the coils by the speed function in Arduino?

If not, can I set up my circuit and regulate current using resistors like in the attached pic?

I feel as though I’m underthinking the process. I’d appreciate if anyone could let me know if I’m on the right track.

*note: I’m using an H-Bridge to reverse the direction of the current and thus polarity of the magnetic field to tilt the inside sphere up/down. The servo motors in the picture attached is to simulate coils.

*I plan on powering the L293D w/ a 9v power supply.

coil pic

position pic

toolic
  • 5,637
  • 5
  • 20
  • 33
  • 1
    [Problems with L293, L298 and SN754410 H-bridge drivers on a low voltage supply](https://electronics.stackexchange.com/questions/108686/problems-with-l293-l298-and-sn754410-h-bridge-drivers-on-a-low-voltage-supply) - if you can find a better shield I would. – Andy aka Feb 20 '22 at 19:02
  • I read some of the link you replied with. I don't see how this would apply as I am not going to be needing to operate near 1A. I would like to operate at approximately +/- 0.2A. I'm just trying to figure out how to control the amount of current feeding into the coils. – Cuddisaveslives Feb 20 '22 at 19:21
  • but the L293 is not a good chip if you need any kind of current control. So, yeah, find a better shield. 600 mA is not *that* little, and losses in the ancient (it's not only slightly oldish, this chip is ancient) L293 do matter here and make anything harder than necessary. – Marcus Müller Feb 20 '22 at 19:24
  • What is the coil resistance? Inductance?? 0.2A^2 *2 Ohms(est) is only 80 mW per driver which is no sweat – Tony Stewart EE75 Feb 20 '22 at 19:31
  • I apologize for my misunderstanding. I'm an ME major and need some EE knowledge to complete a project. You're saying that if I want to have any sort of current control I need to find a shield that has that feature? I initially thought I could operate my design how one would operate motors on an RC car. Instead of controlling the speed of the motor, I could control the 'speed/current' feeding into the coils. – Cuddisaveslives Feb 20 '22 at 19:31
  • will your coils create the required motion? is is that unknown?.. Current controls torque and thus acceleration, not speed – Tony Stewart EE75 Feb 20 '22 at 19:36
  • To make a servo, you need some form of feedback – Tony Stewart EE75 Feb 20 '22 at 19:39
  • The L298 (like on the shield I Iinked earlier here: https://electronics.stackexchange.com/questions/609040/can-you-replicate-a-trimpot-with-a-555-timer/609041#609041)has a provision for current sensing. You would monitor this with an ADC and adjust the PWM accordingly. – hacktastical Feb 20 '22 at 19:51
  • Thanks for responding to my previous question as well as this one, I appreciate it. Per you advice. I'm going to look into the L298. – Cuddisaveslives Feb 20 '22 at 20:35

2 Answers2

0

Well, you have a couple of things to think about. Firstly, your load is inductive as you mentioned. This means that the current feeding through the coils can't change rapidly (which is why PWM works so well). But if you take it back to the basics, this means that the "resistance" of the coils change if there is a big change in the current flow (read up about inductor step response, and/or frequency response).

So, if you want to hold the coil at a set current, then yes, in theory you could estimate that coil to be a set resistance (you can measure the equivalent series resistance with a multimeter). But, this "resistance" will change if you try to increase/decrease the current.

Ok, but let's work on just the holding current. You could use resistors, but the extra energy would be wasted as heat (P=VI, where P is the heat generated, V is the volt drop over the resistor, and I is the 200mA flowing). So you need to then choose resistors with good enough power ratings. I estimate you likely will need around 1W resistors or more for this approach to work. But then you need to remember that it is only for the holding current, and will change if you change the PWM signal.

Using just the PWM is probably a better approach, but you end up with the problem of not knowing how much current is flowing. You can calculate it probably, but again, you need all the parameters (the ESR of the coil, wire losses, etc)...

As some suggested in the comments, I also think the best approach would be if you go for a better driver chip that has built-in current sensing capabilities :)

TheMAX135
  • 137
  • 6
  • Wow thanks for the responses everybody. I read something about current sensing but was a confused and thus brushed it over. I will read more in depth into current sensing and which chips have it. I'll double back to this thread if I have any further questions. – Cuddisaveslives Feb 20 '22 at 19:51
  • Much details are missing about your application, such as, what are you controlling and does your installation have some kind of feedback information to let the controller know what is the final position. If so, you could implement a feedback tied to the PWM function which would eliminate the need to monitor the current. Using a resistor to limit to 300mA would eliminate the overloading concern. – Fred Cailloux Feb 20 '22 at 19:59
0

Knowing the impedance of your motor would help for calculations. Assuming that it is a little coil which could exhibit an internal resistance of, say, 10 ohms when energized, then we can calculate that a resistance of 20 ohms would be adequate to limit the current consumption to 300mA. 9 volts / 300 ma = 30 ohms. Minus the internal 10 ohms you find a net value of 20 ohms. Since you are dealing with relatively low power ( 0.3 X 0.3 x 20 = 1.8 watts ) it is adequate to utilize a resistor to limit the output current.

Since this is not a motor but a coil it is likely that your coil will maintain a relatively constant impedance even if it gets a slight temperature elevation. PWM is a great way to limit the output current and it has the advantage to save some energy. However it involve a bit more precautions in the microcontroller programming.

One could save lots of time by testing the final circuit and measure the current consumption .vs. PWM% . Then you adjust your program to limit the PWM% such that the current never exceed the desired 300ma. If you make a mistake in the software PWM maximum value you can end up burning the coil. Such a situation is impossible with the proper resistor. Just make sure you are utilizing the adequate resistor power and adequate heat dissipation for a 2 watts resistor, which is not much. A 2 watts resistor with a little space from the circuit board is usually quite adequate. In free air it is also OK.

Furthermore, It is quite likely that the coil deviation will most probably be a linear function of the current. Which means that it is possible to construct the micro controller algorithm such that the PWM% is a direct relation to mechanical deviation ( but that remain to be tested ), at least, if not a linear function it is a repeatable relationship, which imply that it could be imbedded in the algorithm. Obviously, this assumption is true only if the load on the mechanical apparatus is not variable.

It is my opinion that both PWM or resistor approach are adequate. I would tend you go with the resistor solution for you are absolutely guaranteed to never exceed the maximum current. Of course, both configuration are compatible. You can play safe with a resistor and utilize PWM for the coil magnetic control.

To answer your question: You are totally on the right track.

Fred Cailloux
  • 799
  • 7
  • 15