Friday, April 11, 2014

Controlling an RC car with a waveform generator


I recently made a video demonstrating that you can control a basic radio controlled (RC) car with just a signal generator. While this was a fun video to make, it does highlight some really useful features that can be used in almost any engineering setting. In this post, I'll go through how I reverse engineered the control signals and how I came to my solution. Some of these generator features are only available in this class with the Trueform series waveform generators.

  • Arbitrary waveforms
  • Using an arbitrary waveform as a modulation signal
  • Internal mixing of Channel 1 and Channel 2 of the generator
  • AM modulation
  • Arbitrary waveform sequencing
  • Advanced Triggering in a sequence
First off let's provide an embedded video so you can join in on the fun:

 
My goal was to see how much of the RC car that I could control with just my generator.

I started off with trying to digitize the output of the remote control with an oscilloscope. By digitizing, I could theoretically take the scope's trace, download it from the scope and then output all the points with my generator.

I quickly realized that the length of the controlling waveforms (14ms to 60 ms long) coupled with the really fast carrier frequencies of 45 Mhz would require a lot of memory depth from the scope. An option that I didn't have on my scope. But looking at the scope's capture, I could tell that the signal was an amplitude modulated signal and the carrier frequency depended on the frequency of my car/controller pair.

Since the 33600A can do amplitude modulation with very little effort, I was able to simplify the design down to the shape of the modulation that I was seeing on the scope. A quick look on the internet showed that RC car control is fairly simple. There is normally a series of synchronization pulses followed by a series of control pulse. The sync pulses in this case are a series of 4 pulses that are each 2ms in width, but at 75% duty cycle (1.5ms high, .5ms low). The following control pulses are 1ms in width at 50% duty cycle i.e. 500us high, 500us low. It turns out that the number of control pulses determines the direction of the car.
  • Forward - 40 pulses
  • Forward with the wheels facing left - 52 pulses
  • Forward with the wheels facing right - 46 pulses
  • Reverse - 10 pulses
  • Reverse with the wheels facing left- 29 pulses
  • Reverse with the wheels facing right- 34 pulses

With the help of another engineer who was more interested in my project than what he was working on, we decided that recreating this signal with an arbitrary waveform then modulating the carrier signal in the generator itself would be the easiest solution. This method has the added benefit of keeping my arb signal to a small number of samples. If I had been able to digitize the waveform as I originally planned, each of the resulting arbs would have been a few mega-samples (MSa). This isn't a problem with my instrument, which has the optional 64Msa memory installed. The engineer inside of me would rather be more efficient with my memory even if I have a lot to headroom.

I have a 36622A which is a two channel 120Mhz generator. Agilent has sub-branded the technology in these generators as Trueform. While it has many performance improvements over the traditional DDS generators in its class, they didn't play a factor my design in this case. However, two features did. The generator is able to use the signal from channel 1 to modulate channel 2 (or vice versa). I could have just used channel 1 with an arb as the modulation source, but I wanted to be able to sequence the waveform too. More on that later.

My first step after deciding on this route to to start designing my waveform. Since I knew that channel 1 would be the modulation source to determine the envelope's shape, I had to be aware of modulation signal requirements. The modulation source's amplitudes are important here, at +1V the carrier signal is transmitted at full carrier amplitude, and at -1V the carrier signal's transmission signal is 0Vdc. With that in mind, I created a series of pulses. The first section was the four 2ms sync pulses. Using Waveform Builder Pro, it was simple to create a square wave that was 75% duty cycle, 2ms wide, and repeat that four time. Then I appended the 1ms, 50% duty cycle pulses to that signal. I started with the reverse going signal since that was the most simple with 10 pulses.
Figure 2. A typical reverse signal on the RC car w/o the modulation. 4 sync pulses, followed by 10 1ms pulses


This signal was designed with a 20Ksa/s output rate. I needed to remember this setting since the timing of the signal is important. When I use the generator to play this signal, I needed to ensure that the sampling setting on the generator is the same as I designed it. Once I was done with this signal I saved and used channel 1 to output it. Since the 33600A saves the amplitude and sample rates with the arb file, I just needed to do a quick front panel check to make sure nothing happened to my designed signal during the transfer.

Then on channel 2, I set the output to be a sine wave with a frequency that matched my RC car's signal of 45 Mhz. The amplitude could be set depending on how far away from the generator I wanted to control the car. For the purposes of the video, I just set it to maximum amplitude of 10Vpp. But further testing I found that with 2.5Vpp I could limit the distance to my desktop.

The critical part of generating the right signal was the AM modulation. I set the generator to turn Modulation On and ensured that I was using internal modulation. One of the unique features of Trueform generators is the ability to modulate using the other channel as a modulation source. I set the Modulation source to channel 1, which is now generating the reverse arb that  I showed in figure 2. That's all that I needed to create the signal. After turning the channel 2 output on, I was able to make the go backwards/reverse.

My real goal was to control the car in different directions, not just one direction.  This would require multiple arbitrary waveforms to be outputted by my waveform generator. Rather than creating one large waveform that would be difficult to change in the future, I decided to use waveform sequencing which is a feature that is not often seen on this class of waveform generators. Waveform sequencing allows a designer to grab different arbitrary waveforms that he has designed and easily put them together in new orders, lengths, or transition between the waveforms with a trigger.

I mentioned earlier that sequencing is why I decided to use Channel 1 to modulate Channel 2. If I had decided to use an arb to modulate Ch 1, I would have limited my flexibility. With sequencing, I can easily change the duration or trigger the next waveform with a couple of clicks. You can do this as well with editing the waveform by itself, but it is more tedious to try and move the arbs around if you manipulate everything in a single arb. You would need to determine which which samples started and ended your arb, then move those around at the sample level. An analogy would be the difference between programming a simple equation in assembly vs. a compiled language. You could write the equation as:

int a =1+2

or your assembly program can start off as:
 number db 7 dup 0     ; string which will store input and output
  n1     dw 0           ; two input variables
  n2     dw 0
  res    dw 0           ; one output variable
  cr     dw 13,10,"$"  ; carriage return, line feed
start:
  mov dx,offset number
  mov bx,dx
  mov b[bx],5   ; maximum 5 characters to read
  mov ah,0ah
  int 21h   ; read in a string from keyboard
  mov bx,offset number +1
  mov cx,00
 
 
Then continue on for another 30-40 lines of code. Both have their uses, but I think that you'll agree that putting things into a higher level hierarchy can make things a lot easier.

I created individual arbitrary waveforms for each of the directions above. Forward, forward with a right turn, forward with a left turn. and the same for the reverse directions. With a library of six waveforms, I can now mix those waveforms to go in any number of directions. Now rather than having individual signals, I can put them together to create a much larger signal we call a sequence. Each of those waveforms I designed are now segments in my new waveform sequence.

If I wanted to just have the waveform segments repeat a number of times, I can set the "Play Control" to repeat then set the number of times I want that waveform to play. I did this in the video and got some pretty fun results.

Another sequence control that is very useful is the Repeat until Trigger setting. This setting will continuously play a signal until a trigger is received. In the real world, this can be controlled with an external trigger that is connected to another instrument such as a DMM. We can also trigger this with a manual trigger from the front panel. I would use this setting if I were to go through an actual obstacle course since trying to time the obstacle course in terms of waveform cycles would be difficult. By using the trigger, I could wait until an event before triggering my next waveform direction.

So, there you have it. Even though this post was pretty long. The actual amount of engineering time to do all of this was less than an afternoon's worth of work. It's hard to even call it work since it was so much fun to do.


\

84 comments:

  1. Amazing Content!! Really I was confuse on the same but now satisfied, I was visit one more website like you circuit design.

    ReplyDelete
  2. If your kids love racing, then Remote Control helicopter with Large Hand Remote Controller car is a perfect gift for them. Every Remote Control Products can Move Forward, Backward, Left and Right, Up and Down. This remote control car, remote control helicopter, rc trucks, rc plane, fms plane parts, rc drift cars, hsp parts, rc helicopter is powered by battery and responds excellently when moved in directions of their choice.

    ReplyDelete
  3. Very cool, thanks David. Im trying to learn how to control my RC with the waveform generator and ive been having problems. Thanks for keeping it up for me.
    rc boats

    ReplyDelete
  4. I don't think numerous websites offer these posts of collection.more

    ReplyDelete
  5. Cool! Now this is interesting, if we can control an RC car with waveform its not surprising that we can do a lot of stuff. Stuff that good writing websites can use in their system.

    ReplyDelete
  6. Also, flying this RC vehicle has turned into a lifetime side interest for some devotees, which shows the kind of force that this movement practices over enthusiastic flyers. Best RC Helicopter

    ReplyDelete
  7. RC vehicles can be divided into several categories according to their performance level, size, energy source, etc. When we consider the categorization according to the performance level, mainly there are two types of RC vehicles.
    Swell RC

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. All the cars offered for rent are in brand new condition and have all the relevant paperwork needed to be offered for rent. edmonton car shipping

    ReplyDelete
  11. To reunite with your beloved vehicle, you should make certain to use the services of a fully licensed and insured car transport company that specializes in transporting cars.car shipping

    ReplyDelete
  12. Since the primary automobile hit the street over a century back, it has experienced critical innovative and mechanical changes and the cutting edge auto has developed fundamentally from its unique shape. Mohammad Amani

    ReplyDelete
  13. This is very interesting, You’re a very skilled blogger. I have joined your feed and look forward to seeking more of your fantastic post. Also, I have shared your web site in my social networks!
    Regards - www.office.com/setup
    www.office.com/setup

    ReplyDelete
  14. Jim has really made my whole day happy. His blog on car insurance scam helped me a lot to avoid a spammy insurance broker. Jim

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. I am convinced that your website is convinced that weblog is very new. Probably I am going to bookmark your site. There are certainly impressive stories. Passion for sharing your website with us.
    Regards - www.office.com/setup
    www.office.com/setup
    www.office.com/setup

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. Some genuinely superb posts on this site, thanks for contribution.
    Regards - www.office.com/setup
    www.norton.com/setup

    ReplyDelete
  19. You need to join in a contest for one of the most useful blogs on the internet. I will recommend this web site! Blog RC crawler

    ReplyDelete
  20. 1z0-932 vce Exam Study Guide imparts you the best knowledge on each and every question of Oracle 1z0-932 certification exam.

    ReplyDelete
  21. I am convinced that your website is convinced that weblog is very new. Probably I am going to bookmark your site. There are certainly impressive stories. Passion for sharing your website with us.
    Regards - www.norton.com/setup

    ReplyDelete
  22. We should all admit we have a dependence on our air conditioning when the hot weather arrives. In Melbourne, the high summer months can see temperatures nearing highs of 40 degrees C and lows of 24 degrees C which puts a strain on both bodies and the vehicle air conditioning system. Your body has to work hard at staying cool while your air conditioner pumps refrigerant trying to maintain a decent interior temperature. Alicia

    ReplyDelete
  23. In the event that you are considering procuring an auto amid your stay some additional cash will mean you can get in the driver's seat of a luxury auto. You don't need to get and drop off the auto in a similar area.exotic car rental

    ReplyDelete
  24. Amazing post! This is very interesting, you are a very skilled blogger. I have joined your feed and look forward to seeking more of your fantastic post. Also, I have shared your web site in my social networks! Cars Buyer

    ReplyDelete
  25. These are more practice zone where you should not have to know them everything except acing a couple or one zone will differential you from an aggregate amateurs. foreign auto repair near me Orlando

    ReplyDelete
  26. Terrible driving isn't really a matter of sex. Be that as it may, ladies have better enthusiastic abilities and reasonability is one of them.Attorney of Traffic in Herzliya Requests from drivers עורך דין תעבורה בהרצליה

    ReplyDelete
  27. This app is awesome, thank you for sharing this great article.
    wings io

    ReplyDelete
  28. In this case you will begin it is important, it again produces a web site a strong significant internet site:
    best-rc-cars

    ReplyDelete
  29. Australian setting out to the UK, you can book your car on the web and have it prepared for you to gather when you touch base at the airplane terminal. Advantage

    ReplyDelete
  30. Good to become visiting your weblog again, it has been months for me. Nicely this article that i've been waited for so long. I will need this post to total my assignment in the college, and it has exact same topic together with your write-up. Thanks, good share..car rental under 21 Miami

    ReplyDelete
  31. VolgoPoint have top quality Rc Toys on international level with bulk of different products. We offer world-class and exquisitely products and creating strong relationship with local and international market.

    ReplyDelete

  32. A great many people have leased a car at some time. The most well-known reason is air make a trip we have to get from the air terminal to our hotel, conference, or meet companions and relatives

    ReplyDelete
  33. This comment has been removed by the author.

    ReplyDelete
  34. If you are looking for the best deals on flight booking, Contact JetBlue Airlines Phone Number now. The executive at this helpline are offering the best deals and offers.

    ReplyDelete
  35. Zenith fulfills her father’s dream by setting out on a 500-mile Motorcycle journey “I REALLY GOT INTO THE PSYCHOLOGY AND PHYSICAL STATE WHERE YOU HAVE TO KEEP ON TELLING YOURSELF YOU NEED TO RIDE FURTHER AND PUSH YOURSELF. OTHERWISE, YOU JUST GIVE UP AND COME BACK.” -ZENITH IRFAN

    ReplyDelete
  36. Very cool, thanks David. if you want to update with upcoming latest technology Tech to Review is the best platform. This new generation want to like update time to time new features technology which gadgets can introduce great time-saving advantages into your days. And here you can get everything in one place, that is Tech to Review.
    https://www.techtoreview.com/

    ReplyDelete
  37. You did an amazing job. I really enjoyed reading this blog. I like and appreciate your work. Thank you for Sharing such an amazing article. essay writing service


    ReplyDelete
  38. I am not much into reading, but somehow I have to read lots of articles on your blog. It's amazing how interesting it is for me to visit you very often. custom essay writing service

    ReplyDelete
  39. One of the trade-in vehicle purchasing tips I need you to detract from this is any car can be a "decent arrangement" insofar as the issues inside the car are found and value brought down to redress.
    local car dealerships

    ReplyDelete
  40. Fresher Zones could be a distinctive job portal that offers government job for the scholars. The job search platform helps to search out jobs and employment in India. We offer the latest updates for government jobs. Fresher Zones is providing the Latest Government Jobs Notifications and conjointly give the latest updates of the govt exams. For more information click here: https://fresherzones.com/

    ReplyDelete
  41. This article is great. I like it very much. Thank you.
    โปรโมชั่นGclub ของทางทีมงานตอนนี้แจกฟรีโบนัส 50%
    เพียงแค่คุณสมัคร Gclub กับทางทีมงานของเราเพียงเท่านั้น
    ร่วมมาเป็นส่วนหนึ่งกับเว็บไซต์คาสิโนออนไลน์ของเราได้เลยค่ะ
    สมัครสล็อตออนไลน์ >>> goldenslot
    สนใจร่วมลงทุนกับเรา สมัครเอเย่น Gclub คลิ๊กได้เลย

    ReplyDelete
  42. Thank you for making me realize this. It's great.
    เว็บไซต์คาสิโนออนไลน์ที่ได้คุณภาพอับดับ 1 ของประเทศ
    เป็นเว็บไซต์การพนันออนไลน์ที่มีคนมา สมัคร Gclub Royal1688
    และยังมีหวยให้คุณได้เล่น สมัครหวยออนไลน์ ได้เลย
    สมัครสมาชิกที่นี่ >>> Gclub Royal1688
    ร่วมลงทุนสมัครเอเย่นคาสิโนกับทีมงานของเราได้เลย

    ReplyDelete
  43. To avoid making a mistake of buying a car that will leave you penniless, do your budgeting right. Again do not forget to include the maintenance cost in your budget calculation because some cars are cheap to buy but expensive to maintain and the reverse is true.read more about the site here

    ReplyDelete
  44. Thank you for sharing this
    I would like to share information about institute.
    Vibrant Academy is the Best IIT Coaching Institute in India.The institute was started in 2009 with the aim of providing the best training to students. Today, it is one of the top institutes among all the coaching of Kota.

    www.vibrantacademy.com

    ReplyDelete
  45. Sarkari Result is providing the results of government Exams and admit card of the government exams. We provide the updates of the government exam results and admit cards. We provide the Updates of the government exams. We provide the admit card of the government exams and you can also know your result from this website. https://sarkariresults.site/results/

    ReplyDelete
  46. great article, I was very impressed about it, wish you would have stayed next share
    mutilate a doll 2

    ReplyDelete
  47. QuickBooks is software which is used for calculation. Especially it is known as accounting software. But using this there are many issues arises, But you don’t need to worry about it QuickBooks Support Phone Number always available for you. It will help you to solve all the issue.

    ReplyDelete
  48. The Redsox World Series Ring indicates the achievements of the 2018 team by perfectly melding all parts to form history. The Reds World Series Ring Carry 185 total stones which representing 162 regular-season games, 14 post season games, and nine World Series titles in franchise history. Unique to skilled championship rings, Red Sox World Series Ring is awarded to payers, coaching job workers, and members of the club for thier phenomenal performance.

    ReplyDelete
  49. Simply want to say your article is as amazing. The clearness on your post is just spectacular and icould suppose you’re a professional on this subject. Well together with your permission allow me to clutch your feed to keep up to date with impending post. Thank you a million and please continue the enjoyable work. Our experts are best at checking out and booking the cheapest offers for the clients You can get in touch with the Jetblue Airlines Reservations Number and book your travel plans now!



    ReplyDelete
  50. We are the best Write My Essay 24/7 Services company providing law Write My Essay for Me Cheap as our articles are unmatched and comparable to none since our professional writers understand requirements for completing this type of assignment.

    ReplyDelete
  51. We understand that a Best Essay Writing Service is an important piece of writing. So, don't take the risk of presenting a paper that you are not sure will earn you grades. Take advantage of our Custom Essay Writing Service expertise. This is a chance to climb higher on the grading criteria.

    ReplyDelete
  52. Have always love this platform king Sammy songs

    Especially this one.
    shamee songs


    Thanks for updates

    ReplyDelete