Why can't connect the system to the studio
ErDong886 opened this issue · 4 comments
ErDong886 commented
ErDong886 commented
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(¤t_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();
}
ErDong886 commented
I'm not a reacher but a rookie.....
JorgeMaker commented
Hi @ErDong886
You can visit SimpleFOCForum whre there is a community that can help you with your project.
BR
ErDong886 commented
thank you