FW1.2 R4 Channel Forwarding disables some motor outputs
As in the topic: while Chan FWD is enabled, motors 1 & 2 do not spin for Hexa config. Loop time 2000us Board Naze32 rev6.
I'm affraid this is a problem all MultiWii/Basefligh/Cleanflight derivatives are facing. There are not enough timers for all possible motor and servo configurations. This issue was rised at least few times, there is no solution. When Multirotor mixer is used, only 2 outputs can drive servos. Those are output 1 and 2. Then, output 3 acts as output 1 and so no. Motor 5 should be on INPUT 5 and Motor 6 on INPUT 6. But you would have to test it. And it works only with PPM input or SerialRX.
You might want to read #174 #141 cleanflight/cleanflight#1954
OK, I reopen it. Looks like we've broken something in 1.2 since it was really working like described in 1.1.
It is also possible that it was working in 1.1 as an actual bug since FEATURE_CHANNEL_FORWARDING was not considered as "servo" output and probably was driven at 490Hz
@digitalentity we might have a problem here. This stoped working because 2 things happened.
- in 1.2 FEATURE_CHANNEL_FORWARDING is considered as "servo" output and MOTOR1 and MOTOR2 are remapped to servos
- 1.2 also introduced TARGET_MOTOR_COUNT and it is set 6 on NAZE target. So, INPUT5 and INPUT6 will not act as outputs even with refresh rate of 490Hz.
So, we either test it with TARGET_MOTOR_COUNT = 8 and allow 2 first motors to act as servos, or do not remap them to 50Hz and allow INPUT5 and INPUT6 to output AUX channels at 490Hz
Ideas?
@DzikuVx
- I wonder if FEATURE_CHANNEL_FORWARDING should remap few channels as servos. I suspect it's good for compatibility reasons and we really had a bug in 1.1
- It should work anyway since TARGET_MOTOR_COUNT limits number of motors, not the total number of outputs - we should still be able to have 2 servos + 6 motors on NAZE.
Ok, looks like on NAZE target FEATURE_CHANNEL_FORWARDING only allows 4 motors. INPUT5-8 are mapped to servos as well. This is the way outputs are mapped in Cleanflight as well.
We might want to fix that.
Do you mean only 4 motors when CH FWD is enabled? If yes, then I can tell you it's not true. Either CF & BaseF allow 6 motor outputs with this feature. Is it possible to make 6 motor on Output pins 1-6 (for hexacopter) and at least 1 (2 would be perfect) servo on Inputs 5-8 at 50Hz and remaining for digital servos/gimbal (can be 490Hz)?
Ok figured it out, Channel forwarding is NOT considered useServos in mixer code. We do consider it as true useServos flag this causes us to map first two outputs to servos with only FEATURE_CHANNEL_FORWARDING enabled.
@xdigyx can you test #540 and see if it fixes the issue?
OK. Please share .hex
https://drive.google.com/open?id=0Bx6X245zlrsneWtmTEx3d2Q3Q0U
Check this: inav_1.2.0_NAZE.hex.gz
heh, both within minute :)
:smile:
@digitalentity I wonder how this really works. If 2 outputs are not remapped as servos, but still used as outputs (INPUT 5 and 6) what is really refresh frequency on them. And if it's really 490 (400?)Hz then why servo he had connected there did not fried after all?
The problem is not with servos, it's with motors. As far as I know @xdigyx is flying a hexacopter - he needs 6 motors while CHANNEL_FORWARDING leaves us with only 4 in current implementation
@digitalentity I mean in 1.1.
OK, never mind, I see it now. There is a special routine in pwm_mapping.c that allows this to work.
Man... every time I see pwm_mapping.c the more and more I do not like that code...
Me to. It's a constant source of bugs
Plus, looks like, channel forwarding in multirotor is working only with NAZE and SPRACINGF3. Other targets are not configured