Thanks Randy there are no encoders but it doesn’t work too bad. I’ll keep working on it thanks for the tip on tunning I’ll play with that.
Hi!
I did manage to get my balance bot working on Acro.
Like Randy said, I was using brushed motors with encoders. So I also ran into the same issue. In my case it was because the balance PIDs(ATC_BAL_‘x’) were not tuned correctly. That could be one reason. When you say you can drive it around in manual, is it stable? Or is it like you can barely drive it without crashing? That was the problem in my case.
Typically when the balance controller is well tuned, you would see that in Manual/Hold mode, the bot stays upright, but drifts back and forth(there will be a bit of yawing as well). Keep tweaking the PID params till it is smooth and stable, ie; it shouldn’t eventually speed up in either direction and crash. Two additional params you need to watch out for are MOT_THR_MIN and BAL_PITCH_MAX. The MOT_THR_MIN param especially can cause oscillation in Acro like you described, if it is set too high.
There are two additional PID controllers in Acro: Speed and yaw rate. But before starting off, set CRUISE_THROTTLE to zero and set CRUISE_SPEED to the max speed you want(start with something small like 0.1). Save all your parameters once and then set ATC_SPEED_P, ATC_SPEED_I and ATC_SPEED_D to zero. Do the same for ATC_STR_RAT_P,I and D(yaw rate) params. The default values set are for rover and may cause your balance bot to crash. Switch to acro mode and start tuning yaw rate first and then speed.
Another possible issue in your case, like Randy described are the lack of wheel encoders. Without wheel encoders your speed and yaw estimates are calculated from the IMU sensors, if you are using it indoors without GPS. In my case, because I was using geared dc motors which has a lot of backlash, i found these estimates to be very inaccurate. So I had to go with wheel encoders. But in your case, since you are using steppers and they typically don’t have any backlash, the speed estimates should be more reliable. So, do take a look at the speed estimate graph while you drive in manual and see if it makes sense.
Trying the balance bot with steppers is high on my to-do list, but I’ve still got a bit more to finish with brushed motors. So I’d be really interested to see how this turns out. Lemme know if you need any further help with this.
Ebin thanks for the great info. I have one on brushes motors with encoders for a while now and it’s working ok but wanted to try stepper motors. I’m close with them but still have some tunning to do as on the controller I’m using tic from pololu you can set max speed, acceleration and dead zone center stick. I just need to find the correct balance of pids and motor control settings.
Will keep posting my progress and maybe start a thread specific to the stepper motors on pixracer.
Thanks Jack
Ebin would you mind sharing your parameters for your ballbot. I would like to see them for comparison on my ballbot with brushed motors and encoders. Yours looks a lot more stable than mine.
Jack
Hello Randy,
I have been absent for a long time and today I have been able to test the Loiter Rover-3.5.0-rc1 mode with the new Loit_Radius and Loit_Type parameters. To my regret, I had the same weaving motions. After about 5 minutes, it moves away from the position / apply photo /. The wind was constant at about 3 m / s. With a Loit_Type = 1 parameter, the boat performed circular movements around the set position. I did a very interesting test. I set a point 50 m away from the wind, I set Cruise Speed = 0.1 m / s and Cruise Throtle = 33%. I switched to Auto mode. The boat was pointing to the set point and, to my surprise, could not overcome the force of the wind and locked it in place. Stands like in the example "Boat Loiter in strong current". The nose pointed at the point, and the boat was like a nailed one. / apply video /.
Randy, where am I wrong? Why can not I get good results in Loiter mode?
Can you post a log of this? You really have not given enough information for anybody to help.
Hi @Hotlive,
Thanks for giving it a try. I think the largest problem may be that the vehicle doesn’t have enough power - at least for the case where it gets stuck in Auto mode.
The boat circling when using Loiter with LOIT_TYPE = 1 (“Always face bow to target point”) is interesting… it is possible this may happen if the LOIT_RADIUS is smaller than the turn radius of the vehicle.
Anyway, if you have a log that will help diagnose the issue.
Hello David,
I apply the two test files.
@rmackay9
Hello Randy,
I deliberately introduced these parameters. I wanted to figure out how it is possible to imitate the Loiter mode. My goal is to achieve this result in Loiter mode. I need your help.