Motors to respond only to positive pitch input - how?

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
tedbyers
Posts: 10
Joined: Fri Jun 19, 2015 8:33 pm

Motors to respond only to positive pitch input - how?

Post by tedbyers »

I wish to experiment with adding what I would call a pusher motor or two to a quad or hexacopter, to make a pentacopter, hexacopter (but very different from conventional hexacopters), heptacopter or octocopter (but very different from conventional octocopters). What I mean is that the additional motor or two would have its (their) axis parallel to the main axis of the drone, and thus orthogonal to the axes of the other motors. I want these motors to be off with zero, or negative pitch input (and they'll ignore roll and yaw input), and respond only to positive pitch input, increasing with increasing pitch input. This/these motor(s) provide only forward thrust. At the same time, all the other motors would respond to yaw, roll and pitch inputs in the same way that they would in a more conventional aircraft. Thus, the drone would hover and move backward in the same way that it's counterpart without the pusher motors would do. The purpose of the experiment is to see if adding one or two pusher motors can provide a top speed greater or equal to what can be obtained without them, and that with a smaller angle of the airframe relative to the horizontal. There are a variety of complicating factors to be explored experimentally, such as the size of the pusher motor vs the size of the rest, and the size of the props on the pusher motor vs the size of the props on the rest.

However, to proceed with this experiment, I need to do two things. 1) find a way to identify, in the mix, which motor is a pusher (can the mix be modified to take an additional value, conceived as a boolean, without breaking anything), and 2) modify the code that takes the mix and uses it, with the relevant inputs, to compute required RPM of the motor.

Can I trouble someone here to point me to the relevant files, and blocks of code, and perhaps a little explaination of how the code is conceived to work?

Thanks

Ted

FengShuiDrone
Posts: 234
Joined: Wed Dec 24, 2014 1:20 am
Location: ......

Re: Motors to respond only to positive pitch input - how?

Post by FengShuiDrone »

.
Last edited by FengShuiDrone on Fri Aug 07, 2015 1:46 pm, edited 1 time in total.

tedbyers
Posts: 10
Joined: Fri Jun 19, 2015 8:33 pm

Re: Motors to respond only to positive pitch input - how?

Post by tedbyers »

FengShuiDrone wrote:This dude did just that....but I have no clue if he's flying MW or not. https://www.youtube.com/watch?v=XRtAM2BG3LI
Maybe you should ask him if he's using an FC like yours.


Thanks for this.

It looks like he posted (three and a half years ago), and soon forgot it. I noticed several had asked about the control of the pusher motor, months ago, and the questions have not been so much as acknowledged let alone answered.

But we need to be clear, this is not just about making a drone with a pusher, but in extending the FC code to support it. I have seen similar experiments(and chatted briefly with the guy who did it), in which the guy that made it used a switch to turn the pusher motor on and off (something I find unacceptable as it gives no control over speed). While the specific code will be different, I'd be looking to do that same thing with Cleanflight and APM (and any other open source FC code, well, any that has a future).

Thanks

Ted

Deet
Posts: 129
Joined: Sun Jul 08, 2012 1:54 am

Re: Motors to respond only to positive pitch input - how?

Post by Deet »

just run it off a spare RX channel with a mix off your radio

tedbyers
Posts: 10
Joined: Fri Jun 19, 2015 8:33 pm

Re: Motors to respond only to positive pitch input - how?

Post by tedbyers »

Deet wrote:just run it off a spare RX channel with a mix off your radio


Thanks.

But there is a little missing information here. Yes, I could set, say, channel 6 (as I always set channel 5 to use my fmode switch to set flight modes) to take pitch input. And I can use the curve to ensure the motor sees an input value of 0 for negative pitch, and then increase the value sent on channel 6 as a function of positive pitch inputs. But then, how does the FC board know that it is to use that data to control that specific motor, or those specific motors? I really do not see how this can happen without some change to the code.

Assume I begin with a V-tail quad, and set up the mix appropriate for a V-tail, for motors 1 through 4. And then I turn it into a pentacopter by adding the pusher behind the tail. Yes, I can program the Tx to send, over channel 6, positive semidefinite values which are functions of pitch input. But I do not see how I can tell the FC board that the RPM for motor #5 is to be computed from channel 6 values. And it is the same if I transform it into a hexacopter with a difference by adding another 'pusher motor' to the front of the copter. Both pusher motors can take input from the same channel and will respond identically. But the question remains, how does the FC board know what values to send to the ESCs for the pusher motors?

Perhaps I am missing a piece of the puzzle. Most of my Rx have but 6 channels, four for TRAE, and two spares as it were. And I have just received a few more that have 9 channels. The question is, how does the FC know what to do with those extra channels? I would suppose that unless there is functionality already programmed into MultiWii for each of those channels, new code has to be added (much like I studied in flight PID tuning using a combination of switches and pots), but that still leaves the problem of that code knowing what motor(s) is(are) to be affected by the input.

ItsOnlyMe
Posts: 18
Joined: Sat Apr 18, 2015 4:25 pm

Re: Motors to respond only to positive pitch input - how?

Post by ItsOnlyMe »

interesting Idea!

I think the FC does not need to know if you are pushing from behind or not;

The FC tries to hold the copter level (or any angel you've set)
If you push, or even pull from behind the copter moves in that direction and the FC tries to hold it straight

tedbyers
Posts: 10
Joined: Fri Jun 19, 2015 8:33 pm

Re: Motors to respond only to positive pitch input - how?

Post by tedbyers »

ItsOnlyMe wrote:interesting Idea!

I think the FC does not need to know if you are pushing from behind or not;

The FC tries to hold the copter level (or any angel you've set)
If you push, or even pull from behind the copter moves in that direction and the FC tries to hold it straight


Thanks

True, the FC does not know, or care, what direction a given motor is pushing or pulling. But it does have to determine what speed the motor is to be spinning and send the appropriate signal to it through the ESC. The question is how does one write the code that tells it how to do that, and where does that code go? True, we can use the Tx to set the appropriate curve and send the data for that to the FC through a spare channel on the Rx, but then how does the FC know what to do with that data? Obviously new code is required, but I am left with the problem of writing the code so that it knows what ESC/Motor is affected, and how it is written so it sets the motor to have the right RPM.

ItsOnlyMe
Posts: 18
Joined: Sat Apr 18, 2015 4:25 pm

Re: Motors to respond only to positive pitch input - how?

Post by ItsOnlyMe »

Do you want this for a programming example, or just for use?

If the first one I'm out of the way, I'm no programmer.
in the latter case I would plug the pusher ESC(s) right into the receiver spare channel and mix a curve bound to throttle on the TX.
The FC doesn't need to know about the pusher(s)

tedbyers
Posts: 10
Joined: Fri Jun 19, 2015 8:33 pm

Re: Motors to respond only to positive pitch input - how?

Post by tedbyers »

ItsOnlyMe wrote:Do you want this for a programming example, or just for use?

If the first one I'm out of the way, I'm no programmer.
in the latter case I would plug the pusher ESC(s) right into the receiver spare channel and mix a curve bound to throttle on the TX.
The FC doesn't need to know about the pusher(s)


Thanks for this. if I was to do this only for one or two brushless drones, I would probably do just that. But I want to do it for some drones using coreless motors, and using, preferably the new AlienWii that supports hexacopters and octocopters.

Maybe I am biased, because I have been programming for decades, but I think a programmed approach is preferable because then, anyone who wants to use a similar model can just connect all his motors to the FC as usual. Further, some of the FC boards, such as the AlienWii, which runs MultiWii, has the Rx built in (only needing the sat to be installed), so unlike most other boards, there is no way to connect the pusher (or pusher's ESC) into the receiver. On the AlienWii FC, the esc/fet is built into the FC, so all one need do is plug the motors into the sockets provided. To do this for the AlienWii, I need to know where to find the code that uses the predefined mixes to calculate what to send to the motors via the ESCs, and perhaps how that code works (in case that isn't obvious), and perhaps suggestions on how best to extend that code. Of course, doing it for the AlienWii means that the solution can be readily applied to any FC running MultiWii, designed for brushless motors also.

As an experienced programmer using C/C++, I am not worried about doing the coding, but rather I am hoping someone can save me a lot of time reading through code that is not relevant to my task at hand, and perhaps explain the rationale behind the design for that code.

Deet
Posts: 129
Joined: Sun Jul 08, 2012 1:54 am

Re: Motors to respond only to positive pitch input - how?

Post by Deet »

You don't connect the pusher ESCs to the FC at all, you just run the ESC off the receiver channel

the FC wont care what you are doing unless you are in POS_HOLD

It is that simple, no code required, it will work

A friend has used this method with several different flight controllers, only exception is that he uses a slide control on his radio to alter the pusher thrust rather than a stick mix off pitch

tedbyers
Posts: 10
Joined: Fri Jun 19, 2015 8:33 pm

Re: Motors to respond only to positive pitch input - how?

Post by tedbyers »

Deet wrote:You don't connect the pusher ESCs to the FC at all, you just run the ESC off the receiver channel

the FC wont care what you are doing unless you are in POS_HOLD

It is that simple, no code required, it will work

A friend has used this method with several different flight controllers, only exception is that he uses a slide control on his radio to alter the pusher thrust rather than a stick mix off pitch


Thanks for this.

That is a method I am aware of, but it only applies if one is working with brushless motors. It is something I will do in the very near term when I work on drones powered by brushless motors. However, many of the drones I work on are built around the AlienWii, which has an Rx and the EScs/mosfets built into the FC board. There is, therefore, no option of plugging the motor's ESC directly into the Rx.

Thanks again,

Ted

FengShuiDrone
Posts: 234
Joined: Wed Dec 24, 2014 1:20 am
Location: ......

Re: Motors to respond only to positive pitch input - how?

Post by FengShuiDrone »

.
Last edited by FengShuiDrone on Fri Aug 07, 2015 1:46 pm, edited 1 time in total.

tedbyers
Posts: 10
Joined: Fri Jun 19, 2015 8:33 pm

Re: Motors to respond only to positive pitch input - how?

Post by tedbyers »

I think I found a solution, or the beginnings of one anyway. Please consider this:

What I am considering doing is adding a new define something like this:

#define PUSHER_MOTOR_MIX(X) ( (axisPID[PITCH] > 0) ? axisPID[PITCH]*X : 0)

And then the mix for a configuration with two pusher motors can be something like (in this case, as an example, using the motor numbering for a HEX):

#elif defined( HEX2PUSH )
motor[0] = PUSHER_MOTOR_MIX( 2 )
motor[1] = PUSHER_MOTOR_MIX( 2 )
motor[2] = PIDMIX(+1,+1,+1); //LEFT
motor[3] = PIDMIX(+1,-1,-1); //FRONT_L
motor[4] = PIDMIX(-1,+1,-1); //RIGHT
motor[5] = PIDMIX(-1,-1,+1); //FRONT_R

In this example, what is envisioned is an H frame hexacopter in which both of the rear motors are mounted as pusher motors. One could consider also beginning with a similar hexacopter in which it is the middle pair of motors, left and right, that are mounted as pushers. One can also mix the idea of pusher motors with other ideas, like a V-tail (or A-tail, or the same idea applied to the front pair of motors), in which the objective is to improve YAW authority, or, for a heavy lifter, have two pair of motors have coaxial motors, with a pair or two pair of pusher motors (provided the FC board has support for so many motors, and that the FC firmware can support so many motors).

This permits one to specify which motor is a pusher motor, and to have more than one pusher motor. It also allows one to let the other motors respond as usual to pitch, or to not respond to pitch, or something in between. It seems that if one is to have the pusher motor responding only to positive pitch input, for the sake of the efficiency of the motor/prop producing the forward thrust (3D props on quads are notoriously inefficient), then the other motors must respond to pitch input in order to be able to stop forward motion or to go backwards; and having them respond as usual to pitch may not hurt as one then gets additional forward thrust from them, though at the cost of slightly reduced forward thrust from the pusher prop and loss of efficiency because of downward thrust from the pusher prop working against the lift demanded from the throttle input (maybe it may be best to have the other motors respond only to negative pitch input, to do which is a relatively obvious extension of what I suggest above).

This seems to be a basic solution, but I will study it further to see if I can add support for an acceleration curve, as it were, so a pilot with a programmable Tx can create a model in the Tx in which speed control for the pusher prop is sent through another channel, such as channel 6, for which the input for the channel is pitch, but output is sent to channel 6 (in this example), so the curve set for the pusher motor does not affect how the other motors respond to the pitch input. Obviously, if one is to support pairs of pusher motors, they can assist with YAW, and so one can create an additional define, and mixes, in which the pusher motors respond to YAW input also (e.g. if one is turning left, speed up the left pusher motor a little).

I have seen reports from others who have experimented with pusher motors, but by connecting the pusher motors to otherwise unused Rx channels (as has been suggested here), who not only report pusher motors work well, but also that adding pusher motors increases the efficiency of the drone considerably during forward flight. I have seen various hypotheses offered as to why, all untested at present, but this remains an empirical observation I hope to replicate.

What do you think? Is the code I am considering sufficient? Is there something in the code I have missed? (If so, what and where?) How would I make the PUSHER_MOTOR_MIX define use input from one of the other channels, relying on a pilot defined curve, dependant on pitch, sent through another channel?

Post Reply