Jump to content

Attention: RC-CAM.com will be closing down August 2021.

The RC-Cam.com forum was the very first online community dedicated to the advancement of wireless video cameras on radio controlled (R/C) models. This is now called "FPV" (First Person View). We are proud of the contributions that our members have made to the FPV hobby.

We've seen significant changes over the last twenty years. Initially there were a lot of eager R/C hobbyist that built their own video systems. Allowing these creative individuals to share their work was the purpose of this site. Now the FPV market is flooded with low cost systems; Sadly DiY FPV video projects are now rarely discussed.

RC-CAM.com (main site and forum) will be closing down August 2021. This is being announced now (March 2021) so that everyone has time to download any information that is important to them. After the site is shutdown the information will no longer be available here.

We appreciate every member's involvement with advancing the FPV hobby. It is indeed sad to say goodbye to all our online friends. Be safe and stay healthy.



Recommended Posts

  • Replies 355
  • Created
  • Last Reply

Top Posters In This Topic

Why not just put one big cap in (between pin5 and gnd). That would delay it enough to allow the D9/R3 junction to reach 0V and although the pulse would be delayed and not very square, it is good enough to trigger the rising edge for the U1A input. The delay (if it is not too big) could be taken care of by changing the center point on the transmitter side for that channel.

I popped in a .1uf electrolytic I had laying around (see picture below). Time scale is 5 uS per division (top and bottom traces as before). There is plenty of time for the D9/R3 junction to reach 0v and the signal makes it to its peak in 20uS. The U1A fired though only 10uS after the falling edge of ch7. So if the PWM range is about 1000uS then this produces only about 1% offset error. I have more than that in some of the other channels.

What do you think?

post-3782-1199899207_thumb.jpg

Link to post
Share on other sites

The big cap solution is tempting and you can use it if you are comfortable with that solution. You still need an appropriate resistor value in front of the cap to reduce the big logic current transients.

The race condition problem makes me nervous. Below is my proposal to avoid it. There are two identical one-shots, one for all the rising edges, and one for the lone Ch-7 falling edge. These are followed by a discrete component NOR gate. None of the new components are critical and can vary a bit if you don't have the exact part. Just use sane substitutes.

The D1-D7 diodes are listed as 1N4148's since they are usually in a techie's junk box. However, I would probably use some schottky diodes with low Vf specs to maintain the highest servo signal levels from the Rx. I expect that if well chosen shottky's were used at D1-D7, then U1 could be changed to a 74HCT221 and the circuit could be run on 5V instead of the 3.3V that is shown.

The nice thing is that the logic level at the PPM Output is set by the voltage you apply to R6 (MCU Vcc). This allows you to match those that are used at the host (5VDC or 3.3VDC). Just connect it to the Vcc of the host MCU. The R6 connection is not needed if the host MCU (i.e., MK board) already has a pullup resistor on it.

Of course this circuit could need tweaks too, so be prepared for that. Fortunately you have the tools and experience for that. Breadboard it first. :)

Lastly, I tried to save as much of your original board as I could. Frankly, I think the best solution would involve a microcontroller, but there doesn't seem to be enough interest to justify the development of that. So, we will stick with simple old-school solutions for now.

post-2-1199901048_thumb.jpg

Link to post
Share on other sites

When I think about it this actually makes more sense. Simple clean fix. I can remove the D9 diode, change the values on the U1B cap/resistor, cut my PPM out trace and jumper it back together with a diode, jumper pin 5 to the PPM out trace with a diode, and then build the rest of it on a breadboard. I will have to check for the pull up on the MK schematic. I may actually have a simple signal transistor laying around. Haven’t done this type of stuff in a long time so I don’t have much in terms of parts sitting around (I am actually a mechanical eng.) If this works I will have to try and identify some good schottky diodes that I can order and use for ver2.

By the way, I have also breadboarded up one of your Pan-Can chips (three, one for the Pan and the other two as switches for bypass and home). Works great!!! :) My next project is to make a small board for that as well.

One question though. I want to use the Pan-Cam chip for the tilt servo as well, the only problem is that the Home function (as I put it above) is actually a “Center” function. For the tilt I would like that to move to the end of the travel (ie looking straight ahead) and not at an angle down (center). Is there a simple way of recompiling the source code with the Center changed to the end point (one or both depending on how the servo is mounted). I was hoping that “Center” point was a static variable in your code and that changing that variable would be an easy way to change the “home” position.

Thanks, Richard

Link to post
Share on other sites
Is there a simple way of recompiling the source code with the Center changed to the end point (one or both depending on how the servo is mounted).

It's simple to recompile, but the code validation that I perform takes a lot of time. I'm already buried in work projects and my time spent on the forum is not helping much. So, let's talk about that later (plus, it probably should be in its own thread to keep this one OT).

Link to post
Share on other sites

I made the conversion (except the small signal transistor part at the end). Interesting, once the diode goes in on the PPM-out, there seems to be some leftover capacitance (or no place for charge it to go) and the lines don’t discharge very quickly. (see picture 1). I put a 10k ohm resistor between ground and after the diodes on the PPM-out (see picture 2). I could probably up the resistance a good bit and still clean it up. It may also not look like this (picture 1) once hooked up to the FltCtr depending with what/or how the signal gets used (load).

Richard

Picture 1:post-3782-1199928653_thumb.jpg Picture 2(w/10k resistor on PPM-out to gnd):post-3782-1199928666_thumb.jpg

Edit: as a mater of fact you have a 2.2K in series with a 10K path to ground in the "transistor" part of the schematic, never mind, that would clean it up as well. I should have just done the whole thing

Edited by brashley
Link to post
Share on other sites

Actually, I think the “transitor” part may have a problem. It essentially is an inverter. When the PPM pulse arrives, the transistor switches on and the new ppm-out gets switched to ground, otherwise it’s high. So it inverts the PPM and raises the voltage to MCU Vcc.

Link to post
Share on other sites

If you wire it all up, including the transistor, you will see very clean looking edges and healthy logic levels at the output.

The logic polarity at the transistor output should be the same as before (assuming you were using U1-4 for the MK's PPM input signal). But, if it is reversed from how you were using it earlier, then just tell the MK board to use the opposite polarity. *Otherwise, you can move the two NOR'ing diodes to the Q-Not outputs to create hardware based logic inversion.

*EDIT: Oops, merely moving the two diodes won't give inverted logic; it would be best to just add another inverting stage using a transistor.

The new photos show that we are on to a good solution. Keep on trucking!

Edited by Mr.RC-Cam
Added correction about inverting the PPM output.
Link to post
Share on other sites

Hooked up the rest. I used 10K resistors for R4,R5,R6 (happened to have a handful of 10ks laying around). It looks great :D. :D I will have to see if the MK will allow me to select inverted polarity. I was using U1-pin13 as output before. If I cant switch on the MK, then on v2 I will just us the pin4&12 outputs.

Thanks again for all your help :)

PPM-Out:post-3782-1199936328_thumb.jpg

Edited by brashley
Link to post
Share on other sites

That waveform looks great. Please follow up after you have tried it on the Quad flying machine. I'll update the schematic once you report the holy grail configuration.

You are welcome -- it was my pleasure to help where I could.

Link to post
Share on other sites

I will update my schematic and layout as well and once I make a new one and test it I will post it back here (with part sources) so others can make it if needed. I have been trying to keep it small and light (although my layout skills aren’t that good). Luckily I have enough space on the current layout footprint to be able to easily add the additional transistor and 3 resistors. I will use my current one (ver 1) for my bench testing until I can get the time and parts to build a new ver 2 one.

Richard

Edited by brashley
Link to post
Share on other sites

It works great with the MK FltCtr :). I left the PPM output as inverted at the moment (will fix with next version/build). The ATmega644, I am sure, is just looking for a transition from high to low or low to high so the inverted PPM does not cause any problems. I will hook up to the inverted outputs of the 221 though just to make it correct (some one may have other uses for circuit). I was able to correct all offsets on the Tx side of things and I now get all channels to move from -145 to 145 as seen on the MK by the ATmega644, with centers all at zero . The output also seems to be very stable. No changes in centering or range changes over time, power cycles, or after/during stick movement (I know, not an authoritative statement on robustness but it's a start). I have left it on and hooked up to the FtlCtr for hrs with no problems (as expected). I will try to update the schematic this weekend and try to find some small shotkey diodes that will fit as well (may even make a new PCB while I wait for the parts).

One note is that I don't get a lost signal condition. When the AR7000 looses signal it holds the channels (PWM) as is (except the throttle) so the MK will never know it lost contact with the Tx. Any code in the MK to handle a lost signal condition will never get activated (like GPS go home).

Richard

Edited by brashley
Link to post
Share on other sites
It works great with the MK FltCtr

Success is sweet. :)

I left the PPM output as inverted at the moment (will fix with next version/build).

That suggests that the MK board can auto-detect the polarity. FWIW, there's no standard for the PPM stream's logic polarity. So, there are no doubt many others using "inverted" logic on the various flavors of hacked Rx's. Frankly, I wouldn't worry about it.

I was able to correct all offsets on the Tx side of things and I now get all channels to move from -145 to 145 as seen on the MK by the ATmega644, with centers all at zero .

In case others ask, what sort of offsets did you have to dial in?

One note is that I don't get a lost signal condition. When the AR7000 looses signal it holds the channels (PWM) as is (except the throttle) so the MK will never know it lost contact with the Tx.

Spektrum really missed the boat with their DX6 and DX7 fail safe implementation. It would have been grand if they allowed you to setup each servo channel for specific fail-safe states (hold or programmable servo position). That way you could have configured an "unused" channel to be used as a fail-safe on/off indicator.

Link to post
Share on other sites

Here is the updated schematic for Version 2. This is what produced the last scope picture. I am going to keep the diodes I already have since I am going to keep the 3.1 V reg as well. If anyone wants to invert the PPM-out just move to the inverted outputs of the 221 (so move pin13 connection to pin4 and pin5 connection to pin12). In terms of hooking it up to your receiver, the only critical point is to make sure your last channel in the output sequence from the receiver is hooked up to CH7 on the circuit. For the AR7000 that I have, that’s the Rudder. This circuit would probably work for other receivers as well as long as the PWM signal out is sequential spaced (with a short space between) and you hook up your last channel to CH7.

As a reminder, for my AR7000 the sequence is a follows (w/ DX7 adjustments):

AR7000---- Ch sequ out--------MK------------SubTrim-----TravAdjHigh------TravAdjLow

______________________________________________________________________

Thro--------------6--------------Gass------------L44-------------128%------------115%

Aile --------------1---------------Roll-------------R34------------121%------------120%

Elev--------------4---------------Nick------------U34-------------122%------------120%

Rudd-------------7---------------Gier-------------R6-------------120%------------121%

Gear -------------3--------------Poti_x------------?---------------100%-----------139%

Aux1--------------2--------------Poti_y----------D35-------------121%-----------117%

Aux2--------------5--------------Poti_z------------?---------------100%-----------137%

Richard

post-3782-1200157310_thumb.jpg

post-3782-1200157356_thumb.jpg

Edited by brashley
Link to post
Share on other sites
Spektrum really missed the boat with their DX6 and DX7 fail safe implementation. It would have been grand if they allowed you to setup each servo channel for specific fail-safe states (hold or programmable servo position). That way you could have configured an "unused" channel to be used as a fail-safe on/off indicator.

I completely agree. I don't understand their thinking.

The AR9000 DOES allow you to set failsafe positions for each channel. If they can do it on that one, you'd think they'd implement that on all the receivers.

Link to post
Share on other sites

Looks great. Thanks for posting the results.

As was mentioned before, this design should work on any R/C receiver that has typical sequential servo outputs. It can easily be expanded to eight channels by adding one more diode (of course the Rx would need to be eight channels too).

So, it could be used on other R/C systems (not just the DX7), including older PPM Rx's. The nice thing is that you wouldn't have to hack the Rx to tie into its internal circuitry, which saves us from violating the product warranty. :)

Link to post
Share on other sites
I'd need the same for one that has simultaneous outputs....

Ahh, those Futaba PCM Rx's are little devils when it comes to their paired-up pulse outputs. An FPGA or fast microcontroller solution would take care of it. Sounds like a nice project for someone that has some spare time. :)

Link to post
Share on other sites

Would there be a way of creating a lost signal state for this circuit and the AR7000. This is what I am thinking. Since I can set a lost signal throttle position, I set it a value (high or low) with the travel adjusted to its max, then I back the travel adjust down so that I cant get to that extreme with just stick movements. Then we add some cuircetry that is looking for a PWM throttle pulse that is either too long or too short (we pick one). If it finds one then it holds the 221 reset line at GND unitl the next PWM pulse. If the throttle PWM is ok then the 221 reset line is left at +3v (high). That way a lost signal just shuts off the PPM and the MK then immediately knows what happened. For a plane this would be bad but for the MK with some intelligence behind it that’s fine. At a minimum, the FltCtr at the moment will stop all movement and move the throttle to a user selectable setting (hopefully some slow decent point). Future options might activate a “GPS come Home” function on signal loss.

Do you think this would be possible with, for example, one more 221. One of the vibrators triggering with the rising edge of the PWM and set to last to just past a normal max throttle setting. Then a NAND gate (or something) that is trying to make sure that when the 221s output’s a falling edge, that the PWM is also low. (ie if it is high then we are in the lost signal condition). If that occurs then it triggers the second 221 vibrator (with a long pulse) to hold the reset low until the next cycle.

Just thinking out loud here.

Richard

Edited by brashley
Link to post
Share on other sites
Would there be a way of creating a lost signal state for this circuit and the AR7000? This is what I am thinking. Since I can set a lost signal throttle position, I set it a value (high or low) with the travel adjusted to its max, then I back the travel adjust down so that I cant get to that extreme with just stick movements.

I was also thinking about something like that too, but would go the route of a microcontroller to detect the servo signal. But, if you use precision parts with good long term stability, the '221 IC would work too.

Link to post
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.


×
×
  • Create New...