Program problems - RC Linear Servo speed or step controling
Ryan1234
Posts: 23
Hi I am having issues trying to control this servo (Frigelli L12-100-210-12-R, http://www.firgelli.com/Uploads/L12_datasheet.pdf), it seems to work fine but i cannot control the speed. Adjusting the RA=1 to 63 dose not seem to do anything. I want my program to transition slower between the different positions of the linear servo.
Note: I am using the basic stamp and the parallax servo controler.
Please see example graph of what i am trying to do with position. And Servo info. Is there a way that i can adjust the speed a different way or add some kind of step feature so the serve changes position gradually.
Can someone please help!!!
' {$STAMP BS2}
' {$PBASIC 2.5}
CH VAR Byte
PW VAR Word
RA VAR Byte
X VAR Byte
BUFF VAR Byte(3)
SDAT CON 15
BAUD CON 396
COL VAR Nib
ROW VAR Nib
INIT:
RA =1
CH = 15
COL = 0
DEBUG "
ENGINE, WARM UP- 12-17-12 ---"
'PW = 780: GOSUB WRSERVO1 'OC IDLE - 30 SEC
'PW = 760: GOSUB WRSERVO2 'F8 5-7 MPH WARM - 60 SEC 3200
'PW = 750: GOSUB WRSERVO1 'EE 15-20 MPH WARM - 30 SEC 4400
'PW = 740: GOSUB WRSERVO1 'E4 27-35 MPH WARM - 30 SEC 5300
'PW = 760: GOSUB WRIDEL1 'F8 5-22 MPH WARM - 15 SEC 4100
'PW = 780: GOSUB WRIDEL1 'OC IDLE - 15 SEC
DEBUG CLS
DEBUG"
ENGINE, WARM UP- 12-17-12 ---"
DYNOCYCLE1: 'ENGINE DYNO CYCLE
DEBUG "
ENGINE, WARM UP - COMPLETE ---"
DEBUG "
BEGIN ENGINE CYCLE ---"
DEBUG "
ENGINE, WATER TANK 45 min Cycle Test- 12-17-12 ---"
DO WHILE (COL < 10)
FOR ROW = 0 TO 15
IF (ROW > 9) THEN EXIT
DEBUG CRSRXY, (COL * 8), ROW,
DEC COL, "/", DEC ROW, CR
NEXT
COL = COL + 1
IF (COL = 5) THEN GOSUB ENGSTOP '4 COMPLETE CYCLE AND STOP
PW = 780: GOSUB WRIDEL1 'OC IDLE - 15 SEC 1400
PW = 760: GOSUB WRIDEL1 'F8 5-10 MPH WARM - 15 SEC 3000
PW = 730: GOSUB WRSERVO1 'DA 39-40 MPH WARM - 20 SEC 5700
PW = 758: GOSUB WRIDEL1 'F6 19-21 MPH WARM - 15 SEC 4400
PW = 730: GOSUB WRSERVO1 'DA 39-40 MPH WARM - 30 SEC 5700
PW = 780: GOSUB WRIDEL1 'OC IDLE - 15 SEC 1400
DEBUG CLS
DEBUG "
45 min Cycle Test- 12-17-12
"
LOOP
ENGSTOP: 'ENGINE STOP
PW = 780:
SEROUT SDAT, BAUD+$8000,["!SC", CH, RA, PW.LOWBYTE, PW.HIGHBYTE, CR]
DEBUG CLS, "
45 min Cycle Test- 12-17-12
"
DEBUG "-- CYCLE COMPLETE -- ", DEC COL (0), "-- ENGINE STOP"
END
WRIDEL1: 'IDEL 15 SECONDS
SEROUT SDAT, BAUD+$8000,["!SC", CH, RA, PW.LOWBYTE, PW.HIGHBYTE, CR]
FOR X = 0 TO 6
PAUSE 1800
SEROUT SDAT, BAUD+$8000,["!SCRSP", CH, CR]
SERIN SDAT, BAUD, 1000, INIT,[STR BUFF\3]
DEBUG "CURRENT CYCLE -", DEC COL(0), "- IDEL 1-", DEC BUFF(1), " LOCATION - ", HEX2 BUFF(2), CR
NEXT
RETURN
WRSERVO1: 'FASTEST SERVO 20 SECONDS
SEROUT SDAT, BAUD+$8000,["!SC", CH, RA, PW.LOWBYTE, PW.HIGHBYTE, CR]
FOR X = 0 TO 6
PAUSE 3800
SEROUT SDAT, BAUD+$8000,["!SCRSP", CH, CR]
SERIN SDAT, BAUD, 1000, INIT,[STR BUFF\3]
DEBUG "CURRENT CYCLE -", DEC COL(0), "- SERVO 1-", DEC BUFF(1), " LOCATION - ", HEX2 BUFF(2), CR
NEXT
RETURN
Note: I am using the basic stamp and the parallax servo controler.
Please see example graph of what i am trying to do with position. And Servo info. Is there a way that i can adjust the speed a different way or add some kind of step feature so the serve changes position gradually.
Can someone please help!!!
' {$STAMP BS2}
' {$PBASIC 2.5}
CH VAR Byte
PW VAR Word
RA VAR Byte
X VAR Byte
BUFF VAR Byte(3)
SDAT CON 15
BAUD CON 396
COL VAR Nib
ROW VAR Nib
INIT:
RA =1
CH = 15
COL = 0
DEBUG "
ENGINE, WARM UP- 12-17-12 ---"
'PW = 780: GOSUB WRSERVO1 'OC IDLE - 30 SEC
'PW = 760: GOSUB WRSERVO2 'F8 5-7 MPH WARM - 60 SEC 3200
'PW = 750: GOSUB WRSERVO1 'EE 15-20 MPH WARM - 30 SEC 4400
'PW = 740: GOSUB WRSERVO1 'E4 27-35 MPH WARM - 30 SEC 5300
'PW = 760: GOSUB WRIDEL1 'F8 5-22 MPH WARM - 15 SEC 4100
'PW = 780: GOSUB WRIDEL1 'OC IDLE - 15 SEC
DEBUG CLS
DEBUG"
ENGINE, WARM UP- 12-17-12 ---"
DYNOCYCLE1: 'ENGINE DYNO CYCLE
DEBUG "
ENGINE, WARM UP - COMPLETE ---"
DEBUG "
BEGIN ENGINE CYCLE ---"
DEBUG "
ENGINE, WATER TANK 45 min Cycle Test- 12-17-12 ---"
DO WHILE (COL < 10)
FOR ROW = 0 TO 15
IF (ROW > 9) THEN EXIT
DEBUG CRSRXY, (COL * 8), ROW,
DEC COL, "/", DEC ROW, CR
NEXT
COL = COL + 1
IF (COL = 5) THEN GOSUB ENGSTOP '4 COMPLETE CYCLE AND STOP
PW = 780: GOSUB WRIDEL1 'OC IDLE - 15 SEC 1400
PW = 760: GOSUB WRIDEL1 'F8 5-10 MPH WARM - 15 SEC 3000
PW = 730: GOSUB WRSERVO1 'DA 39-40 MPH WARM - 20 SEC 5700
PW = 758: GOSUB WRIDEL1 'F6 19-21 MPH WARM - 15 SEC 4400
PW = 730: GOSUB WRSERVO1 'DA 39-40 MPH WARM - 30 SEC 5700
PW = 780: GOSUB WRIDEL1 'OC IDLE - 15 SEC 1400
DEBUG CLS
DEBUG "
45 min Cycle Test- 12-17-12
"
LOOP
ENGSTOP: 'ENGINE STOP
PW = 780:
SEROUT SDAT, BAUD+$8000,["!SC", CH, RA, PW.LOWBYTE, PW.HIGHBYTE, CR]
DEBUG CLS, "
45 min Cycle Test- 12-17-12
"
DEBUG "-- CYCLE COMPLETE -- ", DEC COL (0), "-- ENGINE STOP"
END
WRIDEL1: 'IDEL 15 SECONDS
SEROUT SDAT, BAUD+$8000,["!SC", CH, RA, PW.LOWBYTE, PW.HIGHBYTE, CR]
FOR X = 0 TO 6
PAUSE 1800
SEROUT SDAT, BAUD+$8000,["!SCRSP", CH, CR]
SERIN SDAT, BAUD, 1000, INIT,[STR BUFF\3]
DEBUG "CURRENT CYCLE -", DEC COL(0), "- IDEL 1-", DEC BUFF(1), " LOCATION - ", HEX2 BUFF(2), CR
NEXT
RETURN
WRSERVO1: 'FASTEST SERVO 20 SECONDS
SEROUT SDAT, BAUD+$8000,["!SC", CH, RA, PW.LOWBYTE, PW.HIGHBYTE, CR]
FOR X = 0 TO 6
PAUSE 3800
SEROUT SDAT, BAUD+$8000,["!SCRSP", CH, CR]
SERIN SDAT, BAUD, 1000, INIT,[STR BUFF\3]
DEBUG "CURRENT CYCLE -", DEC COL(0), "- SERVO 1-", DEC BUFF(1), " LOCATION - ", HEX2 BUFF(2), CR
NEXT
RETURN
Comments
Is there a good way to slowly step to the next position, like a step delay or something. i think it works with a redular servo. so i think i have to find another way to get this linear servo to work the way i want.
Normally, the servo controller just sends the new position to the servo when you change the servo's position and the servo moves as quickly as it can to the new position. With higher ramp values, the servo controller breaks up the difference between the two positions into segments and outputs successive segments to the servo. The servo still moves as quickly as possible from one position to another, but these are closer together and, with enough segments, the motion seems slower and smoother.
Is there any reason a servo could be used in place of the actuator?