Fablab_Irbid
Published © CC BY-SA

SPEIC Converter

The project below is a SPEIC converter which is a non-inverting buck/boost converter that steps up and down the voltage.

IntermediateWork in progress5 hours646
SPEIC Converter

Things used in this project

Hardware components

Power Mosfet: IRF720.
×1
Single Turn Potentiometer- 100k ohms
Single Turn Potentiometer- 100k ohms
×1
Capacitors: 470 uF and 100uF.
×1

Software apps and online services

MATLAB
MATLAB
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Digital DC - DC converter Schematic

Code

Digital DC - DC converter

Arduino
#include <PWM.h>
#include <PIDController.h>

PIDController pid;
int PWMPIN = 9;
int32_t frequency = 10000;
float m = 97/15;
// *  * * * * * * * *   * * *

double Feed = 0;         // variable to store the read value
int PWM = 230;
int constant = 7;
double kP = 0.2;
double kI = 1;

void setup()
{
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);

  InitTimersSafe();
  bool success = SetPinFrequencySafe(PWMPIN, frequency);
  Serial.begin(9600);
  pid.begin();
}

void loop()
{

  constant = map(analogRead(A0), 0, 1023, 0, 25);
  //constant=8;
  pid.setpoint(constant);
  pid.tune(kP, kI, 0);
  pid.limit(0, 255);

  Feed = analogRead(A1);
  Feed = Feed * 5 / 1023;
  Feed = Feed * m;
  //Serial.print("Feed:");
  double output = pid.compute(Feed);
  output = 255 - output;

  //Serial.print("PWM:");
  //Serial.println(constant);
  pwmWrite(PWMPIN, output);
  Serial.println(Feed);


}

Credits

Fablab_Irbid
6 projects • 32 followers
Contact
Thanks to Abelrahman Sada .

Comments

Please log in or sign up to comment.