- Posts: 46
Protocol for YD-717 aka Sky-botz Mini UFO
- cstratton
- Offline
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
cstratton wrote: So is this running with an NRF24L001, or only with the transplanted Beken module? (I realize the latter is cheaper, but I have the former sitting unused)
with nRF24L01+
Please Log in or Create an account to join the conversation.
- hexfet
- Topic Author
- Offline
- Posts: 1891
The trim pots on the stock transmitter don't affect anything on the transmitter. Separate trim values are sent to the receiver in each data packet. Investigation showed that the trims change the motor drive endpoints on the receiver. So max rudder plus max rudder trim in the same direction results in a significantly faster yaw rate than max rudder plus a neutral trim value.
I'd like some guidance on how best to incorporate this into the protocol. Currently I've implemented a "high-rate" mode by driving the trim values with a scaled version of the channel value, which keeps the response curve linear. This does reduce the control resolution, so I added an on/off on channel 6.
// Channel 6
// Use 7-bit trim values to implement "high-rate"
if (Channels[CHANNEL6] <= 0) {
*aileron_trim = 0x40;
*elevator_trim = 0x40;
*rudder_trim = 0x40;
} else {
*aileron_trim = *aileron >> 1;
*elevator_trim = *elevator >> 1;
*rudder_trim = *rudder >> 1;
}
Please Log in or Create an account to join the conversation.
- cstratton
- Offline
- Posts: 46
- You could scale the overall value to the sum of stick range + trim range, it would seem like that would make the controls more responsive, and then they could be slowed down with DR or expo to user taste
- You could phase in the use of the trim channel, sort of as an expo itself, but that may break abstraction models to have an expo in the protocol (not that actual control mechanisms on models are necessarily linear to begin with)
If I even get an STM8 SWIM interface going under Linux, I have half a mind to experiment with new firmware for the onboard side - they are certainly cheap platforms to hack on.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- hexfet
- Topic Author
- Offline
- Posts: 1891
I tested this and it works great. With the trim code enabled, using a scale of 80 makes it fly about the same as without using the trims. I'll make the change to always drive the trims.PhracturedBlue wrote: Is there a benefit to having low-rate mode? given that we can easily program such a thing with reduced range, your linear solution looks reasonable to me without the extra channel-6 input.
Don't think I've learned enough yet to understand this. Are you referring to tx scale settings, or scaling the channels in the protocol code?You could also choose to use a scale of 125 or 150 as the max range (and map 150% to 100%+full trim).
Please Log in or Create an account to join the conversation.
- hexfet
- Topic Author
- Offline
- Posts: 1891
There's an unused pad on the rx labeled LED+. It doesn't seem to ever be active no matter what you send to the rx.cstratton wrote: If I even get an STM8 SWIM interface going under Linux, I have half a mind to experiment with new firmware for the onboard side - they are certainly cheap platforms to hack on.
From the data sheet I think the nRF24L01 should work as well.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
hexfet wrote:
Don't think I've learned enough yet to understand this. Are you referring to tx scale settings, or scaling the channels in the protocol code?You could also choose to use a scale of 125 or 150 as the max range (and map 150% to 100%+full trim).
I meant you could turn this:
return (u8) (((ch * 0xFF / CHAN_MAX_VALUE) + 0x100) >> 1);
return (u8) (((ch * 0xCD / CHAN_MAX_VALUE) + 0x100) >> 1);
which would map 'CHAN_MAX_VALUE (100%) to ~80% on the tx. That would mean that a value of 125% shown on the tx would give you full range on the protocol.
But there really is no need. it is probably more inturitive to use 80% to mean 'low rates' than to use 125% to mean high rates.
Please Log in or Create an account to join the conversation.
- hexfet
- Topic Author
- Offline
- Posts: 1891
Thanks for the explanation. That makes sense. I'll just let the full range be 100%.PhracturedBlue wrote: which would map 'CHAN_MAX_VALUE (100%) to ~80% on the tx. That would mean that a value of 125% shown on the tx would give you full range on the protocol.
But there really is no need. it is probably more inturitive to use 80% to mean 'low rates' than to use 125% to mean high rates.
Please Log in or Create an account to join the conversation.
- hexfet
- Topic Author
- Offline
- Posts: 1891
It's possible to detect a bind failure and restart the bind process. The only benefit I can see is this would let you turn on the tx first, then connect the battery on the quad. It would require re-working the current bind code. How long should the tx keep trying?
The tx is set to retransmit a packet several times if it doesn't get an ack within a timeout period. The chip keeps a count of retransmissions, and the data sheet suggests using this as a measure of channel quality. How would this measure be reported to the user?
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
we have protocols that work both ways.
You always have the 'rebind' button on the model page that allows you to bund after turning the Tx on.
Or you could use the hubsan model where it will wait forever until it binds (you can press 'ok' on the dialog to stop waiting). I tend to like the hubsan method. it makes sure you know your model is ready to go.
On the 2nd, you could report it as telemetry as the # of frame loss (DSM has this info). I think it is much less valuable than the voltage as far as telemetry info goes. Note that today, you do not have access to the CE pin so switching from Tx to Rx or vice-versa on the NRF can only be done by going through 'standby-ii', which takes > 1.5msec (and I don't know if anyone has ever actually made it work)
That last point may make up your mind for you.
Please Log in or Create an account to join the conversation.
- hexfet
- Topic Author
- Offline
- Posts: 1891
The reception of the ack packets is done automatically through the Enhanced Shockburst feature, so there's no manual mode switching. It's interesting that it's missing from the nRF24L01 datasheet's state diagram, but it's mentioned in the section on Enhanced Shockburst (love that name). The 2421 datasheet does show these transitions. The YD717 protocol even sets up the data pipes such that the rx could include a payload in the ack packets, but it doesn't. Some telemetry would've been nice.
Since the retransmit info is available I'll see what it would take. Would be a fun thing but not very useful for a quad that can't be seen more than 100 feet away.
Please Log in or Create an account to join the conversation.
- hexfet
- Topic Author
- Offline
- Posts: 1891
I noticed that clicking through the binding screen does not stop the code that's still trying to bind. Would implementing the DEINIT command change that? I powered up the tx first to do some config, then powered the quad expecting to then hit the re-init button. But the quad bound as soon as I plugged in the battery and the throttle wasn't quite at zero. I added a throttle cut switch...
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
the ok button just cancels the dialog not the binding sequence. it is true on all protocols. It has been a repeatedly requested feature tho.
Please Log in or Create an account to join the conversation.
- hexfet
- Topic Author
- Offline
- Posts: 1891
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
Nevertheless I propose to keep this behavior consistent as long as there is no technical reason.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
But I need to code that into the framework before it can be added to the individual protocols.
Please Log in or Create an account to join the conversation.
- hexfet
- Topic Author
- Offline
- Posts: 1891
Please Log in or Create an account to join the conversation.
- hexfet
- Topic Author
- Offline
- Posts: 1891
The YD717 protocol supports the YD717 and Skybotz UFO Mini quadcopters. No other models have been tested with this protocol, but it is likely to work with other re-branded YD717 models. NOTE: This protocol requires the addition of an ‘nRF24L01’ or equivalent hardware module to function. See the following document for more information: www.deviationtx.com/repository/Documenta...uleInstallation.pdf/
The YD717 protocol supports 5 channels and only supports auto-binding. The fixed ID can be used, but does not prevent auto-binding during power-on. The protocol stays in bind mode until successful.
The first four channels represent Aileron, Elevator, Throttle, and Rudder. The fifth channel enables the auto-flip function when greater than 0. Additionally to enable auto-flips left and right the aileron channel scale must be 87 or greater. Likewise for the elevator channel and front/back flips. When auto-flip is enabled, moving the cyclic all the way in any direction initiates a flip in that direction. The YD717 requires at least four seconds between each auto-flip.
Frame loss telemetry is supported.
The YD717 only calibrates its accelerometer on power-up. An excessive wobble indicates the quad was not level and motionless when powered on. It is difficult to initialize it properly with the canopy installed. Best to power-up, then install the canopy.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Protocol Development
- Protocol for YD-717 aka Sky-botz Mini UFO