AnimeMembers
Watch Wes Work
Watch Wes Work

patreon


Any electronics experts who could weigh in?

I'm building a tethered pendent for the log skidder robot. I need a constant current circuit for the proportional solenoids that can pull up to 3 amps. My plan is to use PWM from a micro controller and feed it into the positive side of an op amp. The other side will come from a shunt resistor. The INA2180A1 is a 20:1 shunt amplifier. I know I forgot a flyback diode, but does anyone see why this would not work? It's at the limit of my electrical abilities. 

Any electronics experts who could weigh in?

Comments

I think you should convert the robot into an automated snow plowing machine for the yard, it already has the beginnings of a plow blade. The winch? I guess it could act as a remote control towing and winching machine, otherwise it would get bored in the summer. Hopefully the lovely assistant will not mind. Can’t think how you could get it to bleed brakes, you might still need the hufflepuff break bleeding service for that?

Richard Pruen

In addition since the coils are known, you can delete the feedback resistor once you have the circuit set up and pwm frequencies and pulse length set. A particular duty will always give the same current as near as makes no difference, the feedback resistor will let you know if the wiring is bad, or the shuttle is stuck, or if the current is not as expected the hydraulic system has issues (no fluid causes the shuttle to move more freely and you will see spikes where it interacts with the magnetic field)

Richard Pruen

I’ve done this before and getting fine control is tricky, you don’t want constant current exactly. The induction plus a fly back diode setup will work, the mosfet charges the coil, and the current flows via the diode, if you want closed loop, add a current sense resistor. Tune the pwm to give near constant current, but leave the frequency low enough that there is a little drop off, this means the magnetic field starts to decay, so the shuttle in the valve begins to move, the next pulse moves it back. The variation is tiny, but means the shuttle doesn’t suffer stiction. For finer control at low openings you need to lower the frequency, as there is less force to keep the shuttle moving, the pulses need to be longer. They are still fast enough that the inertia in the hydraulic fluid keeps the flow steady, you can then get way better fine control. The other option is to fit 2 extra solenoids, those bypass the drive motors with an orifice, so say half the oil bypass the drive motor, halving the speed, you can then open the valves more and still have a creep mode.

Richard Pruen

Thanks. I thought I had committed some unspeakable misdemeanour.

Peter Facey

a lot of comments are hidden until you click 'show more comments' a few times, I can see your other comment, about a solar panel circuit

Wouter Visee

Did someone delete my earlier comment? I don't think it was rude or irrelevant.

Peter Facey

Wes, just a note to explain this "Constant Current" business.... You could manually drive the Solenoid with a variable resistor, but it would be rather inefficient. Especially so if you wanted to generated a analog voltage from the micro to control the FET (the FET would get very hot). So instead we use PWM (with the FET switching hard On and Off). When the FET is On, the current through the Solenoid ramps upwards exponentially towards 3 Amps. Then when the FET is Off, the current decays exponentially back towards zero. And if the duty cycle of the PWM signal was at 50%, then the average current would be somewhat less than the 3 Amp maximum. So at any particular duty cycle, the "average" current will be all that the solenoid sees. By switching the FET in digital On/Off mode means that the power dissipation will be quite low. But understand that while it is a constant current at each setting, the value of the Constant Current will change (in order to control the solenoid). In other words it's a "Variable Constant Current". It might be that at the 100% duty cycle point (eg fully On), the Solenoid is quite happy. In fact you might need the 100% point to get full control of the solenoid. Regarding the flyback diode: If you just use a single FET (which is active low), then you will need a flyback diode to suppress the large inductive spike which could kill the FET. Alternatively you could use a high voltage Zener to clamp the spike. The usual reason for a Zener is that a normal diode causes the solenoid to be "Slugged" eg it will give slow release time as the current slowly decays. Better still is to use an Active-High/Active-Low (eg Push-Pull) output stage, so that the solenoid is clamped either high or low, so that the Inductive Current is always ramping up or down, thus giving a better constant current. The choice of PWM frequency would be whatever is high enough to prevent chatter.

Graeme Zimmer

Wes, hook up a 555 IC with a pot as a manual PWM generator, and use it to drive the FET. Rather than a flyback diode, use a largish Zener to clip the inductive spike. https://www.build-electronic-circuits.com/555-pwm-circuit/ If you choose a suitable low audio frequency for the PWM, it will cause a basically constant current to flow through the solenoid. Too low frequency will cause the solenoid to chatter, while too high will cause heating. Whatever, the setup will give you an idea of the range of PWM needed to control the solenoid, and also the max needed to protect the solenoid. You may not even need the upper limit. Depends if it gets hot at 3 Amps.

Graeme Zimmer

Wes, surely you actually need variable current, but with a preset upper limit to protect the solenoid?

Graeme Zimmer

I just sent you an email from your contact page.

Kevin

That is possible, but it will not give constant current.

Watch Wes Work

Because VHF aircraft coms will be vertically polarised, a simple Ground Plane antenna will be easier to build. Strip back the coax for 1/4 wave and connect the screen to four radials.

Graeme Zimmer

Use an online calculator to find that a half-wave at 120MHz is approx 3.9 ft.

Graeme Zimmer

Depends on the designer. Younger designers with an academic background will instinctively reach for a simulator. Older designers will more likely reach for a CRO and a soldering iron. Horses for courses.

Graeme Zimmer

After educating myself on prepositional solenoids, I think I have a better idea on what you are trying to do here. It looks to me that you could use a very simple circuit with an Arduino Nano set up for PWM that drives the mosfet directly. Here is a link to how this is setup: https://1.bp.blogspot.com/-KJn7qilngr8/X4Uhaq1pC5I/AAAAAAAAAhs/-qsiRInlVzM4WQWpckOBKY0vq-ThzxpQgCLcBGAsYHQ/w640-h564/pwm%2Bled%2Bschematic.jpg This board is setup with a LED that would be replaced with your MOSFET. The pot gives you infinite control, but if you wanted something like 3 different outputs you could use a 3 position switch with 3 different resistors. If you still need some kind of feed back to prevent drift due to thermals that can be done by adding a thermistor to the circuit that could be used to vary the PWM according to the temperature. Obviously this will take a lot of bench time to fine tune the circuit, but for me, that is where the fun is. If there is anything I can do to help, I would love to. This kind of project is exactly what I do for fun and stay active. What are your thoughts?

Kevin

You’re asking the wrong guy.

Bill Scott

I agree with Raphael on the direct PWM drive of the coil. In my opinion, it should also be viable with current control. I work for a company that designs industrial VFDs and switch mode powersupplys. Usually, the MCU drives the MosFETs through a driver chip via a PWM output and gets feedback via an ADC. All the control/ regulation is accomplished on the MCU. For power factor correction circuits (PFC), the duty cycle of a boost mode convertor's inductor is regulated as described above, to provide a sinusoidal load current for the 50/60Hz mains. To achieve that, the inductance provides current smoothing through its inertia, as it is the electrical equivalent of mechanical mass. So a PWM controlled current through an inductor would be similar to an RPM controlled flywheel on a hit-and-miss engine. Current being analogue to angular velocity or RPM, and flywheel mass equating inductance. I assume your hydraulics are quite a bit slower than the aforementioned mains cycles, so setting the current by driving the coil with the PWM and regulating it in software by providing a current measurement to the controller should be possible.

Jens Wieland

It's all surface mount which is hard to play with.

Watch Wes Work

We wire all sorts of pendents and VFD's to control the custom overhead cranes we build. I'll ask our head electrical magician tomorrow morning about what he thinks it'll take after I show him your diagram.

c vitt

Ha, maybe you can scavenge something from that omnex control box

Ed W

I used to be more of an expert on drivers and motor controllers, but I think you can use any dc motor controller on that solenoid. Adafruit, sparkfun, pololu, should have breakout boards with all kinds and sizes of motor drivers. Many of them I bet will have i2c and Arduino libraries so you can control them without having pwm, this would be my preference.

Ed W

You might join this group if you want expert critique on your electronic projects. I just look at the pictures there. The guys that belong have worked in the field since vacuum tubes, transistors, ICs and colliders. https://www.facebook.com/groups/253864931469516/

WILLIAM gilbert

You could generate the PWM signal within the micro, while monitoring the analog current (voltage feedback) and limiting the range of the PWM to suit. This would use less components, but has the serious limitation that if the micro locks up, the solenoid could be burnt out. It would be more reliable to use an external Analog to PWM converter, while using an analog circuit to monitor the current drawn, and use that to limit the PWM range of the PWM generator. The is the basic methgod used in any of the PWM generator chips. Have a look at the data sheet for the classic TL494 or the more modern LTC6992 There are various PCB modules on ebay so you could mock one up. There is a huge amount of info on line regarding the TL494 see https://www.ti.com/lit/gpn/TL494

Graeme Zimmer

Well, technically there is feedback, just not to the microcontroller , but to the op amp ;-) But ether way I guess constant current is what you want to ensure a constant flow rate on the valve. What i actually wanted to say is, maybe check if the solonoids have an integrated encoder, which a lot of them have, to give feedback directly to the controller and adjust the pwm based on the encoder feedback.

Raphael Schwarz

There is no feedback, but the flow should be directly proportional to current. without current monitoring I think it will drift as the solenoid heats up.

Watch Wes Work

It's a proportional hydraulic solenoid. So more current = more flow = more speed.

Watch Wes Work

The op amp should handle the feedback. I want a constant current output that is proportional to the PWM duty cycle from the MCU.

Watch Wes Work

Wes, maybe it would be helpful to explain what the solenoid does as that is the part that I don't understand. Once I understand that part, I think the electronics is going to be easy.

Kevin

I noticed you don't have pin 4 connected to ground. Another thing is that if you use a Arduino nano, you can use 12v for every thing and not have to worry about the 5v. I guess I don't understand what you are trying to do here. You have and analog output connected to the positive side of the op amp, but there is no feed back to the micro controller to control the analog output. Am I missing something here Wes?

Kevin

I am guessing we are talking about the Solonoid on your proportional hydraulic valves. All the ones i have come across could be controlled by a simple pwm signal. So a Mosfet and maybe a mosfet driver should do the trick. Electronic feedback i think will be of little use. But most of the proportional valves i have used have optional encoder outputs if you really want to control the flowrate that precisely.

Raphael Schwarz

Funnily enough your circuit is almostr identical to one I used to load a solar panel. https://www.dropbox.com/scl/fi/zk93mjp1gt0uw35kijbxx/solar_test_circuit.pdf?rlkey=w08a6s0okh7vftw8vw8rlaafr&dl=0 I had to add the components in red to stop it oscillating!

Peter Facey

Depends on what the 'solenoid' is, or why you need the constant current regulated, If it really is a simple solenoid, you could probably ditch the entire current measurement and opamp part and 'regulate' the current with PWM. If you need to regulate the current and PWM'ing the mosfet (which is indeed a LOT more efficient) you will also get the same PWM current on the measurement which makes your feedback useless, since it will try to regulate the 'ON' down to 0A, and the "OFF' up to 3A. So either make a circuit all analog (and put a big heatsink on the mosfet) or make is all digital in case it gets a lot harder if the solenoid needs the feedback. My best guess then would be measure the current via a filter and feed it back to the micro so the micro can adjust the PWM value to match the output current.

SA007

I should add - still use the PWM for control, but use the power resistor for the current limit so you stay under 3 amps at 100% duty. Have you experimented any with the solenoids? Might take your current-limited power supply, set it to three amps, and go directly across one of the solenoids. They might be internally limited to 3 amps and you don't need the current limiting.

Benjamin Hall

Roger that. If they didn't drift over time too much (had a fairly constant resistance) and that 3 amp limit had a loose tolerance...a power resistor could be used to limit the current rather than something active like you've got there. IE: say the alternator runs the system at 14 VDC, a 5 ohm resistor (50 watts) would keep you under 3 amps even with the MOSFET at 100% duty. (you could add in the coil's resistance and the RDSon of the MOSFET to get you closer to 3 amps)

Benjamin Hall

Nice circuit but can't you just PWM the mosfet and let that be it? You're not building a telesurgery robot here :)

Wouter Visee

I don't have a sheet on them. All it says is they are current driven. I could just give them a constant voltage, but I think they will drift as they warm up.

Watch Wes Work

Got a datasheet on the solenoids? I'm unfamiliar with how they work and are controlled. Seems like there should be a simpler circuit than the above, but not knowing more about the solenoids I'm not much help (but would like to learn). FYSA - bought all the books you recommended in your recent video on holiday gifts. :)

Benjamin Hall

OK. I could add that. I think PWMing the solenoid is actually good though. Dithering they call it. Though the MCU frequency is probably way too high to actually dither my chunky solenoids.

Watch Wes Work

No expert in any shape or form but if this doesn't work, constant current drivers are pretty common in led applications, maybe you'll find an IC there...

Anditainment

If you go to OReilly's website and enter part number 121g, that might help. Other than that, I'm useless.

scottgm321

Just having a PWM output isn't enough, you need a low-pass filter between the micro and the op-amp, otherwise it is goint to try to PWM the solenoid. Maybe womething like a 100kOhm between the micro and the opamp and 100nF between the opamp input and ground. Search for 'pwm to dac' for more examples.

SA007

Its at your limit. Its far beyond mine lol.

Darran


More Creators