Saturday, 24 October 2009

AVR project log H bridge 3/ADC1/updates


27/10/09 Day 40


Finally, the H-bridge and motor session has come to an end, after successfully controlling motor speed and direction.


The follows are the 'bright' side of the project
1.H-bridge design from senior which only needed 4 transistor as compared to 6 from the previous post.

2. Got a 7809 voltage regulator to power the motor.

And I also have the 'DARK' side of it.

green line -theoretical voltage value
blue- clockwise rotation
red -counter clockwise rotation
purple min- voltage for the motor to operate 1.5V

1. As what you can see the practical and theoretical value differ; practical and theory are 2 different thing!!

2. The motor should have 25 steps before reaching maximum as oppose to the practical 17 steps for CW and 14 for CCW.
" most probably caused by spike and false triggering"

3. Both voltages increase drastically at steps 3-4, passing the minimum operation voltage
" The motor just can't go at 1.5 voltage and sucks more voltage??"

4. I have problem with the max speed indicator in CCW direction.

***********************


Finally, I got the ADC working. My previous ADC ended up with a fried chip. One of the factor was that I didn't disable the digital input as told by the Atmel support team.

And now I finally found out what when wrong to my previous code.
How silly of me... the computer does recognize (86<170),>86 && ADCH<170)>

*********
UPDATES

new work place!! with an addition of a new all in one printer




Friday, 23 October 2009

RAJA UDA 九皇爷

I was fortunate enough to witness the biggest 九皇爷 celebration in North Malaysia, held in Raja Uda.

I'll let the photos do the talking...


Spot the pretty girls! ;)



During 九皇爷, they will eat vegetarian food for a period of 10 days, and cook using utensils specially for this event.
The new temple, biggest in North Malaysia:


Of course the highlight of this event, will be the one belows.



Too crowded, everyone wanted to witness how they pull out the piercing; I need to stand on a chair, to get this photo.


yeah parade! With participation from other temple from Bukit Merterjam, Sungai Petani, and some even from As far as Gurun.mm

top left: Gigantic joystick>> opera with chinese sub title (might not be able to see it in the small pic) >> 5 days of burning and still going!! >> bamboo, only for those who ate vegetarian can enter.

This event was really an eye opener for me! it's great to be able to experience all this, special thanks to my friend Eng Kitt for the hospitality.

Saturday, 17 October 2009

AVR project log H-bridge 2

17/10/09 Day 33

This is a follow up from the previous post.
As stated in the previous post, while connected to a 9v power supply, and controlling the H-bridge with 5 V, the motor only had a poor 3.6v across it!!

Mine very own H-bridge design, which turned out to be not functional.

After doing some simple analyzing with a multimeter ( I should have done this earlier!! ) and found out who "stole" the motor's voltage. My finding are as below.
** note: Q1 and Q2 below are the circled in the 1st diagram.


drawn with multisim 10

So all the voltage was across 1st transistor emitter and collector!!!The only part I got the H-bridge working was that the 2 transistors of each side (top and bottom) are turned on in reverse state, thus preventing short circuit.
However this H-bridge, had lead me to discover one thing--- I have poor knowledge in transistor!!!


The following H-bridge is a design from pocketmagic , and it works well ( should be, now just trying with 5V power, need to get a 9v regulator to really test it out)

I've also found another H-bridge design from one of my senior final year project report, but I never tested it out. I'll just place it here for future reference.



Wednesday, 14 October 2009

A book worth reading

What formed the China and Taiwan of today?

Well it all begins with what happen 60 years ago....

This book is tells a historical story during the post world war 2 era in China, presented in forms of short personal experience of those civilian who when thru that painful era.

Diffidently worth reading, and you'll get to undertand the relationship between Taiwan and China.

Monday, 12 October 2009

Robot Magazine



what a great surprise today!!
Just receive the long awaited free robot magazine, deem to be the 1st robot magazine in Malaysia, courtesy of Cytron.

Bye, going to read it now!!

Sunday, 11 October 2009

AVR project log- PWM DCmotor

11/10/09 Day 27


Controlling DC motor speed with PWM was quite successful.
I was able to control the motor with varying speed in both, clockwise and anti clockwise direction, then a indicator LED will light up when you are at the maximum speed.

Software aspect, I used an interrupt, which leaves my main processor doing nothing/ or can be used to do something else, however it still has a few drawbacks.

1. I can only supply the motor with 3V, and with a increment step of ~4%, each increment is not obvious. With a 3V supply, i'll be increasing the motor by 0.117V every step. Likewise, with a 9V supply, I each step will be 0.351V. Hmm still quite low, maybe i should make each step 1V.

2. The motor starts with 0v, with every increment of 0.117v, I would need to rapidly press the tac switch ~13 times in order to get the minimal 1.5V, get the motor started. Still looking for a way to get around it.

3. Software site, I still need to figure out how to use a variable shared among the interrupt and main. Currently I just manually add a varialbe in the interrupt part.

Add on/ improvements
1. add a bar graph/ 7 segment display to indicate the motor speed
2. add a sensor, eg temperature sensor, increse speed when the temperature is higher!!
of course this involves ADC, which is the part I did previously and somehow damaged one pin the chip.

ADC will be the next mountain to climb!!!!

Till then bye.

Saturday, 10 October 2009

AVR project log H-bridge (update1)

10/10/09 Day 26

Almost a month now, since the day I started learning AVR.

Currently having fun with dc motor.
As you've known, dc motor can rotate in counter clockwise and clockwise direction. To do that with a micro controller, you'll need to use a h bridge.

Whats a H-bridge? lets the pro tell you
1. robot room
2.rickeys world
3.chuck

last but not least
wikipedia H-bridge

the below schematic is taken from "robotroom' I followed it and it works well with 4 output pins.

then I try to reduce the no. of IO pin by connecting R2 with R1and R3 with R4.
Then I try to reduce the no. of IO pin by connecting R2 with R1and R3 with R4, as seen in one website. Once turned on, the transistor went madly hot in no time.
I know there is a short somewhere, but where exactly? Well it took me sometime before I realize that by connecting the base of both transistor together, I was turning both of them Q1 n Q2, shorting the circuit!!

Solution to the problem?
I cracked my head, and finally got a simple solution! Just switch the position of the PNP and NPN transistor.


Yeah, I think someone thought f this solution a long time ago, and it must be in one of the website, but whatever it is , the motor is spinning now. Hooray!


*******
Ok the Hooray was just for able to make the motor spin, now I'm not delivering full power to the motor.
when supplied with 5v, the motor gets 3v, acceptable; with 9v, the motor stills receive 3v, thats not acceptable. So what went wrong? Might be the transistor not fully saturated.

*******
Ok, after testing it, the transistor is fully on, with a voltage of 0.7 across the the emitter and base. Could it be the transistor? Well anyway wont going to investigate deeper into this manner for the moment, now I'll just stick this condition and will try to controlthe motor speed first.

Wednesday, 7 October 2009

AVR project log

5/10/09 Day 21

The better version, the color changing is more "smooth" unlike mine, the one below, which suddenly change in colour.

Photobucket


Photobucket

Friday, 2 October 2009

AVR projrct log

2/10/09 Day18

DAMN!!! OMG how can this happen?!?!

You might guess what happened, I broke the RGB led and Attiny45 Again..

Yes you didn't get me wrong, Again!!! LOL


So what really happened, I really don't know.. that's the main problem, i don't know what went wrong, zzzz so there is a high possibility that there it will be next time.