The lower the voltage the slower the motor.
Are the values displayed on the LCD what you expect, are they in range?
The lower the voltage the slower the motor.
Are the values displayed on the LCD what you expect, are they in range?
Dave
Always wear safety glasses while programming.
Most hobby servo's have a max voltage of 6v. The 450 mA should be OK for testing the servo unloaded.
If you have it turning a platform with large weight/mass then you can easily exceed 1A. A rule of thumb, the closer you get to maxing out the capabilities of your power supply the more noise you will see, especially true with motors, which could lead to glitches. I usually don't go over 50%, if I use a 2A supply for example, I only pull 1A.
Also, decoupling caps are a MUST! use inductors when feeding motors power with custom H-bridges. Use 0.1uf caps to filter out high frequency spikes at the motor and on your power supply to the PIC.
Do a search online for good engineering practice guides for dealing with inductive loads. There are tons of things that will go wrong working with inductive loads, you can solve most of them with well placed caps and careful layout.
Nick
thanks for the code.I am sorry it doesnt work properly..
First I get a error and I fixed code in compiler--------pauseus 20000-((t*10)+(j*10) you forgot a parenthesis
Servo stiil slower than usual mode![]()
When I worked with your code even j values got out of range...Once I saw j as 195...
I might have another power problem like Macgman2000 saidor something about code???
You are right above.I have too many extra loops.I am stuck dont know what to do![]()
Last edited by burak450; - 3rd October 2008 at 21:25.
When I used single servo and used this code.Everything was perfect.Object followed by servo perfecly.(left-right position)
second servo and new code =troubleCode: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 'A/D çevirim sonucu kaç bit olacak DEFINE ADC_CLOCK 3 'Clock kaynağı (3=rc) 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 2000 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 PAUSEUS 20000-(T*10) PULSOUT PORTC.2,T next return end
Now i unplugged a servo ,left-right position servo stiill slower and worked not properly..
Something wrong about codes you and me wrote....
Swap servos? What happens?
Dave
Always wear safety glasses while programming.
OK I have got to ask. What are you moving with your servo? As I said in my previous email, 450 mA is fine for testing UNLOADED servos. Possibly 2 servos. If you are using "standard" size servos then 450 mA is just adequate for turning 1 or 2 without a voltage compression under load. Again.....what are you moving with the servo?
Nick
Bookmarks