Here is a program part which i use for reduce 4 servo's speed :
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
-- basic position all servo's
servo_move(124,1)
servo_move(124,2)
servo_move(129,3)
servo_move(121,4)

 ---------------------------------------------------
var byte old_pos[4] = {124,124,129,121} -- start up beiden in centrum
var byte new_pos[4]
var byte tell =0
-----------------------------------------------------

---------------------------------------------------

procedure set_servo_pack (byte in x) is
var byte flag = 0

  var byte tell = 0
  while flag < 4 loop
    flag = 0
    tell = 0

   for 4 loop
       if old_pos[tell] < new_pos[tell] then
          servo_move((old_pos[tell] + 1),tell+1)
          old_pos[tell] = old_pos[tell] + 1
          delay_1mS(x)
       end if

       if old_pos[tell] > new_pos[tell] then
          servo_move((old_pos[tell] - 1),tell+1)
          old_pos[tell] = old_pos[tell] - 1
          delay_1mS(x)
       end if

      if old_pos[tell] == new_pos[tell] then
         flag = flag + 1
      end if
        tell = tell +1

   end loop
end loop
end procedure

Op zondag 16 januari 2022 om 19:40:07 UTC+1 schreef vasile:

> Impressive! Congrats Hans!
> Perhaps using an encoder to "see" the servo position?  The less expensive 
> it's a japanese amazing potmeter which can be rolled over ( 360 degree 
> movement, 270 degree cursor). I've used such devices, no failure... 
>
> On Sun, Jan 16, 2022 at 4:05 PM hans <[email protected]> wrote:
>
>> I've been using Matt's servo lib for years. The maximum number of servos 
>> in one project was 12.( see https://youtu.be/ujfMYD5zXNU)
>>
>>  
>>
>>   The only problem I had with the lib was that it resets the servos 
>> itself int a fixed basic position and that can conflict with the initial 
>> position in the program. So when you start up, you get a different base 
>> position for a while and that can cause damage.
>>
>> A second thing for me is the speed of movement from one position to 
>> another. I now do this in a procedure within the program.
>>
>> If this sometimes doesn't work out, I'll take another pic, even the small 
>> 12F683 works perfectly.
>>
>> regards
>>
>> Hans
>>
>> Op zondag 16 januari 2022 om 10:35:02 UTC+1 schreef [email protected]:
>>
>>> Hello all,
>>>
>>> I sometimes see projects using servo's using the JAL servo llibraries. I 
>>> have not yet used any servo's but I regularly have a project with LEDs that 
>>> uses PWM (like the servo library). 
>>>
>>> The number of PWM channels is limited on a PIC and it may be that the 
>>> timers on the PIC are needed for something else.
>>>
>>> A solution would be to use a PCA9685. There are modules available to 
>>> control up to 16 servo's (or LEDs) using this module.
>>>
>>> I was wondering if there are JAL users that have plans to use this 
>>> device. If so I might make a library for it in some near future.
>>>
>>> Thanks.
>>>
>>> Kind regards,
>>>
>>> Rob
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jallib" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jallib/5cded4d9-1760-45a0-a8b0-d1f79718afaan%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jallib/5cded4d9-1760-45a0-a8b0-d1f79718afaan%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/c72da766-937f-4e05-9971-7f50f2ac858fn%40googlegroups.com.

Reply via email to