ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.95k stars 17.47k forks source link

Rover: DSHOT reverse range is inverted #19346

Closed geofrancis closed 2 years ago

geofrancis commented 2 years ago

When trying to use Reversable Shot motors with rover firmware the reverse values are inverted.

0-100% forward should be 1500-2000us output and that works fine. 0-100% reverse ends up as 1000-1500us so as minimum speed reverse is 1000us and full speed reverse is 1500us rather than minimum reverse at 1500us and full reverse at 1000us

SERVO_DSHOT_ESC was set to 1, when set to 0 reverse done nothing.

Regular PWM mode works as expected but it disables ESC telemetry. so far I have only seen it in 4.2 dev downgrading to 4.11 works as expected. blheli32 32.8

rmackay9 commented 2 years ago

FYI @andyp1per

geofrancis commented 2 years ago

is there any specific reason Dshot needs to be enabled to get blheli32 telemetry? or is it just assumed that if they have a telemetry capable esc they want to use dshot?

andyp1per commented 2 years ago

is there any specific reason Dshot needs to be enabled to get blheli32 telemetry? or is it just assumed that if they have a telemetry capable esc they want to use dshot?

Yes, requesting telemetry is part of the dshot protocol - it is not part of any of the other protocols. It's possible, I suppose, that BLHeli's auto telemetry feature might help here, but we are not currently geared up to cope with that.

andyp1per commented 2 years ago

I'm having a hard time believing this is different in 4.2 - the dshot code for 4.2 and 4.1 is very little changed and the place we convert for reversing motors is almost identical. Please can you post your full parameter list so that I can test?

andyp1per commented 2 years ago

@shellixyz you are using reversing motors on 4.2 I believe?

geofrancis commented 2 years ago

I'm trying to replicate it, but I can't even 4.2 to start any more, it's just stuck at gyro initializing. flashed back to 4.1 copter reset all settings to try and clear the board but when i flash 4.2 rover i just get repeated message of "initializing". 4.1.1 rover is working fine . but i just cant get 4.2 to boot anymore. il get you a parameter list as soon as i can get it started again.

rmackay9 commented 2 years ago

@geofrancis,

The "Initialising ArduPilot" message should be fixed if you rebase on master. There was a bad PR that was merged yesterday but the issue has been fixed now. Sorry for the troubles.

geofrancis commented 2 years ago

flashing 4.2dev via mission planner is still giving me the error.

rmackay9 commented 2 years ago

@geofrancis, yes, the build server hasn't gotten through rebuilding all the various versions yet. It should be fixed in a few hours though.

shellixyz commented 2 years ago

@shellixyz you are using reversing motors on 4.2 I believe?

I do yes, works fine for me with Plane and BLH32

geofrancis commented 2 years ago

I think its something to do with converting pwm to Dshot in rover, as the pwm values showing on mission planner were showing the correct values and are moving appropriately, but the dshot output doesn't match what its showing. going slow from forwards to reverse the motor slows as expected but as soon as it goes past centre it immediately goes to full power reverse, slowing down to minimum speed when the value is at -100%

geofrancis commented 2 years ago

I think this is a problem from long ago, its strange that its only in 4.2. Are there differences between dshot 150 300 600 other than speeds?

https://github.com/ArduPilot/ardupilot/issues/8579 https://github.com/ArduPilot/ardupilot/pull/9743 https://github.com/ArduPilot/ardupilot/issues/7737

andyp1per commented 2 years ago

No, no other differences

geofrancis commented 2 years ago

@andyp1per I have just done a fresh installation of 4.2, configured everything from scratch back to the way it was working in 4.1 and the problem is back, reverse is inverted.

Switching to PWM or oneshot and the throttle works as expected but stops telemetry working. Tested Dshot 150,300,600

boat.zip

andyp1per commented 2 years ago

What flight controller is this on?

geofrancis commented 2 years ago

pixhawk 1

geofrancis commented 2 years ago

@andyp1per were you able to replicate this?

andyp1per commented 2 years ago

Sorry, was doing other stuff over the weekend

geofrancis commented 2 years ago

Sorry, was doing other stuff over the weekend

no problem, I'm just using pwm for now, I don't need telemetry for a while yet, It's for doing a stuck propeller script and I won't need that till the spring when it goes for endurance testing.

rmackay9 commented 2 years ago

We discussed this at the dev call today and I agreed I would try and reproduce this on a BLHeliESC that I have.

AlksSAV commented 2 years ago

I have the same problem with DShot on Rover 4.1.3 firmware. Previously there was version 4.2 My Equipment:

Jahor commented 2 years ago

Same issue. Also in BLHeli_32 when configured in Bidirectional 3D (not Soft) sending 1048 (idle state) over DShot causes motors to spin. May be it is possible to send command 0 (stop) when idle? When sending 1500 with PWM it does not happen, as they have some dead-band.

rmackay9 commented 2 years ago

I've reproduced the issue on a CubeOrange running Rover-4.2.0-beta and 4.3.0-dev (aka latest, aka master) so hopefully we can get to the bottom of this. By the way, it also seems that the direction of the motors rotation has changed in 4.1.5 and 4.2/4.3.

rmackay9 commented 2 years ago

Ok, I think we have a fix for this issue here https://github.com/ArduPilot/ardupilot/pull/20349.

@geofrancis do you think you could test this resolves the issue? It does for me but I'd like to get it tested with various different autopilots if possible.

geofrancis commented 2 years ago

I have been ill for the last month, I haven't been able to test anything yet unfortunately.

rmackay9 commented 2 years ago

@geofrancis, hope you're feeling better soon. I've tested it quite thoroughly and the fix is included in -beta3 which should be out later today.

I think I might close this one but we can re-open if you find the problem still exists.

AlksSAV commented 2 years ago

Now I have tested on version 4.3 dev, still not correct work. Is it just me who has such a problem?

andyp1per commented 2 years ago

Now I have tested on version 4.3 dev, still not correct work. Is it just me who has such a problem?

Please post your params

AlksSAV commented 2 years ago

Now I have tested on version 4.3 dev, still not correct work. Is it just me who has such a problem?

Please post your params

The problem turned out to be in ESC, tested everything works.

Pixhawk 2.4.8, DYS Aria blheli 32.

rmackay9 commented 2 years ago

@AlksSAV,

Great! thanks very much for the feedback.

LimitlessGreen commented 1 day ago

Have an Bluerobotics Basic ESC with Bluejay on Rover V4.5.7. Set the SERVO_BLH_3DMASK and have inverted reverse throttle. (Altough the servo output in Missionplanner looks normal)

rmackay9 commented 8 hours ago

Hi @LimitlessGreen,

Could you post an onboard log file? Ideally these issues should reported in the forums . Have you reported there yet?