DigiSpark 2+1 encoder
Posted: 01 Dec 2018, 20:25
Me and Frank both love the DigiSpark ATtiny85 boards, they're so neat and tiny!
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
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 ' ' 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
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
Cheers
Phil
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
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 ' ' 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
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
Cheers
Phil