Unit_Roller and SimpleFOC.h
-
Hi all
I would like to play with Unit_Roller and SimpleFOC.h but I don't know how to setup the Motor configuration..
is there an Arduino example for unit_roller using SimpleFOC.h?
I'm using M5Nanoc6 as controller
this code compile but doesn't produce any motor movement.
#include "SimpleFOC.h" #include "unit_rolleri2c.hpp" #include <M5Unified.h> // Create a Unit Roller object UnitRollerI2C RollerI2C; // Motor configuration for SimpleFOC BLDCMotor motor = BLDCMotor(7); BLDCDriver3PWM driver = BLDCDriver3PWM(9, 10, 11, 8); void setup() { M5.begin(); // Initialize the Unit Roller if (RollerI2C.begin(&Wire, 0x64, 2, 1, 400000)) { M5.Lcd.println("Roller initialized"); } // Initialize the SimpleFOC driver driver.voltage_power_supply = 12; driver.init(); motor.linkDriver(&driver); // Motor control mode motor.controller = MotionControlType::velocity; // Initialize the motor motor.init(); motor.initFOC(); } void loop() { // Motor control using SimpleFOC motor.loopFOC(); motor.move(2); }
any tips
best regards