A lot of DC motors have the brushes at a non 90 degree angle to the field. This essentially gives the brushes a bit of "timing advance" to compensate for the magnetic field in the stator shifting slightly in response to the rotor's field. This makes the motor more efficient at running forward, but less efficient at running backwards. Run the motor both ways, see which way it runs faster and / or consumes more current.
I was going to say something similar, much less articulate though, you nailed it. I've observed this with my r/c projects but never knew the science behind it.
+Matthias Wandel I'm partial to this rather than the belt theory, mainly because then, it would mean that the printers would suffer from this and i've never observed that with my plotters. It's the motor that's at fault, not the belt setup.
very nice. There are a lot of control strategies, and you seem to have found one that is good. The last time I played around with the inverted pendulum, my error signal was built around no carriage motion, carriage centered, and stable angle for the pendulum. I didn't bother with building in what vertical was. If the carriage is near center and the angle is constant while the carriage isn't moving, then it is in balance.
To stop a DC motors you could do Dynamic braking (ie bridging the motor terminals with a resistor), but that might require change the H bridge setup. Just something to think about.
I found a bias issue in my encoder count code. You have to make the point of increment and decrement the same. Encoder counting code found online doesn't account for this
It's hard to tell from the video but it seems that the pendulum is mounted just a wee-bit off centre. Could this contribute to the right bias? Given the length off the stick, even small shift will contribute quite a bit of mass.
+Vojtěch Frič I don't think that would matter, since he is calibrating by "balancing" the shaft (letting the shaft hang), so the shape of the stick should not have any effect on calibration.
+neistridlar Hmm, that makes sense. I was thinking that in extreme case if you would try to balance L-shaped pendulum, it would be harder because it would tend to tip to one side. But the calibration should take of that regardless of the pendulum shape.
+Vojtěch Frič I definitely thought about this and it's how I'm currently compensating for the bias. I'm setting the initial neutral to 1199 (0.15 degrees left of ideal) rather than 1200 from the hanging position. It seems to work well so I'm leaving it for the moment.
I'm working on an inverted pendulum similar to yours. I am using LQR control and I am having the same problems that you had. Short-circuit at the source. the pendulum oscillates too much ... the programming that I did consumed a lot of time and I can not measure the speed satisfactorily ... your video will help me ..Greetings from Brazil
A lot of DC motors have the brushes at a non 90 degree angle to the field. This essentially gives the brushes a bit of "timing advance" to compensate for the magnetic field in the stator shifting slightly in response to the rotor's field. This makes the motor more efficient at running forward, but less efficient at running backwards. Run the motor both ways, see which way it runs faster and / or consumes more current.
I was going to say something similar, much less articulate though, you nailed it. I've observed this with my r/c projects but never knew the science behind it.
+Matthias Wandel I'm partial to this rather than the belt theory, mainly because then, it would mean that the printers would suffer from this and i've never observed that with my plotters.
It's the motor that's at fault, not the belt setup.
Man this is so cool to see being built from scratch and seeing the process of trouble shooting so much!
Gosh, I must be a bigger nerd than I thought to be watching and enjoying this. See? I'm even using "Gosh!"
very nice. There are a lot of control strategies, and you seem to have found one that is good. The last time I played around with the inverted pendulum, my error signal was built around no carriage motion, carriage centered, and stable angle for the pendulum. I didn't bother with building in what vertical was. If the carriage is near center and the angle is constant while the carriage isn't moving, then it is in balance.
To stop a DC motors you could do Dynamic braking (ie bridging the motor terminals with a resistor), but that might require change the H bridge setup. Just something to think about.
Fascinating build, thanks for sharing and thanks for the wonderful detail. :)
Great project
Great project!
That's called an underflow error when using an unsigned integer and counting below zero. Interesting!
+Cody Carse I've never heard of that, a new term for the vocabulary!
I found a bias issue in my encoder count code. You have to make the point of increment and decrement the same. Encoder counting code found online doesn't account for this
It's hard to tell from the video but it seems that the pendulum is mounted just a wee-bit off centre. Could this contribute to the right bias? Given the length off the stick, even small shift will contribute quite a bit of mass.
+Vojtěch Frič I don't think that would matter, since he is calibrating by "balancing" the shaft (letting the shaft hang), so the shape of the stick should not have any effect on calibration.
+neistridlar Hmm, that makes sense. I was thinking that in extreme case if you would try to balance L-shaped pendulum, it would be harder because it would tend to tip to one side. But the calibration should take of that regardless of the pendulum shape.
+Vojtěch Frič I definitely thought about this and it's how I'm currently compensating for the bias. I'm setting the initial neutral to 1199 (0.15 degrees left of ideal) rather than 1200 from the hanging position. It seems to work well so I'm leaving it for the moment.
I'm working on an inverted pendulum similar to yours. I am using LQR control and I am having the same problems that you had. Short-circuit at the source. the pendulum oscillates too much ... the programming that I did consumed a lot of time and I can not measure the speed satisfactorily ... your video will help me ..Greetings from Brazil
Cool, glad it was helpful.
Did you ever think about putting an accelerometer on the stick?
+Jim Beshears I have one and was planning to use it on the cart for more advanced control strategies, to help tune the transfer function.
I figured out your "right biased" problem. Its got to be the earths rotation...
It's oriented mostly North/South and only slightly East/West, I guess that explains why it's a minor effect!
Turn it man, let's find out!
You triple checked that your rails are level? Carpet yields over time.
give it some help with a counterweight?
You run a dvorak keyboard?
Yes, I switched in high school.
i tried it once. Just couldnt bring myself to retrain.
may i know your sensor code?
+100 likes