### Author Topic: some algorithms  (Read 2268 times)

0 Members and 1 Guest are viewing this topic.

#### andreahmed

• Jr. Member
• Posts: 37
• Helpful? 0
##### some algorithms
« on: July 09, 2007, 09:52:46 PM »
hi , first i wanna know how to use the encoders for positional control , i read the tutorial here , and the pid one , i just want use it to make the turns like 90Degrees , 180 ..etc
is this pseudo code correct ?

while ( desired_position !=actual_position)
{

error = desired_position - actual_position
error = error * KP  // proportional control
pwm ( error) // pwm the motor to the desired position
}

also i were pariticipated in a contest Robocon
http://www.vtv.org.vn/robocon/2007en/en/index.asp?menuid=838&parent_menuid=838&fuseaction=3&articleid=2214

some guys said they were using 8 Sensors for line following , i wish ya write a tutorial about something like that , like how we can follow a line in a good speed also how to count the crossing lines and how to do the turns like 90 and 180 in something like the game field showing there , can u write some algorithms plz ?

#### andreahmed

• Jr. Member
• Posts: 37
• Helpful? 0
##### Re: some algorithms
« Reply #1 on: July 10, 2007, 07:43:42 AM »
any idea ?

#### Admin

• Administrator
• Supreme Robot
• Posts: 11,680
• Helpful? 172
##### Re: some algorithms
« Reply #2 on: July 11, 2007, 11:19:32 AM »
Quote
some guys said they were using 8 Sensors for line following , i wish ya write a tutorial about something like that , like how we can follow a line in a good speed also how to count the crossing lines and how to do the turns like 90 and 180 in something like the game field showing there , can u write some algorithms plz ?

You mean like this?
http://www.societyofrobots.com/competitions_mobot.shtml

Get Your Ad Here