BLDC motor control using feedback from LSM9DS1

Hello Forum,

I am trying to build an inverted pendulum which looks like the one shown in this video:

What is different with my approach is, I am looking to use a BLDC motor without any hall sensors (cheap?) and an Arduino Nano. As an initial step, I am aiming at balancing the pendulum on it's tip by first supporting with hands the pendulum body at the beginning of the balancing process and letting go when the control system starts doing its job.

This is where closed-loop control comes into picture or so is my understanding. Due to the changes in torque of the flywheel coupled to the motor which is within the pendulum housing, the pendulum would remain in position for a very short duration of time before it starts to tip over to one or the other side. To avoid this from happening or rather to keep the pendulum in upright position, my plan is to use the LSM9DS1 (partly because it was left behind by former students and my budget is slightly limited) with the help of the Arduino Nano. To power the setup, I have two tiny, rechargeable LiPo batteries with each rated at 200 mAh, 7.4V.

To tell you what my current state of project in terms of the material I have, I am attaching some pictures with this post. You will find pictures of the motor, flywheel, the driver that I have with me, and the inertial module LSM9DS1. My aim is to make it work with these components. So, I need your help!

I must confess that I am new to Arduino and coding in general but very interested to learn more! So, please bear with me if I ask stupid follow-up questions.

Best Regards
Ashi

Split your project into manageable parts, e.g. control of a BLDC motor, around 0 rpm, w/out gear box, and determination of the upright declination of the pendulum.

I cannot imagine how you want to control a BLDC motor without rotational position information, which usually is obtained from built-in hall sensors.

I'd guess your first problem will be controlling the motor at all. Sensorless BLDC controllers depend on motion feedback from the motor to update what they send to it. The tiny movements you seem to be interested in will probably not even register. That motor is intended to run at around 15000-20000 rpm.

See if you can actually control your motor to move say 10 degrees one way then 10 degrees back.

Steve