BRD_PWM_COUNT Question

I’m trying to set up the encoders for the BalanceBot following these instructions: http://ardupilot.org/rover/docs/wheel-encoder.html#wheel-encoder

The first step is “set BRD_PWM_COUNT to 2 to allow AUX OUT 3 and 4 to be used as INPUT”. When I go to set the parameter it shows this description: “Control assigning of FMU pins to PWM OUTPUT, timer capture and GPIO.” They need to be set as inputs, not outputs. What am I missing? It’s preventing me from doing the next set properly.

ArduRover V3.5.1

Chuck

You are missing nothing. GPIO or General Purpose INPUT Output.

Ok, I’m an idiot, thanks for pointing that out.

I need some help now with the debugging the Pix4 orientation. The motors only run and control if the bot is in a horizontal orientation, ie the motor speed varies as the bot is moved up and down in the horizontal position. If it is rotated too much, the motors are shutdown. So the control is working properly. I’ve tried AHRS_Orientation in both 90 and 270 degree settings, and neither of them have any affect. What am I missing?

Another question is regarding the closeness of the Pix4 to the large brushed planetary gear motors. Is the Pix4 to close to the motors and will that cause any problems?

Pardon the jumbled wires, they were nicely tied up, but I had a connection problem.

You will need an Orientation parameter of pitch 270. Set it to Pitch 270 and restart the FC.Then look at the HUD in Mission planner with the bot propped up vertical and see if the horizon is right and it moves the correct way when pitched forward/backward. If not then you might need Pitch 90 but I think 270 will be right. When I configure one of the Pixhawks I have on the bench that way it’s correct.

It will probably only cause a problem with the on-board compass but those are typically not used anyway. Do you have a GPS/compass module on there somewhere?

Dave,

Thanks, I got it working. The attached video is of the very first attempt to balance, without any tuning. For me, it’s a good start. I used planet gear motors that have less visible backlash than a straight gear motor. Time will tell if they are better.

Chuck

1 Like

Chuck,
Nice job it’s basically working! Tuning can be expected but can’t say I have any experience with a balance bot. I suppose I would start with the ATC_BAL_ (P,I,D) parameters. Too bad we don’t have live tuning with Rover but you can start with enabling the GCS mask for pitch and view it on the tuning screen as you make changes.

Could use a little more help. The skid steer isn’t working completely, the left stick will turn the bot in either direction, but nothing happens when the right stick is moved. These are the only settings I’ve made for the skid steering setup.
servo1-function) = 73 (Throttle Left)
servo3-function) = 74 (Throttle Right)

Can you look at the parameter list and see what I’m missing?
Chuck

BalancingBot7-28-19.param (13.3 KB)

How do you want to control the vehicle with the sticks? Have you read the section about PILOT_STEER_TYPE?

For the non functioning right stick, the setting for PILOT_STEER_TYPE = 0. When it was changed to 1, two paddle input, then the right stick would operate just like the left stick. The Bot would just rotate, but not go forward or backward.

Use the Servo Output screen in Mission Planner to troubleshoot.

1 Like

Dave,

In the servo output screen, the positions change for the left stick as they should. However, nothing changes when the right stick is moved. I’m running Ardurover V3.5.1 and BAL_PITCH_TRIM doesn’t appear, BAL_PITCH_MAX does. Any clue as to why that doesn’t show up? I need to make the TRIM adjustment.

Chuck

@chuckl74,

Instead of the “Servo Output” screen, I recommend using the “Motor Test” screen to check that the wheels are moving and are moving in the correct direction. It’s important to separately check the inputs and outputs - the Motor Test screen tests the outputs.

As a side note, it is amazing how many users have trouble with this portion of the setup. I guess we need some improvements in the wiki about this.

I just reloaded ArduRover Ver 3.5.1 and reset set up the Bot. Still no forward motion with the right stick with PILOT_STEER_TYPE = 0, and with PILOT_STEER_TYPE = 1, the right stick acts just like the left stick. Using the Motor Test screen, buttons A&B do nothing, C runs one motor, D runs the other motor, and Test All Motors button runs both motors in the same direction. Any suggestions?

There still isn’t any BAL_PITCH_TRIM option. I could use it because the CG is behind the FC and by the hanging the battery over the front of the bot, it’s easier to set the PID’s

Chuck

@chuckl74,

I don’t have answers for all the questions but re the Motor Test screen, A&B buttons are for use with Ackermann style vehicles (i.e. those with separate steering and throttle outputs). A balance bot is essentially a skid-steering vehicle so it is normal that only C&D buttons would have any effect. Not to be annoying but this is shown in the image on the motor test wiki page. The key thing to test is that the motors spin in the same direction and in a direction that would make the vehicle go forward.

It sounds like the motor test is working so the issue is most likely with the RC inputs, the flight mode or the vehicle’s not armed. The vehicle is in Manual mode of course? At this point I think it’s probably best to post a dataflash log.

The BAL_PITCH_TRIM parameter will go out with Rover-3.6 which should start beta testing in 3 weeks or so (as soon as we finish off the object avoidance feature).

Well, I learned something while trying to create a fresh log. I do have forward/backward control if I hold the stick either fully up or fully down. Eventually the Bot will begin to move either forward or backward, not useable this way. Radio calibrate in MP, shows full deflections. Turns are very responsive, in fact they will have to be dialed back. Attached is what I believe is the latest log, for some reason the controller isn’t using the correct time.

https://www.amazon.com/clouddrive/share/hGbPvdgWRcdzI2oHzFZVUu2vrh4FaPpHx8T1lCJpBkW

Did you actually perform a radio calibration? They all look to be at default values. It’s not typical that after radio calibration every RC channel is still at 1900, 1100, 1500 (max, min, trim).

I just recalibrated, but it didn’t make any difference. The PID’s calibration needs work yet, so that will get worked on tomorrow.

Chuck

I’ve been working on the Acro Mode and have the steering working reasonably well, but it needs fine turning yet. I’m having issues with the speed however which seems to be directly related to the cg of the BalanceBot. If the battery is moved forward on the frame, the Bot will move forward, but not in reverse. If the battery is moved back on the frame, the Bot will not move forward, but it will in reverse. Another observation, when the Bot slowly comes to the transition between a tile floor and a low nap carpet, it can’t get on to the carpet. Any settings I should be looking at?

Should I be starting a separate blog for these questions?

Chuck

I don’t have any balance bot experience but would it not be best to have the battery mounted low just above the motors? The battery mounted high is creating a big lever I would think.