QUB-ASL / bzzz

Quadcopter with ESP32 and RaspberryPi
MIT License
7 stars 1 forks source link

Possible issue with `RADIO_STICK_MIN` `RADIO_STICK_MAX` #54

Closed jamie-54 closed 1 year ago

jamie-54 commented 1 year ago

I think we need to check RADIO_STICK_MIN RADIO_STICK_MAX for use with motor trimmers.

@gunturiCM had mentioned that previously (before #52) the throttleReferencePercentage would sometimes go negative, I had checked the RADIO_STICK_MIN RADIO_STICK_MAX when the motor trimmers where set to zero and they where correct so couldn't figure out why it would go negative.

Just realised, when we use the trimmers to balance the quadrotor to hover properly I think it shifts the range of values from the RC therefore getting negative values or not getting top speed from the motors (depending how it shifts)

Think we should run hw_test_receiver.py on the Pi to see what the RADIO_STICK_MIN RADIO_STICK_MAX are when the trimmers are at there most extreme. Obviously by increasing RADIO_STICK_MIN and decreasing RADIO_STICK_MAX it will be slightly hard to control but we can see how far we usually use the trimmers and stay close to them values.

I realise @gunturiCM has sorted the issue of it going negative but we should still fix this to be able to use the full range of the motor at all times.

patchedByBatman commented 1 year ago

I think we can have a calibration step in which we prompt the user to shift the throttle to min and max positions (including trimmers) and record them in a file on R-Pi. We can use these stored values for every (say) 100 runs and then we ask the user to calibrate again. The disadvantage is that if the user changes the trim in the midst of a flight, these stored values become irrelevant. Some flight controllers (like the Pixhawk if I remember correctly) have this step as mandatory on the first run.

jamie-54 commented 1 year ago

I think it will just be the max and min for the pitch and roll that will change, so we could keep RADIO_STICK_MAX RADIO_STICK_MIN as they are for all others (throttle and trimmers A-D) and have new variables something like PITCH_RADIO_STICK_MAX PITCH_RADIO_STICK_MIN , ROLL_RADIO_STICK_MAX ROLL_RADIO_STICK_MIN.

@alphaville and I were talking about this the other day before the meeting and we thought rather than the user having to calibrate ever so often, if we just take the values first sent form the RC's pitch and roll channel as the centre point and add 700 for the PITCH_RADIO_STICK_MAX, ROLL_RADIO_STICK_MAX and subtract 700 for the PITCH_RADIO_STICK_MIN, ROLL_RADIO_STICK_MIN. This means the first time the user fly's the quadrotor the can use the trimmers to balance the quadrotor to hover properly and then after these trimmers are set they can reset the drone.

patchedByBatman commented 1 year ago

Yes! I agree, we can do this.

alphaville commented 1 year ago

Folks, I'm leaving this to you to sort out @jamie-54 @gunturiCM

patchedByBatman commented 1 year ago

Sure sir.

jamie-54 commented 1 year ago

@gunturiCM Pretty sure we sorted this issue, will we close it?