Inverted pendulum slider

Hello everyone,

I am currently trying to build an inverted pendulum on top of a slider. I have 3d printed the slider parts and am currently using a stepper motor and a belt system to move it. However, it seems that I cannot reach the required speeds using this setup.

Video showing the slider moving: https://youtu.be/SuZGTLXVWGs

What system and especially motor would you recommend for this use case?
Also some general guidance and tips for this project would be appreciated (=

I wish you all a healthy and happy 2021! (=

A brushed DC motor would be a better choice. The motor specs would depend on several details of the final system, such as the mass of the carriage and drive train, motor pulley dimensions, the length of the pendulum, etc.

What speed do you get, and what speed do you need?

What stepper controller? Any microstepping? Any gearing?

jremington:
A brushed DC motor would be a better choice. The motor specs would depend on several details of the final system, such as the mass of the carriage and drive train, motor pulley dimensions, the length of the pendulum, etc.

Oh interesting! And would you use a rotary encoder or a distance sensor to get the absolute position of the carrige? Because otherwise the program wouldn't now the bounds of the machine right? I have found the Odrive but it is way to expensive.

wvmarle:
What speed do you get, and what speed do you need?

What stepper controller? Any microstepping? Any gearing?

The speed you see in the video is pretty much the highest I can savely reach without skipping steps.
I estimate that I will need 2-3 times that speed. Not continously but for small, fast adjustments.

Amzdeal Nema 17 1.8° 1.5A 42NCM
UEETEK DRV8825
No gearing
AccelStepper library

MarkGoingToSpace:
Not continously but for small, fast adjustments.

That sounds like a job for a stepper, rather than a DC motor. Not enough control.

A 1.5A stepper puts out quite some torque - I do assume you have your stepper controller set at 1.5A current supply. You're moving barely any weight in that video, so that should not be the limiting factor.

To get that stepper up to speed, you need to accelerate it. Some experimenting is needed to get to maximum speed; I've done some 550 rpm with a stepper (and hit the maximum steps I could produce: close to 60,000 steps per second at 32x microstepping when clocking the Arduino at 8 MHz - this in order to keep the stepping speed out of hearing range for most of the speed range used).

To be able to accelerate your stepper faster, you have to increase the supply voltage. Your stepper controller can handle up to 44V, that will give you much better acceleration than if you operate it at the common 12V.

wvmarle:
To get that stepper up to speed, you need to accelerate it. Some experimenting is needed to get to maximum speed; I've done some 550 rpm with a stepper (and hit the maximum steps I could produce: close to 60,000 steps per second at 32x microstepping when clocking the Arduino at 8 MHz - this in order to keep the stepping speed out of hearing range for most of the speed range used).

To be able to accelerate your stepper faster, you have to increase the supply voltage. Your stepper controller can handle up to 44V, that will give you much better acceleration than if you operate it at the common 12V.

That sounds promising! (=
Could you share how you achieved such high speeds? I use the AccelStepper library which states in the documentation rhat "Speeds of more than 1000 steps per second are unreliable." and this is consistent with my experience. However, I might be limited because I only use 12V.
Also can you recommend a way to supply ~40V? I use lipo batteries at the moment to supply 12V as this is the only convenient way I know of.

Just get a power supply that has the voltage you need. You can get lots of different voltages. In case of using batteries, it's basically a matter of adding more cells - a Tesla operates at about 350V off batteries, for example.

The stepping I achieved through use of timer interrupts and direct port calls as functions like digitalWrite() are way too slow for that.

I created one timer that interrupted at 122 Hz calling a function to calculate the stepping speed (i.e. the period of each step), that's often enough for smooth acceleration.

It set a second timer interrupt for the actual stepping - to speed it up two separate interrupts for the two directions, no checking for direction in the ISR that did the stepping.

A third timer interrupt handled the updates of the 8-segment display and the blinking of the red/green LED. Normally one would do this in loop() but the other processes were such that loop() did not get enough time to run...

This was all running on an ATtiny84a. No pins left for a crystal; no space on the board for it or a larger MCU anyway, so I was limited to 8 MHz.

Over the Christmas break I gotten intimate with the Attiny412, I would definitely use one of the 0 or 1 series now. More functionality in the timers; more efficient PORT operations, 20 MHz internal clock. That'd have made my life a lot easier getting to that kind of ridiculous pulse rates, 200k steps per seconds with acceleration seems possible on those chips :slight_smile:

The stepper controller that I had for that project was outright awesome. At low speed you could NOT hear the stepper running, at all. It was dead silent. At higher speeds it started to make some noise, mostly due to friction in the bearings and minor imbalance in the rotor and so. A big difference compared to our 3D printers which are basically playing music on their steppers as they operate...

For an inverted pendulum, most people use proportional control, which is much easier to implement with a brushed motor than with a stepper.

There is no need to know the absolute position of the carriage for that application (limit switches can be used to prevent hitting the end stops). But of course, an encoder can be used, and allows much higher positioning accuracy and precision than a stepper.