irwin@uiucdcs.UUCP (11/06/84)
Steve Ludlum, I posted this in net.micro some time back, since you are interested in R/C, I thought you might like to comment on it. In response to a base note title "real cheap micro wanted", I made a comment relating to a micro in a Radio Control system for RC aircraft. I received several queries about the comment, which said nothing more than that I had became aquainted with the RCA 1802 because of interest in the chip for RC aircraft. I think that the interest is high enough that it warrants an explanation in the net. I as a result, am providing the following information, hoping that it will be of interest to the many who fly RC aircraft and are also micro buffs. I have been flying RC models since in the early 60s. I have tried about every type of craft, single engine, twins, gliders, helicopters and what have you. I once built a radio system for flying twins that handled both engines from one throttle stick, but had the engines on separate channels and servos. I called it the "Twintrol". There was a "mode switch" which was a four position switch. The positions were left, right, both and taxi. There were two idle trims, one for each throttle channel, and a sync trim lever. When in the left position, the throttle stick only advanced the left engine, the right was under the control of the rt idle only. When in the right position, the oposite was true. You could start one, get it running good and set the idle speed, then switch to the other position to start the other engine. Advancing the throttle on that engine did not cause the other one to scream when you did not want it. In the both position, the throttle advanced both, but low end was still controlled by the idle trims. In the both position, the sync was a differential, would retard one and advance the other slightly to bring them together, be it at half, two thirds or full throttle. The really neat part was the taxi mode. Say the stick was at half throttle, if you gave it left rudder, it subtracted from the left engine, so that at full left rudder, if you gave it full throttle, you would advance the right engine only for a pivot left turn, and the left engine would be at idle. In other words, the left/right movement of the stick gave a proportional setting of the rpm as well as the forward back movement. It was fun in flight to switch to the "taxi" mode and do a snap roll with full up/left, have the rt engine wide open and the left at idle. Man, what a snap! As the micro processors came into being, it started me thinking, that when you buy a radio system, it is destined to be exactlly as you bought it all of it's life unless you take the cutters and soldering iron to it. It can not serve to fly a twin as above, or a helicopter where the function of the sticks would be totally different. I built a proto type system on the bench, rf link omitted. The pulse code out came from the "Q" bit on the 1802. This was connected to the decoder portion of a receiver and servos were connected to the decoder. With this, I could see if software could be written to handle the servos. I used a AD0817 16 channel A to D converter. The sticks was connected to these channels. With 16, it gave room for separate trim levers, sticks, retract switches and so on, and left room for one (the first analog channel) to be connected to a 10 position thumbwheel switch. This was the "mode switch". When turned on, the software first read the position of the thumbwheel, which was converted to a binary value and was used to indicate which firmware to jump to in the rom. The value of the contents in the A/D was added to the current PC, which would send it to a three byte long jump instruction so you could get "off page" with a single byte value from the A/D. I built in a 8 bit timer (1802 does not have one, 1804 does but can only be used in interrupt mode) and I could get quicker response polling the timer than waiting on an interrupt. For channel control, a fixed value was used as the "Q" bit delay, the value of the A/D for that particular stick was added to the fixed value for the final time. The fixed value was 1ms and the value of the A/D added to it. If at half stick on a channel, the binary value would be equal to .5ms if put in the timer. It was added to the 1ms value and poked into the timer. The "Q" bit would be poked on, then off for about 350 micro sec, then the timer would start counting down the delay, it was polled for empty, when true, the "Q" bit would be poked for the 350 micro sec again which would complete one channel time. I tried various ways, and found that during the 7-8 ms sync gap, that there was time to calculate all of the times and poke them on the stack, then during the frame run, get the stuff from the stack and use it for the frame timings. This also allowed mixing of data from the various channels. If flying V-tail, the differential values could be calculated for the rudder/elevator times and put back on the stack before the frame was sent. The need for an arithmetic unit was what did me in at the time, there was not one available at the time that would do well with the 1802. I used the RCA binary arith routines and it took 14ms to do a multiply/ divide which was twice the sync gap time. This slowed the frame rate down too much. RCA has since came out with an arithmetic unit for the 1802 and I have purchased one. It will do a multiply or divide in 8 micro sec. I have been a very busy guy the last year and have not had the time to work on it, but intend to get back to it. I should probably explain the faster polling than interrupt times on the timer. The interrupt mode of the 1802 takes three machine cycles to service. Polling, you can do it in two cycles. Since there are 8 clock times per cycle for the 1802, polling, you can service the timer in 16 clock times. If you run a 4mhz clock, the time will be within the 6-8 micro sec dead band time of most servos and resolution is good. One last thought, if one measures the torque provided by a servo, it does better if updated more often, they use pulse stretching ckts, but if you were to send slow frame rates, the torque would be less than if higher rates were used. On the conventional radios, an 8 channel radio always transmits 8 channels, even if you are flying a 4 channel pattern ship. WHY SEND THE NOT USED CHANNELS? If you are using a pattern ship, send only the channels you use and get faster frame rates hence higher servo torque and better resolution because they are updated more often. If you think about 100 mph and distance covered, in one second, over a given distance, how many times are your servos updated. At higher rates, over the same ground distance at the same speed, the servos were talked to more times, hence better resolution. With an arithmetic unit, mixing can be done, with a rom, several modes of flight can be onboard in the RC system. You can fly a V-tail, twin, helicopter, two channel glider or what ever you desire. The necessasry components are the 1802, the arithmetic unit, the rom, the A/D, a 8 bit counter chip for the timer and a small ram for stack. This is all capable of fitting into the standard RC transmitter box, along with the rf board. My point was not computer aided flight or preprogrammed maneuvers, since I feel that the pilot should do the flying. I was just going for a versatile system. I hope this is interesting to you, if you are a electronic nut and an RC pilot, maybe you also will want to try this. Al Irwin 1312 W. Hill St. Champaign, Il 61821 217-356-3532 PS: I was the one that designed the helicopter governor "Tach-Tron" written up in Feb, Mar and April of 1977 RC Modeler. The Tach-Tron is the only device that I designed that is to be part of the airborne unit, the rest is all in the transmitter unit.