Author Topic: this in reference to the line follower made by pratheek  (Read 12064 times)

0 Members and 1 Guest are viewing this topic.

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 32
  • Your success is in your hands.

Offline nik@sdmTopic starter

  • Jr. Member
  • **
  • Posts: 26
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #31 on: March 04, 2012, 11:33:07 AM »
sir,
how to disable the JTAG pin of the micro controller?

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 32
  • Your success is in your hands.

Offline nik@sdmTopic starter

  • Jr. Member
  • **
  • Posts: 26
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #33 on: March 06, 2012, 07:53:49 AM »
sir,
what should be connected to the in number 12 and 13 of the microcontroller ?
in the schematics its is mentioned as XTAL1 and XTAL2 ... is it that we need to connect some crystal oscillator...????

but nothing is given in the ckt diagram. i have highlighted them.

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 32
  • Your success is in your hands.
Re: this in reference to the line follower made by pratheek
« Reply #34 on: March 07, 2012, 06:20:08 AM »
XTAL1 and XTAL2 are for connecting external crystal oscillator, but this project using internal oscillator so no need to connect these two pins, just let it open.

Offline nik@sdmTopic starter

  • Jr. Member
  • **
  • Posts: 26
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #35 on: March 08, 2012, 09:52:05 PM »
sir,

i read the JTAG disabling tutorial in the link mentioned by u.
there i found the method for disabling the JTAG fuse permanently..... it was mentioned to take the values of lfuse as 0xff and hfuse as 0xc9 (it was mentioned that the value of the fuse bits needs to be 0xc9ff in order to disable the JTAG).

i wrote the  command “avrdude –p <microcontroller code> –c <programmer type> -t” in Command window....
but, in the pictures shown in the website m32(microcontroller code) was used.
since i'm using atmega16 i replaced it as m16...
 also the default values of lfuse n hfuse were different to that compared in the website...but i followed the remaining steps as mentioned...everything went right n the process was over.....
BUT ... thereafter i'm unable to even to program or erase the chip....
it shows the message as "powering on failed"....

now i'm unable to use that particular micro controller.....i think that the lfuse n hfuse values are different to that of
mentioned in the link.....if so is it possible to change the fuse bits again.

« Last Edit: March 09, 2012, 04:46:50 AM by nik@sdm »

Offline nik@sdmTopic starter

  • Jr. Member
  • **
  • Posts: 26
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #36 on: March 09, 2012, 09:05:19 AM »
sir,

how to generate hex file in avr studio?
i have read the article in engineersgarage.com...... i'm getting a lot of errors.... i have added all the things... source codes lotl.c and lcd.c     and the header files lotl.h , lcd.h and myutils.h.... still i'm unable to build the hex file...

Offline dpmntrs

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #37 on: April 14, 2012, 09:29:31 PM »
Dear sir,
thanx for the valuable info i recieved here.
im done with pratheek circut diagram of line follower but im not able to connect 4-5wires red black n yellow at the backside of  the board
please spell out those connections, ill be thanlful to u.


Offline bhavyabhatia

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #38 on: August 09, 2013, 12:43:26 AM »
1) This is the backlight I refer to, connect pin 15 to pin 1 of LCD connector, pin 16 to GND.
2) pin 3 is to be connected to 10K ohms preset at the LCD power connector mid pin.
3) see ans 1)
4) yes, is correct.

Sir, Iconnected the 1st,2nd and 3rd pins of the LCD module to the 'LCD power connector' and 8th to 15th pin of LCd module to 'LCD data connector'. 16th pin of lcd module is connected to GND as u suggested. Now where does the 4th,5th,6th and 7th pin of LCD module go ? Please respond.

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 32
  • Your success is in your hands.
Re: this in reference to the line follower made by pratheek
« Reply #39 on: August 11, 2013, 09:42:07 AM »
You connection was in-correct, The connection as follow

Code: [Select]
LCD MCU
Pin Port

01 GND GND
02 VCC +5V
03 Contrast Mid pin of 10K preset
04 RS PC4  Pin 4 of LCD Connector
05 R/~W PC5  Pin 3 of LCD Connector
06 E PC6  Pin 2 of LCD Connector
07 D0 No Connection(NC)
08 D1 NC
09 D2 NC
10 D3 NC
11 D4 PC0  Pin 8 of LCD Connector
12 D5 PC1  Pin 7 of LCD Connector
13 D6 PC2  Pin 6 of LCD Connector
14 D7 PC3  Pin 5 of LCD Connector
15 A B-LED Pin 1 of LCD Data connector
16 K B-LED GND


B-LED  Backlight LED

Offline bhavyabhatia

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #40 on: August 15, 2013, 09:34:54 AM »
You connection was in-correct, The connection as follow

Code: [Select]
LCD MCU
Pin Port

01 GND GND
02 VCC +5V
03 Contrast Mid pin of 10K preset
04 RS PC4  Pin 4 of LCD Connector
05 R/~W PC5  Pin 3 of LCD Connector
06 E PC6  Pin 2 of LCD Connector
07 D0 No Connection(NC)
08 D1 NC
09 D2 NC
10 D3 NC
11 D4 PC0  Pin 8 of LCD Connector
12 D5 PC1  Pin 7 of LCD Connector
13 D6 PC2  Pin 6 of LCD Connector
14 D7 PC3  Pin 5 of LCD Connector
15 A B-LED Pin 1 of LCD Data connector
16 K B-LED GND


B-LED  Backlight LED

Sir imade all the connections and my robo is working. I also burnt the hex file given by pratheek into the mcu. But my robot aint following the line. it jus moves straight when started. :(

What could be the possible issues sir ? Do ineed to calibrate my sensors? If yes, then how ? Pleaseeee help :(

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 32
  • Your success is in your hands.
Re: this in reference to the line follower made by pratheek
« Reply #41 on: August 16, 2013, 07:29:10 AM »
http://www.societyofrobots.com/member_tutorials/node/361
Quote
Tuning the PID control
   This is the most interesting part in building a PID control. In this step one should tune the Kp, Ki and Kd values to get the best results. I cannot give you the values because what works for me will not work for you. The optimum Kp, Ki and Kd values vary a lot from robot to robot. And the best way to determine the optimum values is by trial and error.
First, set all values to 0 and start with tuning the Kp value. First time I just gave an approximate value. Seeing the robot perform will determine what you should do next. If the robot wobbles a lot reduce the Kp value, if the doesn't follow the line (goes straight in curves) increase the Kp value. Tune the Kp value till the robot smoothly follows the line. By now you will have observed that the robot goes with no acceleration on straight lines. Now, tune the Kd term. After tuning the Kd term move to the Ki term. After which, you will see the robot first center over a straight line and then accelerate also.
Note: The optimum Kp, Ki and Kd values vary a lot even from track to track. You can only know these optimum values by testing.

Have you change the Kp, Ki and Kd values?

Offline bhavyabhatia

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #42 on: August 16, 2013, 09:41:25 AM »
http://www.societyofrobots.com/member_tutorials/node/361
Quote
Tuning the PID control
   This is the most interesting part in building a PID control. In this step one should tune the Kp, Ki and Kd values to get the best results. I cannot give you the values because what works for me will not work for you. The optimum Kp, Ki and Kd values vary a lot from robot to robot. And the best way to determine the optimum values is by trial and error.
First, set all values to 0 and start with tuning the Kp value. First time I just gave an approximate value. Seeing the robot perform will determine what you should do next. If the robot wobbles a lot reduce the Kp value, if the doesn't follow the line (goes straight in curves) increase the Kp value. Tune the Kp value till the robot smoothly follows the line. By now you will have observed that the robot goes with no acceleration on straight lines. Now, tune the Kd term. After tuning the Kd term move to the Ki term. After which, you will see the robot first center over a straight line and then accelerate also.
Note: The optimum Kp, Ki and Kd values vary a lot even from track to track. You can only know these optimum values by testing.

Have you change the Kp, Ki and Kd values?


No sir we didnt because What happened was that the three pushbuttons - ( connected to PD3,PD2 and PB2 of atmega)
when used, two pushbuttons were decreasing the values only. No pushbutton cud increase the values on the LCD screen. We cudnt get what the problem was beacuse all the connections are made right. Thats why we cudnt adjust the Kp,Kd,Ki values through trial and error.



Secondly,
When our sensor array was connected to 5V VCC and GND, IR leds werent emitting light. When giving direct 9V from the battery they were emitting light. Iguess they arent getting enough current. Should be we using 1K resistors instead of 10K to solve this problem ? or what ?

We have our competition coming soon. please help sir.
« Last Edit: August 16, 2013, 10:10:01 AM by bhavyabhatia »

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Re: this in reference to the line follower made by pratheek
« Reply #43 on: August 16, 2013, 11:13:44 AM »
You should not use any resistors on the VCC or GND lines. You should supply the right voltage, with as low source impedance as possible.

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 32
  • Your success is in your hands.
Re: this in reference to the line follower made by pratheek
« Reply #44 on: August 16, 2013, 01:06:12 PM »
Secondly,
When our sensor array was connected to 5V VCC and GND, IR leds werent emitting light. When giving direct 9V from the battery they were emitting light. Iguess they arent getting enough current. Should be we using 1K resistors instead of 10K to solve this problem ? or what ?

We have our competition coming soon. please help sir.

The IR LEDs was supply by the 120 ohms resistor R1, the 10K resistor was for the photodiodes,

what do you means by "giving direct 9V from the battery"?

to which part of the circuit?

Giving 9V may kill the MCU Atmega16 which only operate on 5V.


Offline bhavyabhatia

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #45 on: August 16, 2013, 10:57:49 PM »
Secondly,
When our sensor array was connected to 5V VCC and GND, IR leds werent emitting light. When giving direct 9V from the battery they were emitting light. Iguess they arent getting enough current. Should be we using 1K resistors instead of 10K to solve this problem ? or what ?

We have our competition coming soon. please help sir.

The IR LEDs was supply by the 120 ohms resistor R1, the 10K resistor was for the photodiodes,

what do you means by "giving direct 9V from the battery"?

to which part of the circuit?

Giving 9V may kill the MCU Atmega16 which only operate on 5V.

Sir, Atmega mcu is working on 5V only. We gave 9V to the sensor array only with another 180 ohm resistor in series.(By making a 2 pin power supply separtely for the sensor array on main board). So that IR leds could get enough current. And then only the IR leds were emitting light. Idont know if thats the right thing to do. ? Please guide sir.

Offline jkerns

  • Robot Overlord
  • ****
  • Posts: 270
  • Helpful? 12
Re: this in reference to the line follower made by pratheek
« Reply #46 on: August 17, 2013, 10:38:29 AM »
OK - we are talking about providing power to light up LEDs?  You need to determine the appropriate current limiting resistor based on the supply voltage and the LED voltage / current specification.

Let us assume that your LED takes 1.2 volts and has a current rating of 20mA (0.02A)  and you want to run it off your 5 volt regulated supply (note: I am just making these numbers up - use the real numbers for your LED)

We will have the resistor and the LED in series. If we want to have 1.2 Volts across the LED, and we have a 5 volt supply, 5 - 1.2 = 3.8 Volts that have to be dropped across the resistor. If I have to drop 3.8 Volts, at a current flow of 20 mA (from the LED spec) then we can apply Ohms law to find the appropriate resistance.

R = V/I  = 3.8 / 0.02 = 190 Ohms

Pick the next larger standard resistor for your circuit - something like 200 or 220 ohms.

If you have tried hooking up the LED directly to your power supply (either 5 or 9 volts) you need to buy a new LED.
I get paid to play with robots - can't beat that with a stick.

http://www.ltu.edu/engineering/mechanical/bachelor-science-robotics-engineering.asp

Offline bhavyabhatia

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #47 on: August 17, 2013, 11:35:58 PM »
OK - we are talking about providing power to light up LEDs?  You need to determine the appropriate current limiting resistor based on the supply voltage and the LED voltage / current specification.

Let us assume that your LED takes 1.2 volts and has a current rating of 20mA (0.02A)  and you want to run it off your 5 volt regulated supply (note: I am just making these numbers up - use the real numbers for your LED)

We will have the resistor and the LED in series. If we want to have 1.2 Volts across the LED, and we have a 5 volt supply, 5 - 1.2 = 3.8 Volts that have to be dropped across the resistor. If I have to drop 3.8 Volts, at a current flow of 20 mA (from the LED spec) then we can apply Ohms law to find the appropriate resistance.

R = V/I  = 3.8 / 0.02 = 190 Ohms

Pick the next larger standard resistor for your circuit - something like 200 or 220 ohms.

If you have tried hooking up the LED directly to your power supply (either 5 or 9 volts) you need to buy a new LED.

Sir, Iget your point. But in this tuorial given by pratheek sir, (http://www.societyofrobots.com/member_tutorials/node/360)
he had connected 8 IR led's in parellel with a single 120ohm resistor. The supply voltage is 5V.

 I made the same connections with the same resistor value and 5V but my led's didnt light up. ( Forward led voltage=1.5V for a  forward current of 20mA).
Igoogled this problem and it suggested a 8-10ohm resistor for the same.

But pratheek has used a 120ohm resistor. why is it so ?




PS- My IR led's lit up when supplied with 9V instead of 5V. as imentioned before.
« Last Edit: August 18, 2013, 02:24:05 AM by bhavyabhatia »

Offline jkerns

  • Robot Overlord
  • ****
  • Posts: 270
  • Helpful? 12
Re: this in reference to the line follower made by pratheek
« Reply #48 on: August 18, 2013, 08:23:58 AM »
He has 8 LEDs in parallel - at 20 mA per LED that comes to 160 mA total current at 1.5 volts per your spec.

Subtracting 1.5 from 5 we get 3.5 V  3.5V drop at 0.16 amps gives us 22 Ohms. I would use something larger than 22, but 120 Ohms seems to be high.

Now, given that these are infrared LEDs - how do you know that they do or do not light up? 
I get paid to play with robots - can't beat that with a stick.

http://www.ltu.edu/engineering/mechanical/bachelor-science-robotics-engineering.asp

Offline bhavyabhatia

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #49 on: August 18, 2013, 11:50:26 AM »
He has 8 LEDs in parallel - at 20 mA per LED that comes to 160 mA total current at 1.5 volts per your spec.

Subtracting 1.5 from 5 we get 3.5 V  3.5V drop at 0.16 amps gives us 22 Ohms. I would use something larger than 22, but 120 Ohms seems to be high.


Now, given that these are infrared LEDs - how do you know that they do or do not light up?


Yes sir,the resistance used is quite high and that is why my leds wont light up at 5V iguess.
And I viewed them through my digital camera. It was clearly visible in the camera whther they lit up or not.
Iguess ishould try using a lesser resistance with the led's and Ihope they work this time.

Offline johnwarfin

  • Full Member
  • ***
  • Posts: 120
  • Helpful? 3
Re: this in reference to the line follower made by pratheek
« Reply #50 on: August 20, 2013, 02:03:49 PM »
It was clearly visible in the camera whther they lit up or not.

you saw no difference? 120ohms is more than enough to see 8 parallel leds light up @5v. in fact 1kohm will do it. they are probably wired backwards. what voltage do you measure across the leds?
« Last Edit: August 20, 2013, 02:06:07 PM by johnwarfin »

Offline vibhorsehgal

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Re: this in reference to the line follower made by pratheek
« Reply #51 on: September 03, 2013, 11:19:00 AM »
Hello Sir,
I wanted to ask in reference to the LFR made by pratheek. Ibought 8 IR sensor modules ( instead of 8 Ir led pairs.) . The picture of a single module is attached. It has LM358 IC, IR emitter detector pair, 510K resistor , and two 270 ohm resitors,5K and 100ohm preset and a status led.

My doubts are -
!) Pratheek used two LM324(quad op-amp)  to get 8 outputs from the sensors array. So, here can i use 8 LM358 ( dual op-amp) for the same purpose ?
2) How to iconnect 8 of these modules togther in series to obtain the circuit given by pratheek. Or how do i connect them to make them sense the 'black line on a white surface' in general.

I have completed the robot otherwise. Please respond. This is very important for me. Thanks !


Offline johnwarfin

  • Full Member
  • ***
  • Posts: 120
  • Helpful? 3
Re: this in reference to the line follower made by pratheek
« Reply #52 on: September 05, 2013, 09:47:41 AM »
lm358 are same op amps as lm324 just different package. to sense a line all vcc and grounds connect together with the 8 op amp outputs going to different mcu input pins.

ive built a working line follower myself and am familiar with that thread. its a great project and very educational but imo amplifiers are not required for photodetectors. modern sensor pairs like tcrt5000 are more than sensitive enough with no external components. and they cost less than the complicated circuit in that thread.

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Re: this in reference to the line follower made by pratheek
« Reply #53 on: September 05, 2013, 10:13:00 AM »
I would like to second the recommendation for TCRT series (I use the TRCT1000.)

Also, another low-cost way of doing line sensing is to measure discharge time through a photosensor. The Pololu -RC sensors work in this way: http://www.pololu.com/catalog/product/961
You charge the capacitor with the MCU pin being "output," then you let the capacitor discharge through the photodetector, and measure the time it takes. Most MCUs can do this for 8 pins in parallel, so it can be a pretty efficient way of doing it.


Offline johnwarfin

  • Full Member
  • ***
  • Posts: 120
  • Helpful? 3
Re: this in reference to the line follower made by pratheek
« Reply #54 on: September 07, 2013, 11:41:25 AM »
i favor the tcrt5000 at about 1/10th the cost. super easy to find on places like ebay or alibaba. for less than a buck you can put 8 side by side for a great line follow sensor. capable of vinyl tape down to marker or even pencil trace with a variety of backgrounds. and as mentioned they are so sensitive that external amplification is not required. depending on environment it may be possible to get along with a lot fewer than 8 elements too.

 


Get Your Ad Here