So I have a RC controller but would like to intercept the signals from the reciever to the servo and be able to either pass them through or over ride them with my arduino (breadboarded ATmega328) The output from the reciever are the appropriate servo control signals that you would expect. 1-2ms pulse at 50Hz or so.
My initial thought was to time each pulse and output the the signal that i wanted, I’m not sure if i can do that because of potential overlap of each of the pulses (there’s 4 channels from the reciever) My second thought was to turn the pulses into some sort of DC level that i could measure on the analog inputs then play with the value that way.
There is sample code to output to a servo but to read the incoming signals especially 4 at a time is more challenging.
Do the pulses from different channels of the receiver occur at the same time, or in sequence? If the transmitter uses time-division multiplexing to send > 1 channel, then the pulses should occur sequentially, and not overlap. Not sure how this works–don’t have a radio to test it. If you have access to an oscilloscope with at least two channels, you should be able to figure this out.
I found one Futaba RC radio’s user’s manual on the FCC equipment authorization database (look under the FCC Office of Engineering and Technology web page) and it does indeed appear to use time-division multiplexing of channels, where channels are sent in sequence. Your user’s manual may be helpful.
Well the radio controller i’m using is a Tactic 2.4Ghz TTX404 with secure link technology. According to the front of the contoller. The manual was a little more helpful
It tells me the modulation is FHSS spread spectrum which is all it says about the transmission. FHSS according to google and wikipedia stands for frequency hopping spread spectrum, which is all well and good but tells me nothing about how the signal pops out of the reciever. Searching the receiver part number (TACLO624) only requests that I try searching tacos.
I did find these two links, i’m not sure i’m familiar enough with arduino code to recognize any of the pitfalls should i implement it. I’d be fine with buying another 2 arduinos for final function as it seems that a pair of signal channels is enough to thoroughly bog down an arduino. The ardupilot seems to do a better job, up to 8 channels but again i wonder if i’ll be able to do anything else after it sort through the input signals.
Maybe explaining my goal a little better would be helpful. So i have an RC car that I would like the servo signals from the reciever to be over ridden so the arduino can perform a set of automated movements. this is done when one of the incoming signals hits max or min (turns one channel into a pair of push buttons). Once it has completed the auto routine it restores the signal from the reciever to normal. When it’s not working it becomes a pass through system basically.
now the editor is freaking out and i need to start a new post…
So as i was thinking. Monitoring all 4 channels based on what i just described it moot. I only need to look at 1 channel then block the other three when I want the arduino to work. I just need to make an interupt that checks the length of the pulse looking for 1ms or 2ms everytime it goes high. Still having some help with the coding would be useful I don’t know much of the syntax, the coding i have done is based on the examples and mixing a matching those. I haven’t done a interupt in arduino yet either.
If you don’t want to use interrupts, you could poll the inputs. Since you’re just looking to detect pulse length on one of the four, and pass them all through unchanged until you get your Magic Value, the polling loop is simple and fast; probably faster, truth be told, than using interrupts. You can use the arduino micros() function (with unsigned arithmetic) to measure pulse length on the relevant input.
ended up using the pulsein function. It seems to be working pretty well but i’ve read that it can be kinda tricky to use.
I also tried a bit of code to use some of the built-in signal capturing hardware, that compiled but would only ever output 0. I think that would be the way to go since I would free the arduino to run the code at the same time, thing is the code is not very clear to me. I’m not precisely sure how it’s working and therefore couldn’t guess why mine is only outting zero. Perhaps it’s that the code is made for a 168 and not a 328. here is a link to that hardware signal capture code: