Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
void control(void){while(1){servo(PORTE,2,0);servo(PORTA,5,1400);delay_ms(20);}}
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?
How many servos?Whats the battery type?
Do you have anything else other than servos attached? What battery voltage type is it (6V, 7.2V, etc)?
What does the voltage drop to when the servos are running?
Are there any other changes to the code that you made?
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
you said u will correct the pwm bug in the next source code release. have you corrected it?
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.
you need to add capacitors for the Sharp IR
Well, the only bug was that it was missing code to PWM the LED. It'll work fine for motors.
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
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);}}
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);}}}
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 Got another set of batteries, i get around 7.7 Volts while the total volts is 8. So i guess its not yet dead.
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);}}}
It could still possibly be dead. I really recommend trying out a fully charged battery first.
QuoteIt 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?
How much current does something draw? Datasheets and multimeter.
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?
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! 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!
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.
code, please Wink
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);}}
so, might there be a problem in my code?
NO, even the axon code is not working fine! the same reset happens!..I've have uploaded hyper terminal pic.
Also, make 100% sure you installed *ALL* files from the latest version. One of the old code versions had reset problems.
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.
You forgot to start with the sensors Tongue
Measure the current to each device, something is draining too much power. Also, measure the current coming out of the battery.