Hi, Burak
We haven't solved the power problem ...
so, I ask the question once more : Which is your testboard ???
Alain
Hi, Burak
We haven't solved the power problem ...
so, I ask the question once more : Which is your testboard ???
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Macgman2000 wants my code...
I wrote a new code to protect values which makes out of range.
Code:DEFINE LCD_DREG PORTB DEFINE LCD_DBIT 0 DEFINE LCD_RSREG PORTB DEFINE LCD_RSBIT 4 DEFINE LCD_EREG PORTB DEFINE LCD_EBIT 5 DEFINE LCD_BITS 4 DEFINE LCD_LINES 2 DEFINE OSC 4 DEFINE ADC_BITS 8 DEFINE ADC_CLOCK 3 DEFINE ADC_SAMPLEUS 100 SYMBOL F=PORTA.0 SYMBOL G=PORTA.1 alta var byte usta var byte altb var byte ustb var byte ADCON1=2 TRISA=3 TRISB=0 PORTB=0 TRISC=0 LCDOUT $FE,1 pause 4000 adcin 0,ALTa ADCin 1,usta t var byte i var byte T=150 yap: adcin 0,altb ADCin 1,ustb if ((((usta+10)*100)/(ustb+10)))>130 and (not (t>194)) then T=T+15 endif if (((alta*100)/altb))>130 AND (not (t<51)) then T=T-15 endif gosub motor LCDOUT $fe,2,#usta," ",#ustb," ",#altA," ",#altb lcdOUT $fe,$C0,#T goto yap motor: for i=0 to 25 PULSOUT PORTC.2,T PAUSEUS 20000-(T*10) next return end
I am using breadboards.A minute ago i tried to connect two parallel power supply.Servo didnt reset MCU.I was glad but sometimes when i turned power on ,servo turned full left sometimes didnt.I think my servos are crazy.BTW I connected a capacitor.
I have an idea.Can this error(full left error) occur because of my code that i wrote.too many PAUSEUS may make this error.Should I try DUTYCYLE or PWM codes???
Or Is there any power problem???
If you have an oscilloscope look at your control pulses from the PIC to the servo as it moves. If you see that the wave form (1~2ms pulse) is wiggling around or changing amplitude then you have a power supply issue. Do as I suggested above, get a 9v power supply (AC/DC) and use TWO 7805 regulators in parallel for the servo ONLY. At the servo use 470uF across power and ground. Look at the scope again and make sure you see a "cleaned" up signal while servo is in motion.
Nick
I tried everything which is suggested.I changed code and put PAUSEUS before pulsout.Something wrong ,I got same error I decided to change power supply.That can cause this problem.
I hope it will solve my problem...
I will use two servos...(one for left-right one for up-down).I wrote the code just for left-right.I will make servos TWO if I am successful left-right position...
Why did you say two parallel 7805? One for pic and one for servo?
How many 7805 regulators should I use?
Last edited by burak450; - 3rd October 2008 at 02:38.
Wow...not reading very well these days...
Doubling up on servo's will only compound your power supply quality problem.
Why did he say 2 parallel 7805's? If you'd re-read post #39, you'll see why.
And while you're at it, you might want to actually READ all of the advice given to you up to this point. Lots of advice being given repeatedly...seems like not a lot of it taken.
Hi,
Just a little Typo ...
LOW Portx.y
has to be placed before
PULSOUT ... and not Pulsin.
Everyone had understood ... of course !
Alain
PS:
are you sure ???
PAUSEUS before pulsout
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
In the middle of that math mess? I don't think it's a good spot for it...but that's just me...I wrote a new code to protect values which makes out of range.
Code:DEFINE LCD_DREG PORTB DEFINE LCD_DBIT 0 DEFINE LCD_RSREG PORTB DEFINE LCD_RSBIT 4 DEFINE LCD_EREG PORTB DEFINE LCD_EBIT 5 DEFINE LCD_BITS 4 DEFINE LCD_LINES 2 DEFINE OSC 4 DEFINE ADC_BITS 8 DEFINE ADC_CLOCK 3 DEFINE ADC_SAMPLEUS 100 f var porta.0 : g var porta.1 : alta var byte : usta var byte : altb var byte ustb var byte : t var byte : i var byt e: adcon1=2 : trisa=3 : trisb=0 portb=0 : trisc=0 : pause 1000 : lcdout $fe,1 : pause 4000 adcin 0,ALTa : ADCin 1,usta : t=150 pulsout portc.2,t 'initial servo kick to center yap: adcin 0,altb : adcin 1,ustb if ((((usta+10)*100)/(ustb+10)))>130 and (not (t>194)) then T=T+15 if (((alta*100)/altb))>130 AND (not (t<51)) then T=T-15 'bounds checking... if t < 100 then t=100 if t > 200 then t=200 'bounds checking 'if 100 isn't low enough, change it, if 200 isn't high enough, change it gosub motor : lcdout $fe,2,#usta," ",#ustb," ",#altA," ",#altb, $fe,$C0,#T goto yap motor: for i=0 to 25 : PULSOUT PORTC.2,T : PAUSEUS 20000-(T*10) : next i return end
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hi, Ski
Because you connect thing properly !!! servo before mains ...
just try to plug and unplug your servo with power on the driving circuit ...
you'll get an inverted pulse !!! not every time ... but once is enough for the crash ...
I' ve been caught some years ago ... servos do not like that at all !!!
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks