The Godfather talking
You can run, but you can't hide.
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 29, 2024, 06:36:22 06:36


Login with username, password and session length


Pages: [1]
Print
Author Topic: 0-10V ballast controller with pic18F2525 PWM  (Read 5937 times)
0 Members and 1 Guest are viewing this topic.
LeoDorant
Guest
« on: November 07, 2010, 09:39:44 21:39 »

Hi,

Kindly a quick comment on the following project. I want to dim an electronic T5 ballast through PWM on a PIC18F2525. Ballast has +/- inputs and a "max 0.2 mA" label.

I've found a solution that looks something like: PWM -> low pass filter -> op amp -> output, according to Microchips AN538 http://ww1.microchip.com/downloads/en/AppNotes/00538c.pdf

I'm doing the PWM at 19.5kHz.

Now, would the attached schematics work for this purpose ? I cant get the simulation in ISIS to output anything useable. I just get the 0V/5V pulses as fast as my animation permits.

/Leo



Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4639

Thank You
-Given: 823
-Receive: 4194


There is no evidence that I muted SoNsIvRi


« Reply #1 on: November 07, 2010, 11:07:28 23:07 »

Problems with your post no code.
electronic T5 ballast (there must be 1000's some are classed as dimmable)
Why no Model # or data sheet If Dimmable what type of control ballast looking for ?

The microchip app is "Using PWM to Generate Analog Output" so are you looking for a steady voltage.?

PWM 0 to 10V as per Microchip app for proteus
« Last Edit: November 08, 2010, 12:03:22 00:03 by pickit2 » Logged

Note: I stoped Muteing bad members OK I now put thier account in sleep mode
LeoDorant
Guest
« Reply #2 on: November 08, 2010, 10:01:06 10:01 »

Thanks, my code is as follows. I need to produce a steady voltage between 1-10V to dim the ballast according to my "moon" position (ie. my lamp). Sort of a sunriser with gradual rise/set controlled by PWM.

The ballast is at best an EVG 2x24W T5 dimmable, with a max current rating of 0.2mA. I cant find any datasheets unfortunately.

Code:
void setmoonparam () {

   if (hrs>=uphr) {                                           
      if (min>=upmin) {                                   
            if (updown==0) {                                 
            setup_ccp2(CCP_PWM);                            // Configure CCP2 to PWM on pin C1
            setup_timer_2(T2_DIV_BY_1, 255, 1);             // Tosc/((PR2+1)*4*prescale)
                                                           // 20000000/((255+1)*4*1) = 19,5kHz, 51,2us
            updown = 1;                                   
            moonintensity = intensitet[abs(fullmoon-day)]; 
            set_pwm2_duty(255*moonintensity/100);
            }
      }
      else {                                                 
         if (updown==1) {                                     
            setup_ccp2(CCP_OFF);                             
            setup_timer_2(T2_DISABLED,0,1);                     
         }
         updown = 0;                                         
         moonintensity = 0;                                   
      }
   }   
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC