- Posts: 4402
USB HID Joystick & PPM-In program
- PhracturedBlue
- Offline
Or did you mean have 1-4 in col1, and 5-8 in col 2? That would be quite easy.
Please Log in or Create an account to join the conversation.
- vlad_vy
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- Wene001
- Offline
- Posts: 277
Any idea?
Edit: also not working with my devo 6s ?!?
do i miss something
i created a model 8 channel ppm out on slave (devo6s or dx8)
on devo12s i created a model 8 channel devo protocol activated ppm Input and assigned ppm1-4 to channels 5-8
do i overlook something?
All ppm is set to 1500/400
Deviation release 1556052181fb
i have also tested the other way (devo12s als slave and devo6 as master)
also Trainer mode is not working for me
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
There is definitely a bug.
Devo10 on and transmitting ppm.
devo12 set ppmIn to train, set switch to trn1, go to 'Channel monitor' page. push Train switch, control switches to the devo10. release train switch, control comes back. power-cycle devo10 and train switch still works. Power cycle devo12 and train switch no longer works. Only way to get it working again is to turn PPMIn off and then back on. I'll need to debug further
Please Log in or Create an account to join the conversation.
- Wene001
- Offline
- Posts: 277
if i use the train option i cant see anything on the bars on main screen.
only on the monitor page of the mixer.
thanks for programming this cool feature
for me it would be more intuitiv to have the channels 1-4 in the left column on trainer config page. and channels 5-7 on the right side.
on the ppm out page i would prefer displayed 1500 ms as standard for the complete pulse (high and low)
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Offline
- Posts: 83
t = (t1>=t0) ? (t1-t0) : (65536+t1-t0); // none-stop TIM1 counter, compute ppm-signal width (2MHz = 0.5uSecond)
With both t1 and t0 being u16, this can be simplified to
t = t1-t0;
Adding 65536 to an u16 does absolutely nothing.
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
Maybe something like "t=(u16)(t1-t0);" might be universal...
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
You should see the values on the main page if you set the box to show 'Ch3' as opposed to showing 'Thr'. The difference is the input vs output value.
I already added a ticket to fix the display order on the ppmin page.
As far as the ppmout page goes, I agree it would be better if we were consistent, but there is a need for the extra 'notch' setting and needing to subtract it may be just as confusing. I'm certainly open to opinions on this though
Edit: I just fixed the ppmin train channel mapping order
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
You're right, it doesn't but it makes it clearer whatthe logic does. Actually I'm not sure why 't' is 16bits here. Doing math with 16bits is slower than with 32bits, and there would be no question of the results with a 32bit value here. t0 could still be 16bit to save 2bytes of ram, since the final value of t is guaranteed to fit in a 16bit value. The end result is the same though.wuselfuzz wrote: common_devo/ppmin.c:152
t = (t1>=t0) ? (t1-t0) : (65536+t1-t0); // none-stop TIM1 counter, compute ppm-signal width (2MHz = 0.5uSecond)
With both t1 and t0 being u16, this can be simplified to
t = t1-t0;
Adding 65536 to an u16 does absolutely nothing.
The problem with not working on reboot seems to be that I never call PPMin_Start() after loading a new model.
I think it is as easy as calling PPMinStop when resetting a model, and PPMinStart() at the end of loading a model (assuming the proper conditions are met)
I'm not in front of my Tx at the moment, so I can't test it though.
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Offline
- Posts: 83
rbe2012 wrote: As far as I have understood it is a matter of what the compiler does internally. Subtracting unsigned values can have a result < 0 which can not be put in a u16 variable. And 65536+t1 is always > t0.
Maybe something like "t=(u16)(t1-t0);" might be universal...
Integer promotion might happen (which is what happens internally, and is actually specified in the ANSI standard), but then, the additional bits are still discarded after the assignment to t.
About the actual bug, when the slave is switched off, the master might not desync properly, since no interrupts happen at all.
/edit: After thinking about that a bit longer, that shouldn't really happen, only in the rare case that there's a timer overflow at the wrong time. And then the desync would be detected in the next round.
/edit2: Should read everything before posting...
Please Log in or Create an account to join the conversation.
- wuselfuzz
- Offline
- Posts: 83
This happens when I hook up my dx6i. Time to dig out the logic analyzer...
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
github.com/blutack/paparazzi/tree/v3.9/conf/radios
It would be nice to provide some interface (or at least a procedure for setting the parameters properly.
maybe an 'autodetect' button like the stick calibration where you move one channel from center to max and we calculate the values from that.
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.
- vlad_vy
- Offline
- Posts: 3333
Also, why by default 'Trainer sw' is AIL? Possible will be better by defaul use most usable switch (for all possible Tx), or add 'None'(Off) as default.
Please Log in or Create an account to join the conversation.
- BitOne
- Offline
- Posts: 40
Trainer and PPM-In are wonderful features ! Thanks a lot for that.
I have a small question or remark: from the picture above, it seems that the PPM Inputs from the slave are mapped directly to the output channels of the master, without going through the mixer on the master.
I realized it matches what PhracturedBlue described previously :
1) Trainer mode: In this mode each input channel is mapped to an output of the transmitter when the relevant switch is enabled, otherwise the channels act as normal
So it means that all the mixers, trims, safety switch settings, etc... must be done on the slave transmitter, as well as on the master transmitter. And the two setup must produced the same result (not easy when you have two different software on the two TXs).
In my case, it does not work very well: I have a DX5 transmitter that I would like to use as slave and my Devo 8s as master. As the DX5 is not programmable, I cannot use it with this mode in Deviation.
Same at my club: the slave TX is a very simple non-programmable transmitter. Could even be a module-less cheap one, as it's only used as slave TX.
The use case where the more advanced TX is the slave can occur too (and this is the one covered by Deviation as I understood it), but I have the feeling that in a lot of situation the more powerful TX will be used as master as it has for example the highest range.
Could it be possible to implement both ways and to choose which one from the configuration :
- PPM inputs from slave TX mapped directly to output channels on master TX
- PPM inputs from slave TX override master stick inputs (so the inputs will go through mixer and master TX configuration)
Or maybe with the PPIM In mode (the FPV one) I could emulate what I want by using a mixer, a switch and virtual channels linked to the PPIM In to do the overriding, at the cost of a complex setup and modifying each model setup to enable trainer input.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
How do other transmitters handle this?
You can of-course use the 'FPV' mode to achieve what you want. it requires using advanced mixers everywhere and having the 1st mixer be a 1:1 mixer, the 2nd mixer use the train switch to override with the proper PPM input, and the 3rd and higher mixers to apply whatever curves or d/r you want.
However, if the current 'train' mode isn't valuable, then I could change the behavior to be an input override instead. Not having ever used a trainer, I may not have been the best person to implement this feature
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
And yes, supporting PPM9 is a bug. There are only 8 supported PPM channels.
Please Log in or Create an account to join the conversation.
- BitOne
- Offline
- Posts: 40
How do other transmitters handle this?
I dug into my memories and the ugly truth showed its nose
I did some flying in the past as a student so using a slave TX connected to a master TX, both Futabas.
I remember it was working exactly the way you implemented it in Deviation: the master radio, while in trainer mode, was acting as just a big radio module sending the exact signal from the slave TX.
And to be honest, it was a pain in the ass:
- we need to spend 5-10 minutes at the beginning of each flying session to setup the exact same configuration on servo reversal and trims. And it was not perfect, as the slave TX was a dumb radio and the master a programmable one. Even trim were not of the same resolution. So when the master was gaining control, the plane had often a kind of sudden reaction until we managed to fine trim it during flight
- flying different planes was almost impossible, as the dumb TX did not have any memory, so we stuck to the same plane
- I could not benefit from any advantages of the master TX: no expo (would have been useful for a beginner), no way to have delta mixing (so I had to learn alone how to fly my flying wing)
So this way of working is far from ideal. The funny thing is that I just found some information from Futaba describing their trainer system:
www.futaba-rc.com/faq/product-faq.html#q106
And they have the two possibilities:
- on basic/average radio: only the way I described above
- on high end radio, you can choose between both ways
In the NORMAL mode:
when you hold the trainer button the student radio is totally in control. Its throws, rates, servo directions, etc, MUST be set exactly to the aircraft it is flying.
In the FUNC mode:
The student radio is acting just as a joystick while running the programming from the 8.
In addition to the present "NORMAL" mode, can we have a mode similar to the "FUNC" one, please ?
Thank you
Edit: And for Christmas, I would like a MIX mode too:
the instructor can have the option to make corrections for the student without taking the aircraft completely back from the student. This is called "MIX" mode.
Could be nice to have But the FUNC mode seems to be easier to implement and the MIX mode could be done via a complex mixer.
Please Log in or Create an account to join the conversation.
- BitOne
- Offline
- Posts: 40
Extract from the ER9x documentation, page 15 ("PPM In") code.google.com/p/er9x/source/browse/tru...%20Users%20Guide.pdf
This menu allows the PPMin (trainer) inputs to be configured. It enables the RAW PPM inputs to be selected to replace the sticks for training purposes. The student transmitter does not need to have the same model setup as the instructor. All the mixes on the instructors Tx will be applied to the student inputs. If, for example, you have expo on your sticks, this will be applied to the raw trainer inputs when they are selected.
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
- Development
- USB HID Joystick & PPM-In program