Twin Throttle Controller using AXE024

heli_madken

New Member
Hi,

I am in to Radio Control Helicopters and I am currently working on a twin rotor helicopter (if you are interested thread here - http://www.rcgroups.com/forums/showthread.php?t=679820) using two seperate motors controlled by Electronic Speed Controllers (ESC).

I have been experiencing a problem balancing the RPM of both rotors, amazingly there are no commercial products that can do this so I set myself a task of building my own.

I bought myself an AXE025 Servo Driver based on the 08M chip. After a false start mistakenly using analog input I got great help on this forum to put that right and now I have one servo (using servos to test rather than ESC's) working using the following code -

Do_loop:
pulsin 3,0,b0 (digital input from receiver on pin 3)
pulsout 1,bo (servo connected to pin 1)
goto Do_loop

I have the servo powered from a seperate supply to eliminate noise (common ground), however although it works I can see tiny oscillations form the servo when at rest is this normal?

The next stage is to connect a second servo on pin 2 in which case the code will be -

Do_loop:
pulsin 3,0,b0 (digital input from receiver on pin 3)

pulsout 1,bo (servo/ESC connected to pin 1)
b0 = b0 + 1 (modified output)
pulsout 2,b0 (servo?ESC connected to pin 2)
goto Do_loop

The idea being that I can modify the output to the second channel to speed up one or other of the motors to match the other.

Am I on the right track with this will modifying the value of b0 work in this way?

Thanks for any help, Ken
 
Last edited:

Tom2000

Senior Member
Ken,

I haven't tried anything like this but, with casual examination, it looks like your output method is a reasonable approach.

What I'm wondering, though, if the open loop method you're proposing will be effective. For instance -- how does the MCU know when one motor needs to speed up with respect to the other? Maybe its speed is OK, or maybe it needs to slow down?

I'd think you need to measure, at the minimum, rotor shaft RPM or, if your objective is to sync the rotors, the shaft position. (I'm thinking something like magnets and pickup coils, fed to some sort of external phase detector which tells the Picaxe whether to speed up or slow down the motor.)

Either that, or provide another channel from your transmitter that commands speedup/slowdown, so you can adjust the speeds from the ground.

As an alternative, is a mechanical linkage via something like a toothed belt feasible? If you mechanically connect the two motors/shafts, you're automatically sync'd.

Whatever solution you build, good luck with your project. It sounds like a winner!

Tom
 

heli_madken

New Member
Cheers Tom,

Yes that woudl be nice if there could be some form of feedback loop to the picaxe, but I only need to get the rotors within a reasonable amount of equilibrium +/- 50 RPM, the variable pitch angle of the rotor blades and a gyro control the pitch of the helicopter.

I have just finished wiring the whole setup together and it doesnt appear to work how I imagined as both servos move an identical amount so multiplying the pulsin (b0 = b0 + 1) in the way I thought doesnt do anything unless I am using too small a multiplier? more messing about I think
 

Tom2000

Senior Member
Ken,

I just read all of your postings in the other group. I've changed my mind: it's not only an objective to sync your rotors, I think it's mandatory. A mechanical linkage is probably your best approach.

Good luck. That's an amazing project!

Tom
 

Tom2000

Senior Member
Cheers Tom,

Yes that woudl be nice if there could be some form of feedback loop to the picaxe, but I only need to get the rotors within a reasonable amount of equilibrium +/- 50 RPM, the variable pitch angle of the rotor blades and a gyro control the pitch of the helicopter.

I have just finished wiring the whole setup together and it doesnt appear to work how I imagined as both servos move an identical amount so multiplying the pulsin (b0 = b0 + 1) in the way I thought doesnt do anything unless I am using too small a multiplier? more messing about I think
Your method is definitely increasing the pulse length to the 2nd servo, so if you add enough to b0 before the second servo drive, you should see some difference between the two. Try increasing the factor by more than one. Sooner or later, you'll see something.

By the way - your work is absolutely gorgeous!

Have fun!

Tom
 
Last edited:

Charliem

Senior Member
Hi Ken,

I have seen and was going to develope something to that effect to sync a twin enging airplane.never got around to it. From my research I found that (at least in my case) I have to use a master slave setup. have a picaxe on each motor and then have a master telling them what to do.
 

heli_madken

New Member
Thanks I might try that, at the moment this does seem to work, I tried putting in a value of 100 (b0 = b0 + 100) and I can definately see a difference in servo travel although in practice I would imagine I will need a much lower value for my purposes.

Next problem is that the code executes straight away on power up which means that one rotor may fire up straight away. What I could do with is a control mechanism something like -

if b0 < ??? then exit sub (not sure of syntax for this form of basic)

Problem I have is not knowing what ??? is, does anyone know the default pulse value is for a receiver channel at rest, maybe I should just experiment?
 

heli_madken

New Member
Yep that works (why am I answering my own questions? must be going mad :))

Code now is -

Do_loop:
pulsin 3,1,b0

if b0 < 120 then gosub lowstick

pulsout 1,b0
b1 = b0 + 10
pulsout 2,b1

lowstick:
goto Do_loop

I can feel a dead stick point at zero throttle now.

I think I may also have had the pulsin command the wrong way, I originally had pulsin 3,0,b0 which I think may have been starting high and working low now with pulsin 3,1,b0 the multiplier seems to have more of an effect.

This is fun!
 

BeanieBots

Moderator
As an RC helicopter pilot myself, to be honest, I wouldn't use a PICAXE for such a project and would use a good programmable RC transmitter such as the MULTIPLEX Profi 4000 which can handle profiled dual output curves specifically designed for such applications.
However, if you want proceed with a PICAXE solution, then you are on the right track.
You are going to need frequent servo updates so using pulsout rather than the servo command is IMHO the correct approach.
As already mentioned, you are going to need some form of feedback. It is hard to know what would be the best form. You obviously already know that it is the RPM/Torque/pitch combination which matters rather than overall RPM or even equal RPM. To that end, I would be looking at a very sensistive RC gyro similar to the type used in a conventional heli-tailrotor compensation.
Keep RPM constant by use of throttle curve compensation from pitch setting.

Looks like a great and very ambitious project.
I wish you the best of luck.
 

heli_madken

New Member
Cheers,

My main problem is the complexity of this heli, I have a 10 channel fully programmable TX and RX all channels are assigned as there are a total of 13 servos and 4 speed controllers to drive in various combinations. So I cant free up a seperate channel and have two distinct throttle curves for each rotor head

I have gyros on all 3 axis, my goal here is to get rotor RPM somewhere close in order to give the gyros less work to do

One thing I am concerned about is electrical noise from the servos, at the moment I have them powered seperately but in the heli I wont be able to do this, has anyone got any suggestions of what I could use, capacitor etc, to cut down noise and where I would place it in the circuit of the AXE024

Thanks
 

BeanieBots

Moderator
Connect the servo directly to the power pack but run the PICAXE via a 100R resistor. Put about 100uF on the PICAXE side of the 100R and 100nF as close to the PICAXE power pins as possible.
That should be enough as long your layout is also OK.
Come back if you have problems.
Great project!
 

Wrenow

Senior Member
This is very similar to the Fire Control Assistant project I have been working on for Big Gun R/C Model Warship Combat (reads 3 receiver pulses, outputs one, modified or unmodified pulse, depending on the two of the inputs). To automate the operation of the stern turret when the forward turret rotates to the "sweet spot" where both can engage and coordinate/"converge" fire.

I am also using the AXE024, as it has the power filtering built in - solved lots of issues for me. By the way, you can use the servo outs as ins for reading the pulse, even with the resistors in place - nice. Also, keep in mind that you have an additional input pin you can use (it is one of the pins for the colour sensor).

So, in answer to your question about servo noise, it is already largely filtered on AXE024 the board.

Cheers,

Wreno

Cheers,

Wreno
 
Top