Society of Robots - Robot Forum
Mechanics and Construction => Mechanics and Construction => Topic started by: ITZPRABA on December 20, 2010, 06:50:46 AM
-
hi friends...i am using a servo motor (CLOCK WISE/PULSE TRAVELLING 1500 TO 1900usec).. the aim is to stop servo motor when a particular value is sensed by FSR...just am trying to simulate in matlab....please help me../
thanks
-
Send the same width pulse as was sent when sensed by FSR.
-
Hi,
Send the same width pulse as was sent when sensed by FSR.
That will only work if the servo is moving in very small "steps" like this:
ServoWidth=1500
While FSR < chosen value and ServoWidth<1900
Increment ServoWidth, 5 ' add a small step
Output ServoWidth
Read FSR
EndWhile
' The pulse width is now be the value that has to be repeated.
Output ServoWidth ' to stop in that position (this signal needs to be repeated)
Whether it has to be "<" or ">" with the FSR, depends on whether the resistance of it goes up or down in the actual application of course.
If this method isn't used, the servo pulse will be whatever it was sent during it's entire travel.