🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Unit_Roller and SimpleFOC.h

    Scheduled Pinned Locked Moved Units
    1 Posts 1 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      cepics
      last edited by

      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

      1 Reply Last reply Reply Quote 0

      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
      • First post
        Last post