DigiSpark 2+1 encoder

Single to Multi propo
Post Reply
User avatar
Phil_G
Posts: 597
Joined: 15 Feb 2018, 23:32
Contact:

DigiSpark 2+1 encoder

Post by Phil_G »

Me and Frank both love the DigiSpark ATtiny85 boards, they're so neat and tiny!

digisparkboard_usb.jpg

The 1+1 encoder has been quite popular, with maybe 30 units sent out, and since I've been looking
at smaller trim-less stick units, adding a propo elevator to make a DigiSpark 2+1 seemed a good idea :D
In practise its almost identical to the Mk 3 version of the 1+1, the throttle is on a button
with 3 sequential positions, off, mid, high, mid, etc - with the mid point either at half or set
as required during calibration. Holding the throttle button cuts the motor from any position.
With the 2+1 we lose the throttle LED, unfortunate but there are only just enough pins!

The stick is calibrated as usual by powering-up with the button held in, waggling the stick
around its extremes, then releasing the button. To set the throttle mid-point just hold the
elevator off neutral as the button is released at the end of calibration - ie imagine for a moment that the elevator stick is the throttle - the throttle mid-point is set to wherever the elevator stick is when the button is released.

Normally we use stick units with mechanical trims, but for this one I wanted to use the cheap ebay stick and it doesnt have them, so the encoder has subtrim on rudder & elevator by holding the stick over and dabbing the button, with trim-pips and a double-pip to indicate neutral trim.

Reversing is as usual by holding the stick over during power-up and theres the inactivity warning
in case you leave it switched on. Throttle midpoint, subtrims and reversing are all saved to flash.

It has a V-tail/elevon mixer derived from rudder (aileron) & elevator, which is permanently enabled and appears on receiver channels 5 & 6, rather than using an 'enable' switch or link. The rudder and elevator channels remain exactly as they were. Its a 60:40 mix which should be a good compromise for flying wings (pitch sensitive) and V tailers. The only disadvantage (if it is one) is that a V tailer or flying wing would need a 6ch receiver.

The small ebay stick I bought recently tracks nicely, its very linear but doesnt centre very accurately - neither did the Playstation gimbal - so the 2+1 code has a presettable 'dead-band' on each axis to ensure accurate neutrals. The transition through the dead-band is perfectly smooth so you dont notice it at all as its a true ' Image ' curve, not just "if its near neutral then its neutral" - I have seen others do it that way and its not good as the servo 'jumps' out of the deadband.

I have mine set to +/- 30uS which is the equivalent of 3 trim-pips either way. The subtrims arent affected by this, and of course with the deadband enabled its not intended for sticks with mechanical trims which would be lost in the deadband.

DigiSpark Connections: (on Digisparks they use P0, P1 P2 etc to mean D0, D1, D2 etc)
D0: PPM output to module
D1: Buzzer, preferably but not necessarily buffered
D2: Elevator pot wiper (D2 is Analogue 1)
D3: Throttle 'push to make' button to ground
D4: Rudder pot wiper (D4 is Analogue 2)
D5: is unused

5v: to rudder & elevator pot (outer tag)
0v: to battery neg, RF module neg, buzzer neg, button neg and rudder & elevator pots (other outer tag)
Vin: to RF module positive and switched positive from battery (2S lipo, PP3 etc)

The DigiSpark board is only about 3/4" square so with a small stick unit is ideal for a miniature
2 channel or 2+1 tranny. Its not fiddly though as the connections are the usual 1/10" spacing.
You can safely saw off the USB connector which we dont use. Pull off the schottkys and program
it directly with a USBASP, dont use the bootloader as the Digispark one has a full 5 second startup
delay :roll:
Here's the programming adapter: viewtopic.php?f=41&t=60
The code is an edit of an older project which was an edit of the 7ch, so whilst it works perfectly
it isnt very pretty, for example the DigiSpark has no 16-bit timers so for ease, the PPM is inline.

Its unlikely but should anyone want one I could send them out as a heatshrunk pre-wired module
like I do with the 1+1 Image

Cheers
Phil
Attachments
digispark_two_plus_one_mk3_db.ino
(8.84 KiB) Downloaded 178 times
Martin
Posts: 744
Joined: 16 Feb 2018, 14:11
Location: Warwickshire

Re: DigiSpark 2+1 encoder

Post by Martin »

Have you tried the "Beetle" Arduinos?

Image

They're based on the ATMega32U4 (same chip as an Arduino Pro Micro or Leonardo) but not all the pins are bought out to terminals. Much more capable than the AT Tiny ones and not much bigger. You can get them for about £3.50 on Ebay. The 32U4 has a built-in USB interface so you don't need any programming gear - you just plug the Beetle into a USB port and it's ready to program.

The 32U4 can be set to run its USB connection in 'host' mode or whatever it's called, so you can program the beetle so that, to the PC, it looks like a mouse, or keyboard, or other USB device. I used one to make a wireless interface for running R/C simulators on a PC - and then I control the simulator using a normal 2.4GHz transmitter. The interface is just a radio receiver wired to the Beetle. The sketch decodes the receiver PPM signals and presents itself to the PC to look like a normal PC joystick.

I guess you could saw off the USB connector part after programming (or maybe before programming if you use a USBASP) but I've never tried that myself.
User avatar
Wayne_H
Posts: 809
Joined: 17 Feb 2018, 05:26
Location: Temora, NSW. Australia
Contact:

Re: DigiSpark 2+1 encoder

Post by Wayne_H »

Thanks Phil for what looks and sounds like another great project - already added to the list :lol:

I'm thinking it would make a neat GG tx!!
Cheers,

Wayne
Once a Retrobate, always a Retrobate............ ;)
User avatar
tiptipflyer
Posts: 393
Joined: 16 Feb 2018, 22:49
Location: Germany

Re: DigiSpark 2+1 encoder

Post by tiptipflyer »

Hi Martin, hi Phil, hi everybody else,
yes I did. I have two transmitters using the Beetle.
The first is a converted MacGregor Digimac2, you can find it here:
viewtopic.php?f=27&t=35&p=333&hilit=digimac2#p333
The second one is a Babcock Magic Wand replica.
Babcock3.JPG
Babcock6.JPG
Both are working great. I used the Leonardo Beetle, because it is so tiny, it has more possiblities than an Attiny85 and I wanted to try them out.
However they are a kind of tricky to program.

Cheers
Frank
Last edited by tiptipflyer on 03 Dec 2018, 11:16, edited 2 times in total.
User avatar
Phil_G
Posts: 597
Joined: 15 Feb 2018, 23:32
Contact:

Re: DigiSpark 2+1 encoder

Post by Phil_G »

tiptipflyer wrote: 02 Dec 2018, 13:06 I have two transmitters using the Beetle. The first is a converted MacGregor Digimac2, you can find it here:
viewtopic.php?f=27&t=35&p=333&hilit=digimac2#p333
Hi Frank, I'm really sorry I didnt realise you'd already done a 2+1, somehow I missed that thread altogether! I did get a couple of Beetle boards but haven't done anything with them yet.
Cheers
Phil
User avatar
tiptipflyer
Posts: 393
Joined: 16 Feb 2018, 22:49
Location: Germany

Re: DigiSpark 2+1 encoder

Post by tiptipflyer »

No problem Phil, I read over a lot of things also without really noticing what´s going on.
The beetle is a nice little board with a lot of functions, but I still have to find an easy way to program them.
I am not a programming specialist and I needed some time until I found out, how to use it.
Mine did not program using USBASP, I had to do it via the onboard USB and the parallel programmer. After starting the upload, I had to manualy reset it by shorting ground to RST with a short wire for a moment. Then the upload started.
Not a comfortable way of programming, but it works.
Maybe one of you guys find a better way.
Cheers
Frank
ChrisBe
Posts: 13
Joined: 16 Feb 2019, 06:49

Re: DigiSpark 2+1 encoder

Post by ChrisBe »

Hobby Shack Aero Sport 2 channel conversion
Hobby Shack Aero Sport 2 channel conversion
Hey Phil! Hope all is well with you. Recently completed converting a Hobby Shack Aero Sport 2 with Digispark 2+1 encoder board and an FrSky DJT module with case removed and in "DHT" configuration. It's a nice simple/basic transmitter to work with. Fun little project. All works as advertised. Thanks again! Chris
Inside the conversion!
Inside the conversion!
Post Reply