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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login