Monday, 27 May 2013

Building an RC Car Update 5/27

Hey all,

There are many updates! I have been working on the revised motor controller circuit board for weeks now. If you remember, I shared the screenshots and rendering of the original motor controller PCB a few weeks back. However later on, I decided to integrate the C2000 Launchpad, all the pin outs for external components and the motor controller on the same circuit board. So I have been working on this revision and here it is! The following pictures are OSHPark renderings along with 3-D image renderings. Let me know what you think! OSHPark quotes me $60 for 3 of these boards but it looks like I can get 5 of these boards for about $20 from Seeed Studio.



3-D Renderings of the Board. Notice the two sets of double headers where the Launchpad will sit on. 




OSHPark Renderings of the board.

Before I send it out to the fab, I still need to do a few more proof of concepts. First of all, I am still waiting on the breakout boards I made and ordered for the CC1101 Wireless modules. I figured out how SPI works on the C2000 and got it running on SYS/BIOS talking with my Aardvark SPI/I2C Monitor. Now all I need to do (once I receive my breakout boards) is get those wireless modules working! I have been reading the datasheet and I have a rough idea of what I need to do so we will see how it goes.

Major Addition:
I was talking to my dad about this project and he came up with a great idea! He suggested that I add a proximity sensor on the car to avoid collisions. I thought that was a great idea and found this SHARP IR Proximity Sensor. Basically it is an IR emitter and detector coupled in one package that spits out analog voltage between 0-5 V. I will pass that analog output through a voltage divider network to make sure it doesn't exceed 3.3 V going into the ADC of the C2000 Launchpad. So I will place this sensor on the nose of the car where the front bumper is and it will automatically brake the rear wheels if it senses an obstacle that is less than 5~7 inches away. Here is a picture of the sensor:
Sharp IR Sensor capable of sensing obstacles up to 80 cm away.

With the fast motor I am eventually planning on putting on the car, it is a good idea to have this sensor to "preserve" the car. I am really excited about this and I have already compensated for the sensor connections on the main circuit board that I shared above. Thanks for reading and please let me know what you think!

Edit: I just noticed the 3-D renderings differ slightly from the OSHPark renderings. The OSHPark renderings depict the most recent state of the circuit.

Saturday, 18 May 2013

RC Car Updates 5/17

Hello!

I have a video for you guys today. In the video below, I demo the motor controller prototype for you guys. I have temporarily relocated to California and I couldn't bring the RC Car frame with me here. The frame has the main DC motor on it, and I haven't been able to take it off, so to bring the motor, I would have to bring the whole frame which is way too big. As a result, you will see in the video that I don't have a motor to connect to the motor controller. I did manage to PWM the motor using the C2000 LP before I left for California, so that does work. I am using a pair of LEDs connected in parallel with opposite polarity to prove that current does run in both directions. Sorry for the lame demo, motor spinning would definitely be cooler than a pair of LEDs blinking.


On the other hand, I am going to start working on cracking the RF transcievers I have. As I mentioned earlier, the RF modules came with 0.05" pitch header connectors which are useless, so I had to build a PCB using Eagle to make a simple RF Module Breakout board. Renderings shown below. I actually just ordered these boards from OshPark an hour ago. I am very excited since these are the first ever boards I have ordered! For three of these boards, I paid only $5, so that is a good deal. For my next PCB, I want to try out Seeed Studio. The next board I will build will be quite large since it will incorporate the motor controller, headers for the C2000 Launchpad to sit on, and other pins to connect the external peripherals (Servo, LEDs...). I reckon if I use OSHPark to get that PCB done, it would cost about $40-$50 which is a lot. Seeed studio is much much more reasonable and I got this tip from a colleague at work (shout out to Stephen!)

 OshPark PCB Top rendering.

 OshPark PCB Bottom rendering.

I have an Aardvark SPI/I2C Bus monitor with me here, and for initial protocol testing I will be using it. Later after I figure out how the communication carries out, I will start working on the drivers for the C2000 LP. The protocol is SPI and I am not worried much about that, what worries me is the abundance of registers in the RF Modules and the 100-page datasheet. So I will need to figure out how I need to set up the internal registers in the RF modules (set one as a receiver and the other as a transmitter and tune them to correct channels, set up error connection, etc.....) The advantage of Aardvark is that I will be able to send commands to the RF Module over SPI from my computer. Therefore, I will be able to see all the communication taking place on my computer in a terminal which makes debugging much easier. I will keep you updated.

-Anil

Tuesday, 14 May 2013

RC Car Updates 5/14

Here are some more updates on the project. In my last update post, I pointed out that I was waiting on one last part to complete the prototype. I was actually waiting on some 2-to-4 decoders and I received them almost 2 weeks ago. As soon as they arrived, I popped one on the breadboard and constructed the circuit that I shared as a design drawing 2 posts ago. I was so surprised but it "just" worked!! I didn't have to tinker with it or anything, I just went by the design and it worked. I actually started on the software also, I will talk more about that later on. But I connected up the motor to it, and connected the two motor controller input pins to my microcontroller and applied a PWM signal, and it worked!!

More about the microcontroller side of the project: This is the first project that I am building that is using TI's C2000 Launchpad Microcontroller. This launchpad, which I believe is the second Launchpad that TI released, uses the C2000-F28027 Piccolo Microcontroller. It runs at 60 MHz, and it is capable of UART, I2C, SPI... On top of that, it has many other useful peripherals such as a EPWM peripheral. This is one of the 2 reasons I chose to use the C2000 Launchpad in my project. The other reason is that it natively supports TI's RTOS which they call SYS/BIOS. This is a real-time operating system and it is not too bad to use. I actually have some experience with it because I used a much more powerful C2000 working for Buckeye Current and we implemented SYS/BIOS on our motorcycle.

Since TI seems to have increased their prices for the MSP430 Launchpad, for another $8 ($18 in total) you can get the C2000 Launchpad and it very very capable. MSP430G2553 runs at 16-20 MHz tops and the C2000 Piccolo runs at 60 MHz! The only down side, I would say, is when you are done with experimenting and prototyping, you can't just take out the Piccolo microcontroller from your Launchpad and place it on a Perf Board, or a breadboard. The packaging doesn't allow that, and the Piccolo is soldered on the board, whereas the MSP430 comes in DIP packaging which you can pry out and use on an external circuit (like I did in my Car Trip Computer Project).

Last thing, the PCB layout I shared 2 posts ago has been put off for now. Instead of making a separate board just for the motor controller, I decided to make one big board that will house the motor controller, the C2000 LP (sort of like a "BoosterPack" where LP will plug onto the board), and the RF module. Speaking of which, I do have the RF Modules! I got a pair of surprisingly little RF modules that broadcast at 433 MHz. They use the TI CC1101 RF chip and they handle error-checking and all sorts of other things by themselves! Down side, it has 105-page datasheet and nearly 1 billion registers (exaggerating) that I will have to go through :( The other down side is that the boards came with 0.05" pitch headers?!!! I am going to make a breakout board to convert that to the much more standard 0.1" pitch header, so I can breadboard it. Last thing, I will be using SPI to talk to the RF modules.

-Anil