Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copter-3.4: motor twitch when disarmed when using OneShot #4789

Closed
rmackay9 opened this issue Sep 6, 2016 · 15 comments
Closed

Copter-3.4: motor twitch when disarmed when using OneShot #4789

rmackay9 opened this issue Sep 6, 2016 · 15 comments
Assignees
Labels
Milestone

Comments

@rmackay9
Copy link
Contributor

rmackay9 commented Sep 6, 2016

reported by Luis including this video: https://www.youtube.com/watch?v=w5QLcQU7Xro

@rmackay9 rmackay9 added this to the AC 3.4.0 milestone Sep 6, 2016
@rmackay9 rmackay9 added the Copter label Sep 6, 2016
@lvale
Copy link
Member

lvale commented Sep 6, 2016

@rmackay9 @tridge

ok. more testing, this time with logic analyser attached to each of the 4 ESC's

Debugging the Oneshot125 twitching.

Used Flight controllers and ESC's
PixRacer - ArduPilot Copter 3.4RC4
CC3D Atom - Betaflight 2.9.0
BLHeli Suite 16.3.14.7.0.2
ESC used - Blueseries 12A for Multicopter Motors - BLHeli revision 14.7 (Atmel based)

Test procedure

PixRacer
    MOT_PWM_TYPE=0
    MOT_PWM_MAX=2000
    MOT_PWM_MIN=1000

    ESC calibrated as per wiki

    No problems observed

PixRacer
    MOT_PWM_TYPE=1
    MOT_PWM_MAX=2000
    MOT_PWM_MIN=1000

    ESC calibrated as per wiki

    No problems observed

PixRacer
    MOT_PWM_TYPE=2
    MOT_PWM_MAX=2000
    MOT_PWM_MIN=1000

    ESC calibrated as per wiki

    Motors twitch after Safety switch pressed, but still not armed

CC3D Betaflight

    Setting Motors  - Normal (equivalent as MOT_PWM_TYPE=0)

    ESC calibrated
    No issues,

CC3D Betaflight

    Setting Motors  - OneShot125 (equivalent as MOT_PWM_TYPE=2)

    ESC calibrated
    Motors twitch as with ArduPilot


Bypass connection directly with BLHeli suite

    ESC calibration done between 1000 and 2000 on the app

    Motors twitch

I would say that there might be an issue with several ESC's (both Atmel and Silabs) and Oneshot125.

I still have to perform a few more tests, to see if I can get a workaround.

I'm extremely curious why these "recommended" settings. I might try to set PWM_MIN and MAX to these values and redo the tests

screen shot 2016-09-06 at 16 27 50

screen shot 2016-09-06 at 16 27 35

screen shot 2016-09-06 at 16 36 24

screen shot 2016-09-06 at 16 34 31

screen shot 2016-09-06 at 16 34 22

screen shot 2016-09-06 at 16 34 10

screen shot 2016-09-06 at 17 10 33

At this setting the motors twitch just like on the previous video with Copter 3.4RCx
screen shot 2016-09-06 at 17 10 45

Motors stop twitching at around 1034
screen shot 2016-09-06 at 17 11 15

Logic traces.zip

img_20160906_165846

https://youtu.be/B3C0kxj2F90

https://youtu.be/wYAiCVsDLfI

@lvale
Copy link
Member

lvale commented Sep 6, 2016

Further tests

As suggested on ardupilot.org forum, did try with safety switch disabled, and redid the ESC cal with MOT_PWM_TYPE 0, 1 and 2, and results are the same. OK with 0,1 twitching with 2.

Did try redoing ESC cal with MOT_PWM_MAX and MIN to the BLHeli suite suggested default values 1148 and 1832.
Results slightly different: This time regular OneShot took a long time to initialize the ESC's, every time that the vehicle started and the safety switch was pressed. OneShot 125 still the same twitching...No problem with regular PWM

And another one. ESC cal with MOT_PWM_MAX and MIN to 0 to go back to sending the Throttle PWM values (my radio - Taranis 982/2002)
Results slightly different: This time regular OneShot took a long time to initialize the ESC's, every time that the vehicle started and the safety switch was pressed. OneShot 125 also took a long time to signal the ESC's ready (30+ seconds) and then still the same twitching... Same delay on initializing the ESC's with regular PWM but less delay 5/10 seconds.

Curious that not all the ESC's took the same time to be initialized, and it was a random pattern, sometimes ESC1 was the first others ESC 4 was the first, etc, etc...

So redid the initial config MOT_PWM_MIN/MAX 1000/2000 MOT_PWM_TYPE to regular Oneshot (1) redid the ESC calibration and getting everything ready to fly tomorrow with RC4... (I hope).

I'm going to ask the BLHeli people if this is expected behaviour... we'll see....

@lvale
Copy link
Member

lvale commented Sep 6, 2016

With all this testing I also made a sugestion for Tower :) DroidPlanner/Tower#1802

@rmackay9
Copy link
Contributor Author

rmackay9 commented Sep 6, 2016

Great, thanks very much for testing this.

So I think because the twitching is also found when using the CC3D Betaflight software, we can conclude that it's very likely to be either the hardware or the BLHeli software.

@lvale
Copy link
Member

lvale commented Sep 6, 2016

Not only on Betaflight, but also using the BLHeli native tool to calibrate ESC's, but yes your assumption is correct.

@lvale
Copy link
Member

lvale commented Sep 6, 2016

Question raised on BLHeli thread at RCG http://www.rcgroups.com/forums/showpost.php?p=35663199&postcount=9846

@tabascoz
Copy link

tabascoz commented Sep 9, 2016

As suggested on blheli rcgroups thread, I tried to lower down the min pwm output to the motors. My rc3 min is 1080, so I've tried to set mot_pwm_min to 1050 and even 1000 however the twitching was still there. By looking to missionplanner status tab I could see that it wasn't affecting the chXout value ( which was 135 ). So I've just decreased the rc3_min from 1085 to 1055 which in turn has lowered rcout from 135 to 131. Anything above 131 in rcout that causes twitch.

@lvale
Copy link
Member

lvale commented Sep 9, 2016

I'll try with those values via MP, but I've used the BLHeli suite app and with the suggested values (1148/1832) it was twitching...

be back in a bit :)

@lvale
Copy link
Member

lvale commented Sep 9, 2016

ok, Yes it works like @tabascoz said.

The problem is that the ESC's only change to OneShot125 mode when they boot and get initialized to the signaling they receive at boot time. So although we can change freely the PWM_OUT mode between 1,2,3 without rebooting the PixHawk, the ESC's were initialized at Normal mode.

So better testing must be: change settings to OneShot125 on ArduPilot and adjust the PWM_MIN to whatever value you need. then power off everything and power on. As we are sending OneShot 125 signal then the ESC's get initialized to that, and the twitching occurs no matter the PWM_MIN value we send.

If we set the value too high the motors do even spin without the copter being armed....

I've tested RC_OUT from 125 to 135.

@rmackay9 I remember you saying that we never send below (1000/125) I'm wondering if we should send below 1000(125)...on Oneshot 125

@lvale
Copy link
Member

lvale commented Sep 9, 2016

Following on this theme...

So I think I found a workaround for this issue.

Set your MOT_PWM_TYPE to 2 (OneShot125)

Now the values below have to be found by trial and error

Set the MOT_PWM_MIN to 1100

Calibrate the ESC's

Don't worry motors still twitching..

Power down, and power up

Now go to MOT_PWM_MIN and set it to a value below what was used for calibration, say 1000

Motors stop twitching because they are receiving a signal below their calibrated minimum.

Now arm, and check if the motors spin normally. In my case with the values above they were twitching, because the value they were receiving was very close to the minimum they were calibrated, so I played around with the MOT_PWM_MIN value used to calibrate the ESC until I was satisfied...

ok, It's a bit twisted process, and I'm not sure I made myself clear.

Now, up to test other ESC's and try to see if there's a minimum value between calibrated minimum and motor stopped...

@lokanaft
Copy link

lokanaft commented Sep 9, 2016

It's not a oneshot problem.
My setup work good after press safety with px4.io firmware with oneshot125.
And ardupilot work good, if disable safety switch.

@lvale
Copy link
Member

lvale commented Sep 9, 2016

@lokanaft

It's not a oneshot problem.
My setup work good after press safety with px4.io firmware with oneshot125.
And ardupilot work good, if disable safety switch.

Please tell us on which values the PWM_MIN was calibrated on the ESC (assuming the calibration was performed also using OneShot125, and which values are on the output of the Flight controller with either PX4 and ArduPilot before and after the safety switch is pressed, and also when the safety switch is disabled

My testing without any flight controller plugged in to the ESC, so no influence of either PX4/ArduPilot and safety switch - direct from a USB/Com interface and only using the BLHeli config tool the twitching was repeatable every time.

https://www.youtube.com/watch?v=wYAiCVsDLfI

There's always a chance that from the 3 types of ESC's (20 ESC's) I've tested (both Silabs and Atmel) they are all sub-standard.

@lokanaft
Copy link

My esc config:

125

I calibrate it as in MissionPlanner instruction

@lvale
Copy link
Member

lvale commented Sep 10, 2016

@lokanaft
Thanks. On a first glance the main differences, that could be related to this, are only the BLHeli version (14.6 vs 14.7), the PWM Frequency/Damped which is the active motor braking (Damped light vs Low), the Motor Timing (Medium Low vs Low) and perhaps also the Motor Startup Power (0,5 x 1.0).

Except for the version of BLHeli, I'll test the other differences and report back

@rmackay9
Copy link
Contributor Author

@lvale, it's ok to close this right? Because I think we've determined that it's not an issue with ardupilot.
I'll close but we can re-open if I've got that wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants