Timeline for Self-balancing robot using Raspberry 3b+
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 22, 2019 at 16:21 | comment | added | Pete Kirkham | Putting 0.1s and 9.8m/s² into s = u.t + ½a.t² gives 49mm. So the centre of gravity of your robot could drop about 5cm/two inches between your sleeps. You probably want to continually PWM your motor at a speed and direction based on some function of the acceleration (PID or Kalman), not bang-bang control it and let it fall that much. | |
Mar 22, 2019 at 13:37 | comment | added | Brick |
I missed the time.sleep call. That's clearly an issue too if you want to go for speed! +1. Regarding the reply from the OP in comments that the motor takes a while to adjust, requiring the sleep, that goes into the general category of issues that I mentioned originally that you may need different hardware for this. If your motor responds too slowly, then it doesn't matter how fast you make your software.
|
|
Mar 22, 2019 at 11:00 | comment | added | David | @ece12345, yes, but that doesn't necessarily mean that the code is producing the correct adjustment, regardless of the timing behavior. How do you know it's moving forward enough for it to be balance. Assuming it were all fast enough, how do you know your control system works. | |
Mar 22, 2019 at 10:57 | comment | added | ece12345 | By "the code works", I mean that, the motor exactly how it is supposed to work. It moves forward when inclined forward and backward when inclined backward. But, once it detects an imbalance, the motor takes a while to move like it is supposed to. | |
Mar 22, 2019 at 0:57 | history | answered | David | CC BY-SA 4.0 |