I'm working on designing a bidirectional Buck Boost DC-DC Converter using a microcontroller from Arduino MEGA for battery charging and discharging applications. This converter operates in two modes: buck and boost.
In buck mode, it allows the current to flow from a high voltage battery (72VDC) to a low voltage battery (48VDC) with 10A current flow. In boost mode, it facilitates the flow from a low voltage (48VDC) to a high voltage (72VDC) battery with 10A current flow.
Mode 1 (buck mode) - I've conducted tests using a 40VDC input, but the output voltage is only 12VDC.
Mode 2 (boost mode) - I've tested it with a 12VDC input, but the output voltage remains at 12VDC without boosting.
Any suggestions or insights would be greatly appreciated to improve my design. Thank you!"
I want to design Bidirectional Buck–Boost Current-Fed Isolated DC–DC Converter and Its Modulation. this converter consist buck- boost and double active bridge DC-DC bidirectional converter. This converter allowed two direction of current flow. there are two side, high voltage side and low voltage side. for high voltage side it can up to 80vdc while for low voltage side up to 24vdc. here is my code for this controller, but when I run it the output voltage very low. can anyone comments my code?
#include <Arduino.h>
// Define MOSFET gate control pins
const int mosfetGatePinHV = 6; // High voltage side MOSFET gate control pin
const int mosfetGatePinLV = 7; // Low voltage side MOSFET gate control pin
// Note: Direct manipulation of the timer registers to adjust the PWM frequency is model-specific.
// The following adjustments are for Arduino Mega 2560.
void setupPWMFrequency() {
// Set prescaler to 1 (no prescaling) for Timer 4, affecting pins 6, 7, and 8.
TCCR4B = TCCR4B & 0b11111000 | 0x01;
}
void setup() {
setupPWMFrequency(); // Adjust PWM frequency
// Initialize MOSFET gate control pins as outputs
pinMode(mosfetGatePinHV, OUTPUT);
pinMode(mosfetGatePinLV, OUTPUT);
// Note: analogWrite will be used to set PWM duty cycle, but the frequency adjustment is done via setupPWMFrequency.
}
void loop() {
// Example control logic (simplified)
// Cycle the duty cycle from 0% to 100%, then back to 0%
for (int dutyCycle = 0; dutyCycle <= 255; dutyCycle++) {
analogWrite(mosfetGatePinHV, dutyCycle);
analogWrite(mosfetGatePinLV, dutyCycle);
delay(10); // Short delay to observe the change
}
for (int dutyCycle = 255; dutyCycle >= 0; dutyCycle--) {
analogWrite(mosfetGatePinHV, dutyCycle);
analogWrite(mosfetGatePinLV, dutyCycle);
delay(10); // Short delay to observe the change
}
}
Your two or more topics on the same or similar subject have been merged.
Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.
Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.
Repeated duplicate posting could result in a temporary or permanent ban from the forum.
Could you take a few moments to Learn How To Use The Forum
It will help you get the best out of the forum in the future.
@izzul_97
As Pointed out by @JohnLincoln your code is wrong but so is your schematic.
You have obviously never done this before so I suggest you read up on how to use MOSFETs and Switch Mode Power Supply (SMPS) design. Here is a good eference