Author Topic: Microcontroller adjustable constant current PS  (Read 5438 times)

0 Members and 1 Guest are viewing this topic.

Offline meisterlumpiTopic starter

  • Newbie
  • Posts: 2
  • Country: de
Microcontroller adjustable constant current PS
« on: October 02, 2016, 09:57:59 am »
Hello everyone,
I have four semi-active shock absorbers I'd like to control. They have a valve build in which regulates the fluid throughput (open valve -> soft dampers, closed valve -> hard dampers). The valve is an inductive load and its throughput is controlled by the current going through the coil (low current -> small opening, high current -> big opening).
The current range is 0.3A to 2A (for each shock absorber) at 0V-1.5V. I'd like to be able to set the current in .1A steps and a precision in the ballpark of 0.05A or better. I want to use it in the car so input voltage would be 11.5V - 14.5V.
The problem is, that the valve needs a current dither to end up in the correct position. Meaning the current has to oscillate with about 250Hz and an amplitude of about .2A. I want those values and the current itself to be adjustable via a micro or something.
I'm looking for something that might do just that job or something easily modifiable.
You can find lots of cheap const. current ps on ebay with adjustment potis (mostly LED drivers).. Would it be possible to modify those and hook up a micro for the current regulation? Would I need a feedback loop?
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Microcontroller adjustable constant current PS
« Reply #1 on: October 02, 2016, 12:35:48 pm »
You would need ~ a 6 bit DAC. A control loop, maybe PID, run by
processor. That implies feedback of course.

You can do all this and much more in a Cypress PSOC.

Cypress PSOC has ARM core, A/D (SAR and DelSig), DSP, logic fabric that can be used at
a GUI level or programmed in Verilog (much more important in future career), DMA, OpAmps,
PWM, COM, onboard Vref......see attached "component" list. In PSOC a component is a piece
of onboard HW. PSOC has LUTs and basic gates, counters, shift regs....you can either config
with GUI tool or program in Verilog. Tons of training videos, tool has many example project
solutions you can draw from. All components come with APIs you use in code to operate the
various components.

You can even design your own components, as well as program DSP engine in ASM to create
high performance custom DSP designs. DSP is a separate core inside PSOC.

Component list attached, as well as an example using DSP to filter a signal. Note this only used
a small %age of the resources, eg. one could have added a lot more functionality to the project.

Keep in mind you route the signals internally and to pins, with the GUI tool. its its own
breadboard, FPGA like.

SW tool free, low cost boards, $ 10 - $ 25.


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2587
  • Country: fr
    • kripton2035 schematics repository
Re: Microcontroller adjustable constant current PS
« Reply #2 on: October 02, 2016, 03:19:37 pm »
a microcontroler like pic or atmel will be too slow for a power supply feedback
there are examples like here : http://www.tuxgraphics.org/electronics/201005/bench-power-supply-v3.shtml
but they are known to be too slow for a PS
with an ARM like the post before, it should be faster.
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Microcontroller adjustable constant current PS
« Reply #3 on: October 02, 2016, 03:32:59 pm »
sure, if you want to stick with a pic16f84a :palm:

pic16f177x has core independent peripherals, you can use it as a programmable smps controller (there's an app note for that)
newest pic16 have ADC with core independent math package.. PID basically

then there are dspics

but it mostly comes down to your ability to code and expirience. if they are not that much you'd better go with an ARM or PSoC because with those you can use higher clock speed to compensate
 

Offline Andreas

  • Super Contributor
  • ***
  • Posts: 3248
  • Country: de
Re: Microcontroller adjustable constant current PS
« Reply #4 on: October 02, 2016, 05:43:41 pm »
a microcontroler like pic or atmel will be too slow for a power supply feedback

Hello,

even a PIC12F683 could do the job at around 250 Hz.
It has a comparator with internal selectable 24 different reference voltages (upper and lower current levels).
With the pin change interrupt you can switch the PWM output (bit-bang) and select the other of the two current levels.
The setpoint can be given by a potentiometer.

All you need additional is a external current sense amplifier like AD8203 or similar.

with best regards

Andreas
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Microcontroller adjustable constant current PS
« Reply #5 on: October 02, 2016, 10:30:37 pm »
The Cypress PSOC has the additional advantage of DMA and Verilog design of
the digital HW. So if you want a fully cpu-less solution, that can be done as
well by using the DMA, Verilog, and onbaord DSP unit.


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2587
  • Country: fr
    • kripton2035 schematics repository
Re: Microcontroller adjustable constant current PS
« Reply #6 on: October 03, 2016, 05:55:24 am »
an adjustable constant current PS can also be done without any microcontroler !
 

Online 2N3055

  • Super Contributor
  • ***
  • Posts: 6662
  • Country: hr
Re: Microcontroller adjustable constant current PS
« Reply #7 on: October 03, 2016, 06:14:38 am »
an adjustable constant current PS can also be done without any microcontroler !

And much easier at those currents and power levels...

OK question to OP:

You gave current and voltage levels, dither currents, set level precision.. That's OK, but what is the dynamic behaviour of set current.. Or how quickly the current has to change after you give it a command, and is it going to be used in some kind feedback loop type closed system, in which case it has to have defined bandwidth..
Is this some kind of vehicle suspension, maybe an active one ? 
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline meisterlumpiTopic starter

  • Newbie
  • Posts: 2
  • Country: de
Re: Microcontroller adjustable constant current PS
« Reply #9 on: October 03, 2016, 12:32:41 pm »
Thanks for all your great replies.

Dana, the Cypress PSOC looks really nice and versatile and I wanted to use an FPGA for something for a while now. I have little experience in that regard but the SW seems very beginner friendly.

kripton2035, I rather have something more compact than a bench power supply. So definitely a switch-mode supply.

2N3055, other than the dither, the supply does not need to be "quick". The constant current value needs to be adjustable but it does not matter if it takes 1ms or 2s to reach the set value. Yes, this is to control veh. suspension.

The "which control device to use" discussion is very helpful and interesting but the passive part of the supply baffles me even more.
I was hoping I could buy a constant current ps e.g. off ebay in a compact form factor and "hack" it. They often come with potis or buttons to set the CC and CV. Could they be replaced with a micro? Is the passive circuitry that controls the current output quick enough to handle the 250Hz dither and the .2A amplitude and what do I have to look out for. Should I use a separate current shunt for the loopback PID controller?
These question probably depend on the specifics of the supply..
e.g.
http://www.ebay.de/itm/8A-Automatic-Constant-Voltage-Constant-Current-Step-up-Step-down-Charge-Module-/191911886107?hash=item2caed6fd1b:g:l-0AAOSwzJ5Xd3uU

Something I found was that almost all of those 5-10 bucks supplies only go down to 1.2V on the output (Dave explained why that is in one of his power supply design tutorials), I need something that goes down to at least .5V.
Would you have suggestions what passive device I should base the project on?
 

Online 2N3055

  • Super Contributor
  • ***
  • Posts: 6662
  • Country: hr
Re: Microcontroller adjustable constant current PS
« Reply #10 on: October 03, 2016, 03:23:00 pm »
meisterlumpi,

do the damper coils need to be grounded?

If not, solution is very simple, won't cost much, and can be very good..

In that case you don't need current source but 4 current sinks, 5V power supply, and source of 250Hz (i guess sinusoidal waveform is needed).

If interested, we can develop it further...
 

Online Marco

  • Super Contributor
  • ***
  • Posts: 6722
  • Country: nl
Re: Microcontroller adjustable constant current PS
« Reply #11 on: October 03, 2016, 03:31:56 pm »
Meaning the current has to oscillate with about 250Hz and an amplitude of about .2A.

How much inductance does it have and how much resistance?

The power developed in the internal resistance and flyback Shottky diode are probably enough to let the current reduce that much in 4 ms, but I wouldn't assume.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf