go_away

Author Topic: URGENT! axon Keeps Resetting  (Read 5427 times)

0 Members and 1 Guest are viewing this topic.

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
URGENT! axon Keeps Resetting
« on: September 18, 2009, 09:27:08 AM »
hey guys!
im on the verge of completing my bot and suddenly axon keeps resetting when i run an simple code( making 2 servos to run) I checked the voltage at the supply and its around 6.5V. following is my code.

Code: [Select]
void control(void)
{
while(1)
{
servo(PORTE,2,0);
servo(PORTA,5,1400);
delay_ms(20);
}
}

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #1 on: September 18, 2009, 11:47:34 AM »
Do the resets happen with the default photovore code?

What does the Axon output during the reset?

Do the resets occur with you un-attach your sensors and servos?

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #2 on: September 18, 2009, 08:00:30 PM »
Code: [Select]
Do the resets happen with the default photovore code?I didnt try the photovore code, but i tried another code of just reading the sensor values and it worked.

Code: [Select]
What does the Axon output during the reset?the servos rotate for a second or so and then axon resets itself.

Code: [Select]
Do the resets occur with you un-attach your sensors and servos?No, the axon works fine without the servos. what could be the problem? ???

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #3 on: September 18, 2009, 08:26:14 PM »
How many servos?

Whats the battery type?

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #4 on: September 18, 2009, 09:03:25 PM »
How many servos?

Whats the battery type?

2 servos...battery type is NimH 2100mAh.I get around 6.5 volts constantly. I tried adding a delay function between  the servo commands and both the servos worked for a couple of times  and again the problem started! >:( The servos individually work well ie when 1 servo is connected it works but when both the servos are connected the axon resets! ???

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #5 on: September 19, 2009, 06:33:26 AM »
Do you have anything else other than servos attached? What battery voltage type is it (6V, 7.2V, etc)?

Run your run while checking with the multimeter. What does the voltage drop to when the servos are running?

Are there any other changes to the code that you made?

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #6 on: September 19, 2009, 10:36:00 AM »
Code: [Select]
Do you have anything else other than servos attached? What battery voltage type is it (6V, 7.2V, etc)?3 IR sensors. battery voltage is 7.2V

Code: [Select]
What does the voltage drop to when the servos are running?when a single servo is working the voltage drops to 6V. I cant make the 2 servos work simultaneously!

Code: [Select]
Are there any other changes to the code that you made?I removed the while(button_pressed()) function from the main program.

Apart from this admin, i initially decided to use motors for my bot. But had problems with the PWM function in the axon. So i switched to servos. you said u will correct the pwm bug in the next source code release. have you corrected it?

 
 

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #7 on: September 19, 2009, 10:47:53 AM »
Code: [Select]
Do you have anything else other than servos attached? What battery voltage type is it (6V, 7.2V, etc)?3 IR sensors. battery voltage is 7.2V

There are both of your problems.

First, if a 7.2V battery measures 6.5V, that means its a dead battery. You need to recharge it. It still has a good voltage, but it has no juice (current) left.

Second, you need to add capacitors for the Sharp IR:
http://www.societyofrobots.com/axon/axon_FAQ.shtml#sharp_ir_reset

Quote
you said u will correct the pwm bug in the next source code release. have you corrected it?

Well, the only bug was that it was missing code to PWM the LED. It'll work fine for motors. The post before had the code for you to add. :P
(the fix is not yet in the most recent posted version)

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #8 on: September 19, 2009, 11:09:47 AM »
Code: [Select]
First, if a 7.2V battery measures 6.5V, that means its a dead battery. You need to recharge it. It still has a good voltage, but it has no juice (current) left.okay, Im charging my batteries and get back with the results! hope it solves my problem!

Code: [Select]
you need to add capacitors for the Sharp IRIm not using sharp IR sensors, im using IR reflectance sensors from pololu electronics. Do i have to add capacitors for those sensors too?
http://www.pololu.com/catalog/product/958

Code: [Select]
Well, the only bug was that it was missing code to PWM the LED. It'll work fine for motors.I will check that too.
« Last Edit: September 19, 2009, 11:11:24 AM by ukesh »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #9 on: September 19, 2009, 11:27:00 AM »
Code: [Select]
you need to add capacitors for the Sharp IRIm not using sharp IR sensors, im using IR reflectance sensors from pololu electronics. Do i have to add capacitors for those sensors too?
http://www.pololu.com/catalog/product/958

Oh, in that case, nope you won't need capacitors.

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #10 on: September 19, 2009, 12:13:47 PM »
hey admin, I tried compiling this code for trying pwm function. But i still get the error. I've attached the error message as a pic

Code: [Select]
void control(void)
{
while(1)
{
rprintf("Initializing timer2 for PWM\r\n");
PWM_Init_timer2_H6(10);
rprintf("Turning on both PWM channels\r\n");
PWM_timer2_On_H6();
delay_ms(1000);
rprintf("Setting PWM to 1%% duty cycle\r\n");
PWM_timer2_Set_H6(1);
delay_ms(1000);
rprintf("Setting PWM to 50%% duty cycle\r\n");
PWM_timer2_Set_H6(127);
delay_ms(1000);
rprintf("Setting PWM to 99%% duty cycle\r\n");
PWM_timer2_Set_H6(254);
delay_ms(1000);
rprintf("Turning off PWM\r\n");
PWM_timer2_Off_H6();
delay_ms(1000);
}
}

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #11 on: September 19, 2009, 12:20:17 PM »
What code version are you using?

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #12 on: September 19, 2009, 12:29:43 PM »
version 1.09, August release..

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #13 on: September 20, 2009, 04:41:34 AM »
hey admin!
I Got another set of batteries, i get around 7.7 Volts while the total volts is 8. So i guess its not yet dead. Both the servos worked fine, but again i ended up with an problem. My sensors, when reads an black line shows values above 100 & when reads a white line it shows below 20( i checked in hyper terminal). I wrote a program according to that. when the sensor reads the value greater than 150, both the servos must go forward or else the bot must take right turn. when i tested it,  the axon works fine if the sensors reads a white line. If the sensor reads a black line, axons resets and because of it, the bot gets off the line by a certain distance(due to the jerk) and starts taking right turns(since the track is white) below is my source code

Code: [Select]
void control(void)
{
a2dInit();
a2dSetPrescaler(ADC_PRESCALE_DIV32);
a2dSetReference(ADC_REFERENCE_AVCC);
while(1)
{
int l=0, r=0, m=0;
l=a2dConvert8bit(10);
r=a2dConvert8bit(2);
m=a2dConvert8bit(6);
rprintf("%d....%d....%d\n", l, m, r);
if(m>150)
{
servo(PORTE,5,1400);
delay_ms(20);
servo(PORTA,6,0);
delay_ms(20);
}
else
{
servo(PORTA,6,700);
delay_ms(20);
servo(PORTE,5,1400);
delay_ms(20);
}
}
}

what could be possible problem in the setup ???

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #14 on: September 20, 2009, 07:48:26 AM »
hey admin, I tried compiling this code for trying pwm function. But i still get the error. I've attached the error message as a pic

I looked into it, and I think I fixed it. Let me know if it doesn't work.

http://www.societyofrobots.com/axon/downloads/Axon_Source_092009.zip
v1.10 September 20th, 2009
when timer640.c was rewritten, it broke all PWM code
-added pwm.c to SoR_Utils.h
-added pwm.c and pwm.h
(compiles, and only used working old code, so assumed to work - but not tested)

I Got another set of batteries, i get around 7.7 Volts while the total volts is 8. So i guess its not yet dead.

It could still possibly be dead. I really recommend trying out a fully charged battery first.


Also, try this code instead:

Code: [Select]
void control(void)
{
a2dInit();
a2dSetPrescaler(ADC_PRESCALE_DIV32);
a2dSetReference(ADC_REFERENCE_AVCC);
while(1)
{
int l=0, r=0, m=0;
l=a2dConvert8bit(10);
r=a2dConvert8bit(2);
m=a2dConvert8bit(6);
rprintf("%d....%d....%d\n", l, m, r);
if(m>150)
{
servo(PORTE,5,1100);
servo(PORTA,6,300);
delay_ms(30);
}
else
{
servo(PORTA,6,700);
servo(PORTE,5,1100);
delay_ms(30);
}
}
}

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #15 on: September 20, 2009, 08:22:07 AM »
Quote
It could still possibly be dead. I really recommend trying out a fully charged battery first.
okay il charge the batteries and get back with you admin!

If i want to run both the servos At full load conditions & three sensors for at least a minimum of 20 mins continuously, what will be the required specifications of the battery ie the current and voltage ratings?



Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #16 on: September 20, 2009, 08:28:39 AM »
Quote
It could still possibly be dead. I really recommend trying out a fully charged battery first.

okay il charge the batteries and get back with you admin!

If i want to run both the servos At full load conditions & three sensors for at least a minimum of 20 mins continuously, what will be the required specifications of the battery ie the current and voltage ratings?

http://www.societyofrobots.com/mechanics_energy.shtml
http://www.societyofrobots.com/batteries.shtml

Determine average current draw. Multiply that by 1 hour. Divide by 60min/20min = 3 (for 20 minutes). Thats the number of mAh that your battery will need.

For example, you determined that all of your sensors and servos draw an average 2A (or 2000mA). For one hour, you'll need 2000mAh. So for 20 minutes, thats 2000/3 = 667mAh.

How much current does something draw? Datasheets and multimeter.

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #17 on: September 20, 2009, 08:40:14 AM »
Quote
How much current does something draw? Datasheets and multimeter.


I checked the datasheet for the servos from where i bought, but i couldn't find the current draw specification.
http://robokits.co.in/shop/index.php?main_page=product_info&cPath=2_5&products_id=187

And how do i check the current draw using a multimeter? (sorry for the noobishness! :-[)

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #19 on: September 20, 2009, 09:49:36 AM »
okay admin!
I got 6 1.2V, 2100mah Nimh batteries(fully charged) connected in series and i get an output voltage of 7.8V. is this correct? logically i should get only 7.2V rite?

« Last Edit: September 20, 2009, 08:13:53 PM by ukesh »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #20 on: September 20, 2009, 10:36:48 AM »
I got 6 1.2V, 2100mah Nimh batteries(fully charged) connected in series and i get an output voltage of 7.8V. is this correct? logically i should get only 7.2V rite?
Fully charged, it should be higher. This sounds about right.

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #21 on: September 20, 2009, 08:17:15 PM »
admin, I used the fully charged batteries which i mentioned above, But NO improvements what so ever. The axon keeps resetting! Actually, what are the possibilities for resetting? Is there some error in the code that causes this problem? Or is it an hardware issue? The servos run fine until the sensor reads an value and if it reads axon resets! Its like an hopping bot! :P rather than an line following bot >:(

Regarding the pwm, it compiles for only H6 port when i try to change the port, i get the same error! ???
« Last Edit: September 21, 2009, 02:07:10 AM by ukesh »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #22 on: September 21, 2009, 06:40:10 AM »
admin, I used the fully charged batteries which i mentioned above, But NO improvements what so ever. The axon keeps resetting! Actually, what are the possibilities for resetting? Is there some error in the code that causes this problem? Or is it an hardware issue? The servos run fine until the sensor reads an value and if it reads axon resets! Its like an hopping bot! :P rather than an line following bot >:(
Is the regulator warm? Are the servos warm when you run them?

Try using the Axon code unmodified. Does it work fine? Its possible to cause a reset in software.


Quote
Regarding the pwm, it compiles for only H6 port when i try to change the port, i get the same error! ???
code, please ;)

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #23 on: September 21, 2009, 08:30:59 AM »
Quote
Is the regulator warm? Are the servos warm when you run them?
the servos are not warm. But, the regulator seems to be slightly warm.
Quote
Try using the Axon code unmodified. Does it work fine?
i will try it soon..
Quote
Its possible to cause a reset in software.
so, might there be a problem in my code?
Quote
code, please Wink
Code: [Select]
void control(void)
{
while(1)
{
rprintf("Initializing timer2 for PWM\r\n");
PWM_Init_timer2_H3(10);
rprintf("Turning on both PWM channels\r\n");
PWM_timer2_On_H3();
delay_ms(1000);
rprintf("Setting PWM to 1%% duty cycle\r\n");
PWM_timer2_Set_H3(1);
delay_ms(1000);
rprintf("Setting PWM to 50%% duty cycle\r\n");
PWM_timer2_Set_H3(127);
delay_ms(1000);
rprintf("Setting PWM to 99%% duty cycle\r\n");
PWM_timer2_Set_H3(254);
delay_ms(1000);
rprintf("Turning off PWM\r\n");
PWM_timer2_Off_H3();
delay_ms(1000);
}
}
« Last Edit: September 21, 2009, 08:38:27 AM by ukesh »

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #24 on: September 21, 2009, 09:12:17 AM »
Quote
Try using the Axon code unmodified. Does it work fine?
NO, even the axon code is not working fine! the same reset happens!..I've have uploaded hyper terminal pic.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #25 on: September 21, 2009, 09:16:48 AM »
Quote
so, might there be a problem in my code?

Yea, you're trying to do PWM with the wrong timers. You can only use the functions here:
http://www.societyofrobots.com/axon/axon_function_list.shtml#pwm

Basically different pins use different timers for PWM.

Quote
NO, even the axon code is not working fine! the same reset happens!..I've have uploaded hyper terminal pic.

Disconnect everything from your Axon, then run the code. Slowly add components, starting with the sensors, until it starts resetting. You should also measure current of each sensor, perhaps one is shorting or something.

Also, make 100% sure you installed *ALL* files from the latest version. One of the old code versions had reset problems.
« Last Edit: September 21, 2009, 09:19:03 AM by Admin »

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #26 on: September 21, 2009, 09:58:28 AM »
Quote
Also, make 100% sure you installed *ALL* files from the latest version. One of the old code versions had reset problems.
I'm 100% sure that im using the latest release of the source code.

Quote
Disconnect everything from your Axon, then run the code. Slowly add components, starting with the sensors, until it starts resetting. You should also measure current of each sensor, perhaps one is shorting or something.

I disconnected everything from the axon and i ran the code, axon didnt reset. frst i added 1 servo and it woked fine. If i add the 2nd servo slowly it resets, but if i add the 2nd servo fastly it works. But, when i add the sensor it resets!

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #27 on: September 21, 2009, 10:10:22 AM »
You forgot to start with the sensors :P

Measure the current to each device, something is draining too much power. Also, measure the current coming out of the battery.

Offline ukeshTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Helpful? 0
Re: URGENT! axon Keeps Resetting
« Reply #28 on: September 21, 2009, 10:52:47 AM »
Quote
You forgot to start with the sensors Tongue
oops!, Sorry

this time i started with the sensors first. I connected the 1st sensor, axon worked fine, next i connected the 2nd sensor, axon worked fine. When i connected the 1st servo it ran for some time and this time axon resetted! The next time 1st servo worked, but when i connected the 2nd servo axon immediately resetted! So, I guess there is something wrong with the servos!

Quote
Measure the current to each device, something is draining too much power. Also, measure the current coming out of the battery.
hey admin, I googled myself how to measure the current. But i couldnt understand clearly! :-[ I'm scared whether i will damage the axon or my components while trying to measure the current. :'( Can you please help me out measuring the current with the components i have..just once?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,632
  • Helpful? 169
    • Society of Robots
Re: URGENT! axon Keeps Resetting
« Reply #29 on: September 21, 2009, 11:19:54 AM »
Tell me what you are going to try, and we'll verify its safe before you do it.

 


Get Your Ad Here

data_list