Wii-bar - MultiWii as Flybarless controller for CP helis?

Post Reply
JussiH
Posts: 39
Joined: Thu Jan 20, 2011 1:16 am

Wii-bar - MultiWii as Flybarless controller for CP helis?

Post by JussiH »

I have set this up in the vain hope that someone here can help develop the MultiWii controller into also working as a CP heli stabiliser/V-bar for 120 degree swashplates!

Basically we need to control 3 or 4 servos. Tailservo will most likely be controlled by a Dedicated HH gyrol Frame-rate should preferably be configurable between 50 and 333Hz. As I see it, it would basically be a tricopter mix modified to run servos. We would need to be able to define the travel and mixing rates between the 3 servos, in order to reduce interaction and finetune the swash servos!

To solve the throttle mixing problem we could use a 1S swash mix on TX and connect pitch channel to the throttle channel on Duino. Then throttle channel from RX just connects directly to to Heli ESC. As far as I can see that would allow us to use the throttle curves and stunt modes of the TX and still leave us the use of the 5th input channel for mode selection!

I cant code....at least not very good! But I am willing to put a SJM400V3 on the line.... ;)

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by Hamburger »

why not just remove throttle from the calculation of the 3 outputs for the servos?
Hamburger

cass3825
Posts: 14
Joined: Thu Mar 31, 2011 3:09 am

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by cass3825 »

Jussi,

Test code will be emailed tonight. No mixing in the Tx is required. Servo assignments:

3 Tail Servo
A0 Front CCPM Servo
A1 Left CCPM Servo
A2 Right CCPM Servo

Heli ESC should be driven 'governor style' from flight mode switch, external to Arduino for now. Still wrapping my mind on how best to handle throttle...

Please test at low throttle!!!

Servo refresh rate set with variable 'frameRate', adjustable from 333Hz to 69Hz.

This should be interesting!
Billy

jimnaz
Posts: 16
Joined: Fri Jan 21, 2011 5:21 pm

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by jimnaz »

Some time back, Alex wrote code for me that does what you are trying to do. It was posted and works very well in my heli.

What Alex did was to include the servo.h library to handle the servo chores. That way no special servos are needed.

The flow is so that you use a basic no mixing heli setup. The Multi Wii does the mixing of the servos. The receiver is connected to the WMC by having the throttle channel is not connected to the WMC. Instead, channel 6(usually Collective on the radio) is plugged into the WMC where throttle went. Throttle (ESC) is connected to the receiver.

The result of this is that you now have Throttle Curves you can set on the transmitter and pitch curves that you can set on the transmitter. Cyclic controls are then mixed on the WMC as well as allowing the IMU to input to the Cyclic. After all, that is all the IMU should do. On my project machine, a 450 Clone, the PID setting routine required much work to get right. If the flybar is used the PID settings are practically nothing since the flybar acts as a mechanical gyro system. If flybarless, the conflict between the flybar and the IMU is avoided. The only thing I had to deal with was that the WMC board and IMU were a bit large and awkward in shape.

I too wish to have a FBL machine that works well and can be dialed in. I am also willing to contribute as I can.

May I be included in the test code? Maybe with a couple of approaches to the goal will help.

Centurian
Posts: 44
Joined: Sat Jan 22, 2011 10:55 am

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by Centurian »

Should work w/o modification other than the servo refresh rates. How well will be interesting.

To make it work well, these things should be addressed:
The arming proceedure should be disabled.

May require independant servo directions/reversing for individual ccpm servo outputs.

Servo refresh rate should be independant for tail as many setups use digital t/r servos and analog swash/ccpm servos.

A mode that disables sensor output to servos would be necessary to do a proper mechanical set up on the heli. (could be done by setting all gains to 0 in the GUI, but that would be a pain)

Trying to think if there are enough defined variables to adjust the relative cyclic and collective mixing output to the servos. With arming disabled, I think this could be handled with TX atv's, but I'm not positive. May need to constrain total servo output AND the relative servo to servo differentials to prevent mechanical binding issues.

The electronics package could be the size of a pro mini and about 20mm tall if layout was done efficiently.

I'm really curious how well the yaw response will compair to dedicated heli gyros, this will be pretty telling about the quality of sensors and/or code.

Interesting project, I'm amazed that someone has not done some serious integration already :idea:

Hope the above is helpful, just throwing out what comes to mind. I have never messed with any of the commercial flybarless systems, if anyone has, might offer up any features that are necessay that have been overlooked

Centurian
Posts: 44
Joined: Sat Jan 22, 2011 10:55 am

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by Centurian »

One more item that may prove important.... need to find a way to limit "I" term cyclic "wind up" prior to take off or could have some ugly supprises!!

JussiH
Posts: 39
Joined: Thu Jan 20, 2011 1:16 am

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by JussiH »

Billy

You are way fast! Thanks for taking the time. I will build one for my SJM400 and test it soon. Just too bad I have to work saturday, cuz the forecast is for 17 celsius and sunny....

I have taken the liberty to post the code here - remember this is dev version - use at your own risk and take care!

Thanks

Jussi
Attachments
MultiWii1_preter7_CCPM.zip
Wii-bar test skech by Cass3825
(22.97 KiB) Downloaded 268 times

jimnaz
Posts: 16
Joined: Fri Jan 21, 2011 5:21 pm

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by jimnaz »

420RcPilot wrote:Billy

You are way fast! Thanks for taking the time. I will build one for my SJM400 and test it soon. Just too bad I have to work saturday, cuz the forecast is for 17 celsius and sunny....

I have taken the liberty to post the code here - remember this is dev version - use at your own risk and take care!

Thanks

Jussi


Hey Jussi and Billy,

I downloaded the code to test it out.

At first it didn't work so I downloaded and expanded it once again and then had to change it for a Pro Mini and comment out the lines that referred to the stable pin. It would not compile until I did that. Now it compiles and runs. Next is to see how it works with servos.

Can you give some more explanation about the FRAME RATE selection? The lower refresh is for analog servos???

cass3825
Posts: 14
Joined: Thu Mar 31, 2011 3:09 am

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by cass3825 »

jimnaz wrote:Hey Jussi and Billy,

I downloaded the code to test it out.

At first it didn't work so I downloaded and expanded it once again and then had to change it for a Pro Mini and comment out the lines that referred to the stable pin. It would not compile until I did that. Now it compiles and runs. Next is to see how it works with servos.

Can you give some more explanation about the FRAME RATE selection? The lower refresh is for analog servos???


Jim,
Analog servos are meant to run at 50Hz without overheating. Most can handle up to twice that and survive, but do get warm. For testing, I would try lower frame rates to protect the servos, then increase frame rate only if you want faster response from the servos.

Keep us informed on your progress!
Billy

jimnaz
Posts: 16
Joined: Fri Jan 21, 2011 5:21 pm

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by jimnaz »

Disregard, Triple post. :oops:

Jim
Last edited by jimnaz on Mon Apr 04, 2011 6:37 pm, edited 2 times in total.

jimnaz
Posts: 16
Joined: Fri Jan 21, 2011 5:21 pm

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by jimnaz »

Disregard. Double mesage
Jim
Last edited by jimnaz on Mon Apr 04, 2011 6:36 pm, edited 1 time in total.

jimnaz
Posts: 16
Joined: Fri Jan 21, 2011 5:21 pm

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by jimnaz »

Hey Billy,

I don't know what happened, but now the code will not run. I did not change anything so when I turned everything on again and no movement on the GUI and it locks up again, I was confused.

The same board with 1preter7 loaded works fine as before just the CCPM code will not. The code will compile but just not run.

Well back to more checking out.

Jim

cass3825
Posts: 14
Joined: Thu Mar 31, 2011 3:09 am

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by cass3825 »

Jim,
Sorry for the delay, I didn't realize the thread has spilled over to a second page. I'm not sure what's causing the problem. Have you tried downloading the original code, commenting out the stable pin stuff like before and then loading that to the board? I only have a 'mega to test on here, so I'm not sure what else to try. Maybe Jussi can load it on his mini and report?

jimnaz
Posts: 16
Joined: Fri Jan 21, 2011 5:21 pm

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by jimnaz »

cass3825 wrote:Jim,
Sorry for the delay, I didn't realize the thread has spilled over to a second page. I'm not sure what's causing the problem. Have you tried downloading the original code, commenting out the stable pin stuff like before and then loading that to the board? I only have a 'mega to test on here, so I'm not sure what else to try. Maybe Jussi can load it on his mini and report?


Hey Billy,

I have tried the following:

Loaded and run 1Preter7 with no problem

Compiled The CCPM code no problem

Tried to run the code and it locks up and no motion from the board

Tried the CCPM code by downloading the file, decompressing it into its own folder, Compiled it after commenting out the stable pin code, and the result has been the same------hang up and no go. Another weird thing is that the stable pin code creates an error even with the Mega board selected or the Pro-Mini board selected. :?: :?:

This has been a bit frustrating especially so since I had it running for a short time on my first attempts.

It looks like I will continue to use the version Alex wrote for me( V1.2CP) with the servo library.

cass3825
Posts: 14
Joined: Thu Mar 31, 2011 3:09 am

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by cass3825 »

jimnaz wrote:Hey Billy,

I have tried the following:

Loaded and run 1Preter7 with no problem

Compiled The CCPM code no problem

Tried to run the code and it locks up and no motion from the board

Tried the CCPM code by downloading the file, decompressing it into its own folder, Compiled it after commenting out the stable pin code, and the result has been the same------hang up and no go. Another weird thing is that the stable pin code creates an error even with the Mega board selected or the Pro-Mini board selected. :?: :?:

This has been a bit frustrating especially so since I had it running for a short time on my first attempts.

It looks like I will continue to use the version Alex wrote for me( V1.2CP) with the servo library.


Hmmm, I don't get a compile error when the 'mega is selected. When you tried to compile with the 'mega selected, did you also uncomment the stable lines in setup and loop? Regardless, this doesn't explain why it worked initially and now doesn't. Hopefully others with a pro-mini will load the code and comment. Maybe I just need to order one! Shhh, don't tell my wife, she thinks 10 arduino boards are enough!

jimnaz
Posts: 16
Joined: Fri Jan 21, 2011 5:21 pm

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by jimnaz »

Hey Billy,

News on maybe some progress.

It now compiles with no errors for the Mega.

I can now select other aircraft types and setups with no compile errors as well as load the tri and quads configurations and they run fine on the GUI.

If I try to add the CCPM code by uncommenting it, the code will not run on the GUI. The issue has to be with the Code for the CCPM that is breaking it on the Pro-Mini. I will try more to see if there is a specific line or lines that break it. It is my gut feeling that it has to do with the timing and speed of the CCPM stuff that is the culprit. I am not a great coder but I may stumble across a solution.

cass3825
Posts: 14
Joined: Thu Mar 31, 2011 3:09 am

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by cass3825 »

Thanks for the update. I have not modified the GUI code to recognize the CCPM mode, so that part is not surprising. I'm not sure, however, that this issue is related to the sketch not running on the Pro-Mini.

You might be on to something regarding the timing and speed of the CCPM. Have you tried to lower the frame rate down to 50Hz and see if the code will run?

Fingers crossed,
Billy

jimnaz
Posts: 16
Joined: Fri Jan 21, 2011 5:21 pm

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by jimnaz »

cass3825 wrote:Thanks for the update. I have not modified the GUI code to recognize the CCPM mode, so that part is not surprising. I'm not sure, however, that this issue is related to the sketch not running on the Pro-Mini.

You might be on to something regarding the timing and speed of the CCPM. Have you tried to lower the frame rate down to 50Hz and see if the code will run?

Fingers crossed,
Billy


Hey Billy,

Thanks for the feedback. I had not thought about the GUI needing changes to read the data for CCPM. Any idea when or if you will be doing that? If not can you point me in the direction to change what needs to be changed?

I don't see where I could change the frame rate to 50Hz. The lowest one in the FRAME_RATE define is 69Hz. If you can direct me to how to change and where to change the timing, I will be glad to try it.

Another question. Are you using the Helicopter transmitter mode or the plane mode? Is the throttle connected to the MWC or to the receiver directly. Collective would then be connected to the MWC where the throttle was connected?? Servos connect to where the ESC's were connected. Is that right?

Jim

Thanks for your effort in this. It would be great to get this working.

cass3825
Posts: 14
Joined: Thu Mar 31, 2011 3:09 am

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by cass3825 »

I will take a look at the GUI code this weekend and see what can be done. Processing (the language that the GUI is written in) shares many similarities with Arduino, so I'm hopeful I can wrap my head around it.

My bad, I forgot I didn't allow for anything below 69Hz. Please try 69Hz and see if it will run.

No mixing is required in the tx, so use plane mode. The ESC will need to be connected directly to rx, but not on the throttle channel (the Arduino will be using the throttle channel for collective pitch). Connect the ESC to a free channel driven by a switch on the transmitter, and manipulate rotor speed by changing endpoints of the channel in the tx. Start with very low endpoints! This is similar to 'governor mode' if we were setting up a normal heli. This approach is only temporary to verify proof-of-concept of the code, I'll come up with a better ESC control once the basic code is successful. No sense in painting the car until we get all of the dents out! Okay, that was a lame analogy, but you get the point.

Servo pin assignments can be found on the first page of this thread, about 3 or 4 posts from the top.

Thanks for your help testing this, I'm confident we'll get it going!
Billy

aamorin
Posts: 21
Joined: Tue Jun 07, 2011 8:49 pm

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by aamorin »

Hi!

What happened with this idea?? Perhaps there is already some very cheap flybarless controllers out there (~45 on HK) I think this is a great idea to be made; I'll love to help, perhaps I don't know pretty much about programming but I'm an IT guy, there might be something I can do..
Perhaps Alex could help us? Incorporating a model to the Multiwii code as some guys here have done..

Cheers.

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by PatrikE »

There's another thread about this where some more work has ben made.
http://www.multiwii.com/forum/viewtopic.php?f=7&t=611

It's possible to merge it with the aeroplane thread since its only a few #defines and the servomixer in output the thats different.
http://www.multiwii.com/forum/viewtopic.php?f=8&t=364

/Patrik

aamorin
Posts: 21
Joined: Tue Jun 07, 2011 8:49 pm

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by aamorin »

PatrikE wrote:There's another thread about this where some more work has ben made.
http://www.multiwii.com/forum/viewtopic.php?f=7&t=611

It's possible to merge it with the aeroplane thread since its only a few #defines and the servomixer in output the thats different.
http://www.multiwii.com/forum/viewtopic.php?f=8&t=364

/Patrik


Excellent ! Thanks a lot Patrik, I'll subscribe to it then, since as I said before perhaps there are some cheapest solutions, I like arduino, and the posibility to have autolevel, alt hold, etc etc..

Cheers!

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Wii-bar - MultiWii as Flybarless controller for CP helis

Post by PatrikE »

The code is now updated to latest version. r486.

More info in the aeroplane thread.
http://www.multiwii.com/forum/viewtopic.php?f=8&t=364&p=8312#p8312

/Patrik

Post Reply