Jump to content

Futaba M6 Fr Sky 2.4 ghz DIY Conversion


Paul Luby
 Share

Recommended Posts

Hi DG3

Ref the 40 Pro Mini's, I do have other projects on the go and some of them may involve making gadgets for people on a user beware basis. The Pro Mini is a pretty good little Arduino cause of size and guys can't plug it into a usb port and mess it up.

Also I got them at a really good price (closing down sale so paid about half of the cost you quoted) and there genuine Deek Robot Pro Mini's. Right place right time really.

Like the use of the old JR gear as an Arduino Controlled Buddy Box.

By the way, nice scope pictures, what scope have you got as I'm in the market for a new one.

Agreed about the Taranis, I think its the most amazing radio to hit RC modelling in a long time.

I've just done the 6 position switch pot replacement on mine and am checking that out at the minute.

But most of my time over the last 9 days has been getting ready for the arrival of my new model workshop.

I've had to rearrange my garden quite a bit, digging an old shed a new base and moving it, claiming some land back by cutting down old fence posts and fitting new ones. Last of all laying a new deep base for my model workshop. Just for info its the garden that's a little wonky, my new base is perfectly level.

part paved.jpg

Have moved 7 tonne of dirt and assorted other stuff, ran out of sand and cement Tuesday night so having some more delivered tomorrow so I can continue. Then when that's done I'll get on with some more electronics stuff and await the arrival of my workshop.

I'm used to having a RAF Model Aircraft Club Building on Stations that I am posted to and my garage is now full to the brim with my stuff since I left the RAF. Wifey took offence to me doing soldering on the kitchen worktops I put in and on the dining room table she had designed and built in Germany when we did a tour over their. As I used to do it all in the garage when at home or in the club building when on camp she quickly came to the conclusion a workshop was the answer. Clever wifey.

But, had a day off today, my god I ache.

Paul

(AKA Veri-Gash)

Edited By Paul Luby on 18/06/2014 22:29:41

Link to comment
Share on other sites

Advert


Do a time-lapse of your workshop going up Paul!

@both, I've been busy too but done a bit on my six-channel Kraft Series 70, I use a float array of one more element than the channel count, the last element is set to the sync period (20ms minus sum of all the current channel pulse widths) so the output routine doesnt need to do a separate sync - for a six-channel frame it uses an index count of 7 and so does each channel as set by the stick mappings then the last 'channel' element is a big one and is actually the sync pause.

I'm also working on a self-calibration routine so you dont need to manually configure the map statements by measuring the stick voltages over the serial link. Instead you just waggle them and the stick extremes are stored in flash. Servo reversing is by holding over the relevant stick during power up and again is saved in flash, and it does a single-handed range check waggling the channels automagically while you wander off with the model.
Channel 5 is a momentary button and ch6 toggle-switched, both have optional servo-slow.

I'll post some code when its finished as its very much a 'work in progress'.

I was sidetracked by a slightly duff Nano from HobbyKing - analog reads from pin A2 were misbehaving and under the big magnifier you could see that particular header pin was dry. So I soldered it up and it now works intermittently - if you lean on the board it reads badly (actually it picks up from A3) - I think either a track is cracked or the A2 pad has lifted or something. A2 on the processor chip is right next to the A2 header pin so I could bridge it but then again they're so cheap...

Cheers
Phil

 

 

 

Edited By Phil Green on 24/07/2014 18:13:07

Link to comment
Share on other sites

Paul, Good work on the shed base. My body knows all about digging muck and building a shed! Looking forward to seeing completed pics.

The scope is a Rigol DS1052E, basic, cheap, does the job. **LINK**

@Phil, good tip on the additional element in the array to create the sync pulse. I'll try that out. There is always a better way to do things. Sharing code is the best way to learn. Looking forward to seeing your self cal sticks routine - sounds very sophisticated!

DG3

Link to comment
Share on other sites

Hi guys

Have you seen the Speed Sensor that T9 Hobbysport have got in for the Taranis. Arrived in stock today on the website and mines in the post already.

DG3

I'm looking at a Hantek scope, looks very similar to the Rigol.

Shed base material came about 1600 today, so only did a few hours. Only have 16 slabs left to lay and then it'll have four weeks for the drymix to go rock solid before the workshop arrives.

Phil

How do you initiate the Range Check auto servo waggling mode, assuming you are using an FrSky hack module, have you tapped into its range check initiation system?

Paul

(AKA Veri-Gash)

Link to comment
Share on other sites

It doesnt affect the RF power Paul just waggles the channels. All my previous projects do it, I find it very handy as I fly alone quite often.
So if you want low power its the usual Frsky bind button, theres no interface from the encoder, although it would be easy to do that... 
Did you see my bind-board alternatives?  they're the last two docs on the Archive page of singlechannel.co.uk
 smiley

As an aside I'm a firm believer that a low power range check isnt really enough, you're not testing the PA, although most people seem happy not to as they only have to walk 30 paces!

Cheers
Phil

Edited By Phil Green on 20/06/2014 01:07:28

Link to comment
Share on other sites

Hi Phil

I was looking at working out the bind circuitry for the FrSky RF module but don't have to now.

I'm gonna have to make time, sit down and read through a lot of the things on your site, I'm just a little busy at the moment.

Regards combined waggling and range check mode, it would easy to do with a little firmware programming.

Anyhow, got to go lay last 16 slabs for workshop base.

Paul

(AKA Veri-Gash)

Link to comment
Share on other sites

Hi Guys

Finished paving the Model Workshop base today, picture below.

Will wait a couple of weeks to let drymix set good and strong, fix gap in fence and then paint fence.

Model Workshop comes 3rd week July, yeah.

Will do some electronics stuff next week.

fully paved.jpg

Paul

(AKA Veri-Gash)

Link to comment
Share on other sites

Done a bit more on the Kraft Series 70 tonight.
Finally finished the physical install, up to now its had bits hanging out all over the place!
Its a DHT, I removed the LED from the bind board and fitted a new extended one behind the Kraft meter, and I removed the bind button and extended the connections to the Kraft trainer switch.

The "Self-calibration" is working great.

To calibrate, you hold a button down, switch on, and still holding the button, move each of the sticks into all four corners a few times (including the mechanical trims, or not, as you prefer). When done, you let go of the button and it saves the maximum and minimum values from each pot to flash. Every time you power-up it reads the calibrated values from flash and uses these for the stick maps.

You can repeat the calibration as often as you like but it only needs to be done once unless you change the stick configurations.

This makes the encoder more distributable - users no longer have to install the Ardiuino IDE, set up a serial session, manually note the stick voltages, patch them into the code... we can now issue pre-programmed chips and the end user can do the calibration easily themselves using only the transmitter sticks.

The code is a bit longer than I'd hoped as the sequencing is a bit awkward with the enforced setup() and loop() constructs and also each int has to be broken down into bytes for the flash write, and combined again on read. I'll see if I can streamline it a bit - I got the ppm frame output including sync down to only 5 statements by having the sync as another (long) channel.

The 'calibrate' button isnt dedicated - its my channel 5 which is a momentary push-button for towhook release, bomb drop etc. Channel 6 is a conventional 2-position switch for retracts, flaps etc (not that I'll ever use them)

Cheers
Phil

Edited By Phil Green on 24/07/2014 18:14:59

Link to comment
Share on other sites

Wow Phil

You have been busy, sounds great. Your dead right, the code will be more distributable as a result.

I've got my first day to myself in 2 weeks and have been looking at the 6 position switch modification for the Taranis. Guys are complaining that the output jumps between position selections. They've used a break before make switch and it does exactly as it says on the tin.

I've looked on line for a potentiometer with 6 detents but their not easy to find. Piher make a potentiometer that would do the job but their special bulk order (and I do mean bulk). It would also mean redesigning the switch mount so it all becomes difficult.

So I'm breaking down the 6 position switch and looking at replacing the switch assembly with a potentiometer whilst maintaining the 6 detents.

Will post some details later.

Paul

(AKA Veri-Gash)

Edited By Paul Luby on 23/06/2014 08:33:27

Link to comment
Share on other sites

Have you tried a capacitor to bridge the 'break time' Paul? the analogue inputs are around 20k impedance, I'm guessing the dividers will total 5k but they are disconnected during the break time (which is the source of the problem), so to ensure around a 100mS time constant (guess) I'd try say a 33 to 100uF tantalum, neg to ground, pos to the 6-way switch common.  Easy enough to try, eh?

Cheers
Phil

 

Edited By Phil Green on 23/06/2014 09:31:17

Link to comment
Share on other sites

Just taken a couple of pics and realised this one is a Series 71 not 70, I know there is a 70 somewhere in my shed!

I'm mode 2, left to right is the so far unused Kraft slide switch, originally for switching between two 72mhz crystals, the Kraft trainer button which is now the Frsky bind button, 1way/2way toggle switch, centre is the on/off slider, button is channel-5, left pot is expo, right pot is rates, then the channel 6 toggle. Pots are switched, fully anti-clock clicks for no rates or expo, although theres no need to physically connect the switch, its more of a tactile thing. The bind LED is visible behind the meter.    Internals havent been tidied up yet, a few loops of lacing twine will neaten it up:

img_4254.jpg

 

img_4256.jpg

 

img_4258.jpg

Edited By Phil Green on 24/07/2014 18:17:14

Link to comment
Share on other sites

Hi Phil

Thats turned out really nice hasn't it.

Check out this forum page for my Taranis 6 Pos Switch to 6 Pos Pot solution for the Taranis. Its at the bottom of the forum page.

I think its a better solution than the switch but hey, that's just me. Took me two and a half hours this morning.

Paul

(AKA Veri-Gash)

Edited By Paul Luby on 23/06/2014 12:08:22

Link to comment
Share on other sites

hi all

Have you seen this Arduino Radio Control web site.

Features

June 8, 2014 Version 1.5.5

  • Programmable with Linux or Windows via USB
  • up to 9 proportional channels, 6 channels by default
  • Channels controlled by a potentiometer or by a switch
  • 9 model memories
  • Model selection switch
  • 2 programmable mixers
  • Dual rate/Exponential switch
  • Throttle cut switch
  • End point adjustment
  • Subtrims
  • Potentiometers and servos calibration
  • Throttle security check at startup
  • Transmitter battery low voltage alarm
  • Arduino board with ATmega328 microcontroller (Nano v3.0 recommended)

**LINK**

djc

Link to comment
Share on other sites

There are quite a few more capable encoders, mine is a very humble effort but suits my retro refits. I much prefer to go my own way with the code though I'm indebted to Paul for his expo maths which works perfectly!

Here are a few more capable encoders:
**LINK**

**LINK**

**LINK**

**LINK**

So far mine is very much a work-in-progress project and will no doubt develop, there are better encoder projects out here, its more of a learning exercise for me after 20 years on pics.

So far, mine looks like this:
Chassis - Kraft Series 71, guts replaced with arduino nano
Frsky 2way or 1way switchable, extended bind button & led
6 channels, 4 propo, 2 switched (I've one as a momentary pushbutton) several 'spare' analog & digital inputs.
Self-calibrating sticks, saved to EEPROM during power-off - no measurements and presets needed!
Servo-reversing by holding sticks over on power-up, saved to EEPROM during power-off (throttle deliberately doesnt reverse in software, safety thing!)
Rates variable from 100% down to 10% via a pot, click for no rates
Expo variable from none to lots via a pot , click for no expo (thanks to Paul Luby for the expo maths!)

Avoiding the need for an LCD display is a challenge, and we do this for fun remember!

Cheers
Phil

Edited By Phil Green on 26/06/2014 21:31:31

Link to comment
Share on other sites

Posted by DJC on 25/06/2014 15:04:26:

Phil

if u do want to play with LCD, here is a site

 

Thanks, that looks like another interesting option to bookmark!
I do use LCDs extensively,   most recent project was Wayne Giles' Lipo ESR meter. I've written several LCD libraries for PIC, M6800, Z80 etc ,  eg
http://www.mccrash-racing.co.uk/pics/pulstar1.jpg
http://www.mccrash-racing.co.uk/pics/pulstar2.jpg
http://www.mccrash-racing.co.uk/pics/pulstar3.jpg

http://www.mccrash-racing.co.uk/pics/pulstar4.jpg
 

@Paul

Good choice Paul mines also a Hantek, its a DSO-2150 150 megsamples/second. Had it 2 or 3 years after my 'real' scope fell down the stairs (no really...) , the Hanteks are really good, I wouldnt be without mine. I use a spare digital out as a scope trigger from the encoder so you get a steady frame trace. You can filter that noise you see with the channel settings, though I only generally use that if its a trace I'm uploading.

Cheers

Phil

Edited By Phil Green on 25/06/2014 23:12:37

Link to comment
Share on other sites

Hi DG3

I went for the Hantek DSO5102P 2channel Digital Storage Scope in the end, its got 100MHz Bandwidth and a 1GSa/s Sample Rate.

My Uni-Trend UT81B scope meter is ok for the field but only has an 8MHz bandwidth and 40MSa/s Sample Rate.

So my new gadget should cover all things I do.

My old 20 MHz bandwidth tube scope went bang last year and I'd been managing with my scope meter but it was getting to be a little hard work. Don't get me wrong the scope meter is a great bit of kit but the monochrome LCD screen is a little resolution limited. Like I said, great for the field.

I've been meaning to ask, where abouts in the country are you?

Paul

(AKA Veri-Gash)

Link to comment
Share on other sites

Hi Phil

I'd forgot you could do that with an external trigger. That part of my old tube scope, that I acquired when a certain organisation threw it in a skip when it become obsolete, packed up years ago (after a leak in the garage roof). A section of the old proper copper tracked PCB burnt out in a spectacular manner so trying to fix it was not worth the effort.

It died when the high voltage transformer started whining and after a few years the whine got louder and it went bang.

Never mind, got me a nice new Hantek so I'm happy.

Paul

(AKA Veri-Gash)

Link to comment
Share on other sites

Hi Paul,

I like the big colour display on that scope. Specs look good.

I'm based in the Emerald Isle (Dublin), just over the pond.

I have updated my trainer TX code to include the last sync pulse within the ppm assembly function. I also tried to tighten up the code by calling functions for the dual rates and expo. I had to spend some time remembering how to work with a function! Obviously this is not necessary and could confuse a total beginner but here is the code if it is of any use for others to look at...

**LINK**

Link to comment
Share on other sites

Posted by Phil Green on 23/06/2014 02:28:17:

...I got the ppm frame output including sync down to only 5 statements by having the sync as another (long) channel.

 

Thats exactly what I did DG, saves a bit of space...
Your code looks really tidy!

Heres my stick calibration bit, its very verbose but works, I'll trim it soon.  I waste quite a bit of EEPROM space by using a whole byte each for channel reverse when a bit would do. But hey ho.

      while (startup==1 && digitalRead(digital01) == 0) {
          // calibrate sticks
           calibrated=0;
           for (int stick=0; stick <4; ++stick) {
             raw=analogRead(stick);
             if (raw > stickcalHi[stick]) stickcalHi[stick] = raw;
             if (raw < stickcalLo[stick]) stickcalLo[stick] = raw;
             }
      }  // this loop exits when you release the calibrate button...

        if (startup==1 && calibrated==0) {
          // done calibration, save values to flash
          for (ch=0; ch<4; ++ch) {EEPROMWriteInt(ch*4,stickcalLo[ch]); EEPROMWriteInt(ch*4+2,stickcalHi[ch]);}
          calibrated=1;
        } 
        if (startup==1) {
          // normal startup, read stick travel-values and reversing
          for (ch=0; ch<4; ++ch) {stickcalLo[ch]=EEPROMReadInt(ch*4); stickcalHi[ch]=EEPROMReadInt(ch*4+2); reverse[ch]=EEPROM.read(ch+16) & 1; }
          reverse[2]=0;   // no throttle reverse for safety
        }
 

... then you're into the main loop, standard stick reading & mapping, but we use stickcalLo[channel] & stickcalHi[channel] instead of the fixed, manually measured numbers...


        for (ch=0; ch<4; ++ch) {channel[ch] = map(analogRead(ch),stickcalLo[ch],stickcalHi[ch],-500,500);}
 

Needs smartening up,  but works fine as is.

Heres the reversing using stick-over on power-up. Theres no option to reverse the throttle (for safety):

        if (startup==1) {
          if (channel[0] > 250 || channel[0] < -250) { reverse[0] = reverse[0] ^ B00000001; EEPROM.write(16,reverse[0]); }
          if (channel[1] > 250 || channel[1] < -250) { reverse[1] = reverse[1] ^ B00000001; EEPROM.write(17,reverse[1]); }
          if (channel[3] > 250 || channel[3] < -250) { reverse[3] = reverse[3] ^ B00000001; EEPROM.write(19,reverse[3]); }
        }
       
        // end of once-only startup routines
        startup=0;
 

Again, very verbose,  needs pruning - currently sticks are in AETR order (initially thought it would be neater to have the sticks in channel order, but of course it makes no odds, the ppm output bit can re-order them) but if I put throttle on the last analog i/p it will go into a one line loop, and the 'read' part will be neater too

for (ch=0; ch<3; ++ch) {if (channel[ch] > 250 || channel[ch] < -250) { reverse[ch] = reverse[ch] ^ B00000001; EEPROM.write(ch+16,reverse[ch]); }

Heres the ppm output, the last channel array element holds the sync value.  D10 is the scope trigger:

 //send ppm frame, last channel holds sync value
        for (int ch=0; ch<7; ++ch) {
          digitalWrite(ppm, HIGH);
          delayMicroseconds(ppmPulse);
          digitalWrite(ppm, LOW);
          delayMicroseconds(channel[ch]);
          }
// temp scope trigger
          digitalWrite(scope, HIGH); delayMicroseconds(100); digitalWrite(scope,LOW);
        }
 

The bootloader has to go, it wastes a couple of seconds on power up and spoils the reversing trick.

I think its the elevon mixer next.

I'll post the whole thing when its tidy enough to show!

Cheers

Phil

Edited By Phil Green on 26/06/2014 21:44:23

Link to comment
Share on other sites

Just thinking about the 'map' function and how theres an inherent double-step now & then... caused by mapping a small integer range to a larger one thats not a multiple. On my pic encoders I spread the timing equally across the range. Hmmm. Is it a problem? not sure. [Ponders...]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...