constant current

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I'm trying to make a constant current source.
The setup is as folowed:
I measure the output current and if it exceeds 2Amps I make a pwm signal high so it turns of the control IC
I thought it will get to a stable situation, but it is very instable.
I think this is caused by the way I turn on the pwm signal. but I don't know how to make it better I tried several things
I use a attiny24

My interupt is done every 1msec and than the pwm and ana1 are read and write.
I have tried to raise the speed of the interupt but this is not working also.

Can anyone help me or give me a push in the right way?

Thanks Patrick

Main:		ldi		temp0,$00			
			mov		pwm,temp0	;load the pwm output (PB2) with 0V
			mov		temp1,ana1	;move the content of the AD into temp1			
			cpi		temp1,overI	;compare ana1 with overI
			brcc	constantI	;If ana1 is higher than overI jump to constant I
			rjmp	main				


constantI:	ldi		temp0,$FF
			mov		pwm,temp0	;load pwm output with 5V
			mov		temp1,ana1	;update the AD of ana1
			cpi		temp1,overI	;compare ana1 with overI
			brcc	constantI	;If ana1 is higher than overI jump to constant I
			rjmp 	main
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps the current-limiting section of the Tuxgraphics AVR-based power supply design can give some hints.
http://www.tuxgraphics.org/elect...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you are using a simple bang-bang servo rather than a PID loop, you probably need a dead-band to stabilise the system.

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here, I believe, is an example of the case whereby anal is higher than ovaries. Most of the time, it's a pretty close call.http://ppstorage.free.fr/WhyNot/Ugly%20American.jpg

Four legs good, two legs bad, three legs stable.