> -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Kathy Quinlan > Sent: Tuesday, January 22, 2002 2:05 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [EE]: Calculating DC voltage from a sine wave > > Ok I am not using a PIC (the client specified an AVR) but I am using a > Microchip A2D that uses SPI ;o) > > I have to opto Isolate the A2D as it is very expensive to provide opto > Isolated DC to DC supplies to run the external SPI port for > programming and > control and the external RS232 / RS 485 :o( > > Ok now my problem, using one full cycle and doing 1 cycle on 9 > cycles off, I > get 620Vdc and it does not move :o( I have checked my SCR firing > pulses, and > yes they happen every 200ms (I am in Au and we use 50Hz 240Vac (nominal)) > > > So it looks like I have 2 options > > #1 heavy loading of the storage caps (atm I have a ~64ma loading from the > opto isolated SPI) > > #2 move to phase control and ignore the electrical noise ;o) > > Will need to find out what the customer wants to do, as these > units are used > in the middle of nowhere (up in mining country in the top of AU ;o) > Kat, Are you saying that you have a fixed 1:9 drive to the charge control? Your software only needs to pulse the charge circuit for one complete cycle whenever necessary to keep the storage caps at the required voltage. This is likely to be at a much slower rate than 1:9 when regulating. If the voltage is above your require level then the software should stop driving the triac. Leakage current will normally be enough to cause the voltage to drop naturally but a bleed of 64mA sounds high and should certainly be enough to cause discharge. If your software can switch the charge in single cycles anywhere from continuously on to continuously off then it must be able to control the cap voltage. Check that the A-D is working correctly and you have the correct polarity output. Using SPI is going to slow the loop response down somewhat so I cannot guess what will happen. You really need to be switching in near real time for effective control. It would be better to put the isolation in the external RS232 and have the micro connected directly to the cap 0V. A built-in A-D is even better. Check your software open loop with a suitable low voltage and check that the drive pulse rate varies in the correct direction and is in sychronism with the line input. If not then you are likely to have problems. Without knowing your circuit configuration it is difficult to work out what is happening. Do you have a split rail simply to increase the effective capacitor voltage or is the centre point connected to neutral and used as part of the multiplier? What multiplier capacitors are you using? You are using multipliers rather than just rectifying the line aren't you? You say that you are using an SCR, but if you are controlling the input (AC) to the multiplier then you need either a triac or two SCRs back to back. If you are trying to control the output (half wave DC) of the multiplier then that may well be your problem. It could be that your capacitors are just charging to the peak of the input. It is difficult to guess without knowing the detail and there are so many possible circuit configurations. If you need the capacitor voltage to respond reasonably quickly to a control input over a wide range then the traditional method is to add a resistive dump circuit that works in opposition to the charge circuit to discharge the capacitors. Use a MOSFET (Opto-coupled in your case) to switch a resistor across directly across your caps. The software needs to have upper and lower limits which cause the circuit to either charge or dump (but not both at the same time). If your circuit is to be used away from civilisation ;-) without a reasonable mains supply then be aware of the characteristics of small generators with varying load - usually poor frequency control and potential under and overvolting. This can play havoc with phase control circuits. David -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads