Showing posts with label Wireless. Show all posts
Showing posts with label Wireless. Show all posts

Friday, 28 June 2013

RC Updates 6/28 - Awesome Demo!

Hello Everyone!

I have an awesome demo for you all today. I have been busy with other things lately, so haven't had time to post on the blog. However, Christmas came early and I got a highly-anticipated package in the mail today. I dropped $40 on Sparkfun 3 days ago and bought the IR Proximity Sensor I talked about in one of my earlier posts, 2 thumb joystick breakout boards, Lead-free solder paste for reflowing, and SOT-23 breakout boards.

If you remember, I bought a PS3 controller about a month ago. I disassembled it and desoldered one of the thumb joysticks on the controller (desoldering was such a pain, can't even describe it...). So I grabbed a couple of joystick breakout boards from Sparkfun which I received today.

In addition, while I was away from the blog, I did crack the RF modules! I don't remember if I mentioned this in a previous post or not, but RF modules are up and running, so the firmware is really taking shape. The remote unit firmware for the C2000 LP is running SYS/BIOS and is PWMing three seperate pins. One of the pins is the servo control pin, and the other two PWM pins are going to the motor controller (the thing on the breadboard I demoed with an LED a month ago). I don't have a motor here with me, but with these 2 PWM pins, I should have decent speed control of the car.

Time for the demo!! I am not going to say anything, just watch it. It is pretty awesome.



The dead-zone issue is now fixed so the servo doesn't spaz out while it's idling anymore like it was in the video. Let me know what you think, I am pretty excited to see the project taking shape.

Thanks!

Wednesday, 5 June 2013

RC Car Update 6/4

Hey everyone!

I haven't posted in a week but I have made some major progress in the meantime. Let's get right to it!

I received my first set of PCBs from OSHPark last friday! They look amazing and the dimensions seems to be perfect. I had to measure the distance between the two sets of pins on the RF module so I was worried that the pins on the module wouldn't match the holes on the board, but it was a perfect match! I did screw up one thing though, the silk screen with names of the pins were wrong. Because the pins were mislabeled on my board, my MCU couldn't talk to the RF Modules and it took me too long to find out that it was a simple labeling mistake... If I ever make rev 2 boards, I will be sure to fix that. And I am thinking about reducing the ground plane dimensions so it doesn't span the area near the RF antenna as that causes a  decrease in the wireless performance. But here are a few pictures of the board!




I am able to talk to the RF Modules using SPI, and it turns out SPI is a very easy and fast interface, so it is recommended to everyone! The only problem right now is that it turns out I don't have enough female-female jumper cables so I can't connect up the both modules at the same time. So I haven't yet tried to actually get the RF modules talking to each other. No worries, the jumpers are already in the mail.

The firmware is also coming along nicely. I am building a library of drivers for the CC1101 RF Modules for both of the launchpads, the C2K and the MSP430. The C2K library is compatible with SYS/BIOS which is running on my C2000 firmware, and with small modifications it works on the MSP430 LP. I am done with the core functionality required for basic communication, so I will make the MSP430 LP talk to the C2K LP over RF once I get my jumper cables.


Also, I purchased a PlayStation 3 controller which I will modify and make it into the controller of the RC Car! The controller is not a Sony brand controller, but an off-brand one. However, the cheaper the controller is, the easier it is for me to work with it. I already tore apart the controller to see what's inside and how much room there is inside. I suspect the spiral antenna of the RF Module will have to stick out of the controller since there is not enough room to fit it all in there. The controller has a slot for 3 AAA batteries, and I will use a TI Buck-Boost converter TPS63031 which is able to up/down convert to provide a stable 3.3 V power source. And as I mentioned before, an MSP430G2553 will be in the controller. I might go for a surface-mount package rather than DIP, but I don't trust my soldering skills, so we will see depending on the space limitations inside the controller. Here is a picture of the controller, assembled and disassembled:


Power A Pro PlayStation 3 Controller


Controller Assembled

Space in the controller is limited unfortunately. I will design a PCB with the same dimensions and shape as the board seen above, but with my own circuitry. One down-side with this controller is that the triggers aren't connected to potentiometers, they are basically tactile switches, so it is either pressed in or released, and nothing in between. I was hoping to make one of the triggers the throttle for the car, but I can't do it with this one. So I will make the left joystick throttle control and the left joystick will control the steering. One of the push buttons will become motor brake and another will be used to toggle the LEDs on the car. Thanks for reading and do comment below!

-Anil

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.

Friday, 26 April 2013

Motor Controller Design Update

So, it took me much less than anticipated to figure out how Eagle works. I was thinking it would take me the whole summer, but it only took 2 days. I downloaded the free version from their website and got cracking right away. I found an awesome tutorial on Youtube that walked me through the basics, and then I got the hang of it.

I did a little research on how I can actually get the PCB manufactured, and it turns out it is not so cheap. As you would expect, the price goes up as the board gets larger. Therefore, I tried to keep my design as minimal as possible. My original plan was to have the "big" MOSFETs (I explained what I meant by big in my last post) laid horizontally so I can use some large copper plates on the board as heat sinks. The MOSFETs I am using come in TO-220 packaging which means you can mount them to heatsinks since they come with a big area of expose metal in the back. Here is a picture of TO-220 packaging (source: Wikipedia).


However, I had to ditch that idea because the boards became too big for me to be able to afford. I am going to use oshpark.com's service to get the board manufactured and they charge $5 per square inch for a 2-layer board. However, they do give you three copies of your board for that price. Anyways, here is a screenshot from Eagle of how the PCB currently looks like. 


I actually really like oshpark's website. It looks really simple and it is very easy to use. To get a quick quote and to get your design verified, all you have to do is upload your Eagle PCB design files. Then they automatically process it online and give pictures of how your board is going to look like when it is printed. My board is going to be 2-layers, and its dimensions are 3.44x1.5 inches. This is going to cost me a tad over $25 for 3 copies. Check out the OSH Park renderings below. 

Board Top
Board Bottom
Top Layer
Bottom Layer
You might spot weird connections on the board. This is only my first time, and it turns out routing wires on 2-layer boards is very tricky. This is probably the design that is going to be manufactured. I go back to the design files every once in a while and try to spot any mistakes. But because the transistors will be vertical rather than horizontal, there won't be any heatsinks on them. This means that I can't pull more than a couple of Amps continuously (hopefully). Trying to pull more than that will cause the transistors to overheat.

Let me know what you guys think!

Anil



Wednesday, 24 April 2013

Update on the RC Car

Hey all,

Don't think that I gave up on the RC car project. I have been extremely busy with school, but I have also been doing my research. Here are the updates, firstly, I ditched the Bluetooth idea for the car. Instead I am going to use a 433 MHz RF transceiver. This will give me a range of at least 500 ft hopefully.
I am also currently in the market for a higher RPM motor. For initial testing, I will stick with the motor that came with the car. Good news is that I am building my own motor controller!



Here is the background info: you can't just drive a motor directly off of a pin on your microcontroller, you will literally blow up that MC if you try that. DC motors require a lot of current, especially when they stall. And for that, you need beefy transistors. In my design I have 8 transistors. 2 of them are p channel MOSFET s and the rest are all n channel MOSFETs. The 2 of the 6 NFETs are what I call "big" which means the motor current runs through them. Similarly, the PFETs are also "big" since they are directly interfaced with the motor. The other 4 "small" NFETs are used to drive the big MOSFETs.


The design is attached to this article. You basically don't want the wrong combination of MOSFETs on simultaneously since you will short your power source. To make sure this never happens, I am adding a logic protection layer. The logic circuitry has one 2-4 decoder, 1 NAND gate and one inverter. I have the logic on the design schematic. Basically, as far as the MCU is concerned, there will only be two wires between the MCU and the motor controller. 0-0 means neutral motor, 1-0 means forwards, 0-1 means backwards and finally 1-1 means motor brake. Motor braking is achieved by shorting the terminals of the motor.



Anyways, I am currently waiting on the last part, which is the decoder. I currently have the circuit partially wired up for testing. I am also attaching a picture of it. I was able to run my motor in both directions successfully. Once I have all the parts and finish testing, I will start to learn how to use Eagle. I want to make a PCB with this circuit on it. Once that is done, this baby will go on the car!


You might ask, why build your own motor controller? Because theoretically, I can pull nearly 20 AMPs (if I had heatsinks) from this circuit and the generic motor controllers out there only provide 1 A continuous current. I am making this car OVERKILL!!! Which means I want 25 million amps of current!

But no, realistically, I am shooting for about 2 amps of current, given that I find a battery that is comfortable with that. Anyways, hope you enjoyed the update.


Anil