Hacking PWM regulator's linear pot?

Hello everyone,I’m building a small project with a PWM regulator 6-90V 15A, 48v dc source,digital pot and arduino.I found the same project online but unfortunately there is no information about results or how did he do it or did he do it at all…the only thing is a schematic which I took and modified for my project.Here is the original post of the man:
Original
and here is mine:

Sorry for my bad work in paint :slight_smile:
The second thing was replacing the linear 10K pot with a digital one, so I can control the output of the regulator to a motor or some other device with Arduino.
I’ve done the circuit as it is on the picture and wrote some sample code I found on the net in order to test it:

#include <SPI.h>  
const int CS = 10;
int PotWiperVoltage = 1;
int RawVoltage = 0;
float Voltage = 0;
 
void setup() {
  pinMode (CS, OUTPUT);   
  Serial.begin(9600);
  SPI.begin();    
}
 
void loop() {
  // move the potentiometer in one direction
 for (int level = 0; level < 255; level++) 
  {
    MCP41010Write(level);
    delay(100);
    RawVoltage = analogRead(PotWiperVoltage);
    Voltage = (RawVoltage * 5.0 )/ 1024.0;
    Serial.print("Level = " );                      
    Serial.print(level);      
    Serial.print("\t Voltage = ");
    Serial.println(Voltage,3);  
  }
  delay(2000);  // wait a couple seconds
  // Now mover potentiometer in other directions
  
  for (int level = 255; level > 0; level--) 
  {
    MCP41010Write(level);
    delay(100);
    RawVoltage = analogRead(PotWiperVoltage);
    Voltage = (RawVoltage * 5.0 )/ 1024.0;
    Serial.print("Level = " );                      
    Serial.print(level);      
    Serial.print("\t Voltage = ");
    Serial.println(Voltage,3); 
  }
   delay(2000);

}
 
void MCP41010Write(byte value) 
{
  // Note that the integer vale passed to this subroutine
  // is cast to a byte
  
  digitalWrite(CS,LOW);
  SPI.transfer(B00010001); // This tells the chip to set the pot
  SPI.transfer(value);     // This tells it the pot position
  digitalWrite(CS,HIGH); 
}

Everything works but not as I expected…
When the position of the pot’s wiper changes the control voltage(0-5V) changes as it supposed to be…for instance on 127 position we will have at about 2,5V(half) but the DC voltage of the main circuit (48v) barely changes with a few millivolts and this is for every position of the pot.
Do you have any idea whats the problem?

No ideas? :confused:

Solved....

Well, why don't you show us the solution?