PDA

View Full Version : help pulsout command?



ajak
- 7th September 2008, 06:26
<code>
portb = 0
start:

pulsout portb.0,120
pause 1000
pulsout portb.1,147
pause 1000
pulsout portb.0,150
pause 1000
pulsout portb.1,140
pause 1000
</code>

when i try this it works, but when i add another pulsout command and pause, it do not do what i want. Is this affects the clock cycle? i used a 4MHz xt, and a pic16f84a. anyone knows this?

skimask
- 7th September 2008, 06:38
What other pulsout and pause would that be?
Show what doesn't work...

ajak
- 7th September 2008, 06:53
when i try 8 consecutive pulsout and pause command, the servomotor react inaccurately, it turns crazy, i would like to know if it affects the clock cyle, because my oscillator is 4 MHz XT, so i know that the clock cycle is divided into four. Is it possible to do this?
<code>
pulsout portb.0,175
pause 200
pulsout portb.1,170
pause 300
pulsout portb.2,175
pause 300
pulsout portb.3,130
pause 300
pulsout portb.6,150
pause 300
pulsout portb.7,150
pause 300
pulsout portb.4,150
pause 300
pulsout portb.5,150
pause 300

</code>

how can i put the servo back to the first position, but not getting the servo confused?

skimask
- 7th September 2008, 06:55
I know that's not the whole program...
When are you going to help us help you?
I wouldn't think that your code is some sort of state secret, is it?

skimask
- 7th September 2008, 07:00
And it looks to me like you're trying to drive more than one servo...8 of them?

Is your power supply up to the task?

Are you up to the task?

You should probably know (if you've done any research on the subject of driving servo's) that servo's require a multiple updates per second to hold their position without going all over the place, usually about 50 timers per second, some more, most less per second will do.

You code...8 servo pulses, say 2.5ms maximum, totals at 20ms.
At most, you can go thru that loop 50 times per second.

You've got all those extra pauses in there, which brings the total update rate per second down to less than one update per second...

Have you thought about getting rid of those pauses?

ajak
- 7th September 2008, 07:00
Yes this is not the whole program. Im just starting to know how to make the servomotor move. i would like to ask help from you if you can help me? Im just a begginner. Please kindly help me.

skimask
- 7th September 2008, 07:01
Yes this is not the whole program. Im just starting to know how to make the servomotor move. i would like to ask help from you if you can help me? Im just a begginner. Please kindly help me.

www.google.com

Search on 'SERVO'

www.picbasic.co.uk/forum

Search on 'SERVO'

www.any-search-engine-out-there.com

Search on 'SERVO'

ajak
- 7th September 2008, 07:04
yes i try to get rid of the pauses but when i test it, id like to make a bipedal robot, and yes i would like to control 8 servo, 4 servos for each leg, is 20 ms pause is ok for changing pulse position on every servo?

skimask
- 7th September 2008, 07:11
Does not compute...Does not compute...Does not compute...
Danger...Danger...Danger Will Robinson...Danger Will Robinson...