JorgeMaker/SimpleFOCStudio

Why can't connect the system to the studio

ErDong886 opened this issue · 4 comments

image
CMD shows "Connected.." for a long while, and I don't know why.

oh I find it's because I dont burn codes to arduino uno. Can someone share codes for me to learn from?
I try to burn the codes but it exceeds the flash memory of arduino uno

#include <SimpleFOC.h>

// BLDC motor & driver instance
BLDCMotor motor = BLDCMotor(7);
// driver
BLDCDriver3PWM driver = BLDCDriver3PWM(9, 5, 6, 8);
// encoder instance
MagneticSensorSPI encoder = MagneticSensorSPI(AS5048_SPI, 10);
// current sense
InlineCurrentSense current_sense = InlineCurrentSense(0.01f, 50.0f, A0, A2);

// include commander interface
Commander command = Commander(Serial);
void doMotor(char* cmd) { command.motor(&motor, cmd); }

void setup(){
    Serial.begin(115200);
    // SimpleFOCDebug::enable(&Serial);

    encoder.init();
    motor.linkSensor(&encoder);

    driver.voltage_power_supply = 12;  
    driver.init();                     
    motor.linkDriver(&driver);
    current_sense.linkDriver(&driver);
    current_sense.init();
    motor.linkCurrentSense(&current_sense);
    motor.init();          
    motor.initFOC();       

    command.add('M',doMotor,'motor');
    // tell the motor to use the monitoring
    motor.useMonitoring(Serial);
    motor.monitor_downsample = 0; // disable monitor at first - optional

}
void loop(){
    motor.loopFOC();       
    motor.move();          
    // real-time monitoring calls
    motor.monitor();
    // real-time commander calls
    command.run();
}

I'm not a reacher but a rookie.....

Hi @ErDong886

You can visit SimpleFOCForum whre there is a community that can help you with your project.

BR

thank you