regarding the sudden change in the movement of the robot

Status
Not open for further replies.

srini.pes

Member level 3
Joined
May 28, 2010
Messages
61
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Location
NIT calicut
Visit site
Activity points
1,725
Hi to all.,
We have designed one bipedal robo using LPC controller., it was working fine.
Now, we want to complete the same task using the micro controller (ATMEGA32).,
Our task is like to walk the robo in a straight path (Forward direction).

After few steps, it was not moving and motor movement became too slow.

After some time it started going backwards.......

Is there any problem with the infinite loop we mentioned like as follows,
------------
While(1)


straightpath()

-------------------

Can you guess what the problem was ??

We have cross checked our code, we didn't find any issues with it.

Please help us...

Thanking you

SRINI
 

1.

An infinite loop may work on one platform, but then get quirky on another platform.

2.

Do you use a global variable as your variable which defines forward motion? Does it get changed by any routines you have overlooked so far?

3.

Does your 'straightpath' routine create a new set of variables when it is called? Do you set these to a default value immediately, or could they have a random value when created?

4.

Are you adding an unsigned variable to a signed variable? Subtracting it? Vice-versa? Etc.

Things like that could cause your variable which defines forward motion to decrease, until it goes negative.
 

Hi.,
We found that the problem was the synchronization between the two controllers.
The clock was provided by the internal RC oscillator instead of a external crystal oscillator.
Will the synchronization problem be solved by using the common crystal oscillators for both micro controllers ?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…