Hexapod Futaba servos! Left right have switched! [FIXED!]

Tried it before. The fibers do a great job of soaking up the coherent light. The fiber just glows in about a 1" circle where it’s trying to penetrate. No can do it. :frowning:

I tried changing the pulse widths but it did exactly the same as before. wiggeling his rear left tibia. only now towards the body instead of from the body. BUT THEN… he bows his legs (all of them) under the body.

By Jove, I think he’s got it!

Sure would like to know how S3003 servos can handle the Phoenix! Are the batteries on board?

Actually, I’d think 4 legs down instead of 3 for attack shouldn’t be any worse then 3 legs down for the gait.

Good job!

Alan KM6VV

Batteries are not on there yet. I have spend my last money to finish the bot. Have to wait a bit for the battery.

I think the biggest problem with the futaba’s is that thewy’re quite heavy. Most of the bodyweight is from the servo’s

I still can’t get the code to work.

I can’t find the problem either. I tried to change the values. But that didn’t change anything except the direction. Still only one tibia that moves. Can one of you have a look at my code?

[code]IF (DualShock(2).bit5 = 0) and LastButton(1).bit5 THEN ;Circle Button test
BodyPosY = 0
ENDIF

IF (DualShock(2).bit6 = 0) and LastButton(1).bit6 THEN	;Cross Button Attack Modus
		serout ssc_out,SSC_BAUTE, "#",RMCoxaPin,1800,RMFemurPin,1700,RMTibiaPin,1700,LMCoxaPin,1200,LMFemurPin,1300,LMTibiaPin,1300/288,13] 
	pause 288
		serout ssc_out,SSC_BAUTE,"#",RMFemurPin,1500,RMTibiaPin,1500,LMFemurPin,1500, |
			LMTibiaPin,"P1500T288",13]
		pause 288
		serout ssc_out,SSC_BAUTE,"#",RRFemurPin,"P1800#",RRTibiaPin,"P1800#",RMFemurPin,"P1400#", |
			RMTibiaPin,"P1400#",RFCoxaPin,"P1800#",RFFemurPin,"P2100#",LRFemurPin,"P1200#", |
			LRTibiaPin,"P1200#",LMFemurPin,"P1600#",LMTibiaPin,"P1600#",LFCoxaPin,"P1200#", |
			LFFemurPin,"P900T288",13]
		pause 288
		for Index = 1 to 10
			serout ssc_out,SSC_BAUTE,"#",RFFemurPin,"P2000#",RFTibiaPin,"P1600#",LFFemurPin,"P900#", |
				LFTibiaPin,"P1600T144",13]
			pause 144
			serout ssc_out,SSC_BAUTE,"#",RFFemurPin,"P2100#",RFTibiaPin,"P1400#",LFFemurPin,"P1000#", |
				LFTibiapin,"P1400T144",13]
			pause 144
		next
			serout ssc_out,SSC_BAUTE,"#",RFCoxaPin,"P1500#",RFTibiaPin,"P1500#",LFCoxapin,"P1500#", |
			LFFemurPin,"P900#",LFTibiaPin,"P1500T288",13]
		pause 288
			serout ssc_out,SSC_BAUTE,"#",RRFemurPin,"P1500#",RRTibiaPin,"P1500#",RMFEmurPin,"P1500#", |
			RMTibiaPin,"P1500#",RFFemurPin,"P1500#",LMFemurPin,"P1500#",LMTibiaPin,"P1500#", |
			LFFemurPin,"P1500#",LRFemurPin,"P1500#",LRTibiaPin,"P1500T576",13]
		pause 576
			serout ssc_out,SSC_BAUTE,"#",RMCoxaPin,"P1500#",RMFemurPin,"P1700#",RMTibiaPin,"P1700#", |
			LMCoxaPin,"P1500#",LMFemurPin,"P1300#",LMTibiaPin,"P1300T288",13]
		pause 288
			serout ssc_out,SSC_BAUTE,"#",RMFemurPin,"P1500#",RMTibiaPin,"P1500#",LMFemurPin,"P1500#", |
			LMTibiaPin,"P1500T288",13]
		pause 288
			sound P9,[100\4000, 50\8000]
 			sound P9,[250\2000]
 ENDIF			[/code]

Also i want to move the head and tail. Like the A-pod. Is there a script for that? Or does this do the trick?:

[code];[PIN NUMBERS]
#IF SSC_LM_SETUP ;Connector to the front

; Deck Pin
DeckP Con P31 ;Deck Panning servo : pin 31
DeckTilt Con P28 ;Additional Tilt servo for 180° Deck

RRCoxaPin con P16 ;Rear Right leg Hip Horizontal
RRFemurPin con P17 ;Rear Right leg Hip Vertical
RRTibiaPin con P18 ;Rear Right leg Knee… etc.[/code]

And then this further on:

[code];[Balance]
BalanceMode var bit
TravelHeightY var sword
TotalTransX var sword
TotalTransZ var sword
TotalTransY var sword
TotalYbal var sword
TotalXBal var sword
TotalZBal var sword
TotalY var sword ;Total Y distance between the center of the body and the feet

;[HEAD]
Deck_Pulse var Word
DeckTilt_Pulse var Word

;[gait]
GaitType var byte ;Gait type
NomGaitSpeed var byte ;Nominal speed of the gait
[/code]

I still haven’t got a working code for the attack mode. This is wat i have until now. But nothing moves. When i use “P1700#” instead of P1700# it only moves the left rear tibia. (wiggles up and down)

Here is my code…

[code]IF (DualShock(2).bit6 = 0) and LastButton(1).bit6 THEN ;Cross Button test

			serout s_out, i9600, "SCRIPT START", 13] ;DEBUG SCRIPT START
			
			;Attack posture
		serout ssc_out,SSC_BAUTE,[RMCOXAPIN,P1200#,RMFEMURPIN,P1300#,RMTIBIAPIN,P1300#, |
			LMCOXAPIN,P1800#,LMFEMURPIN,P1700#,LMTIBIAPIN,P1700#>288,13]
			
			serout s_out, i9600, "SCRIPT PART 2", 13] ;DEBUG 2
			
		pause 288
		serout ssc_out,SSC_BAUTE,"#",RMCOXAPIN,P1500#,RMTIBIAPIN,P1500#,LMFEMURPIN,P1500#, |
			LMTIBIAPIN,P1500#>288,13]
			
			serout s_out, i9600, "SCRIPT PART 3", 13] ;DEBUG 3
			
		pause 288
		serout ssc_out,SSC_BAUTE,"#",RRFEMURPIN,P1800#,RRTIBIAPIN,P1800#,RMFEMURPIN,P1400#, |
			RMTIBIAPIN,P1400#,RFCOXAPIN,P1800#,RFFEMURPIN,P2100#,LRFEMURPIN,P1200#, |
			LRTIBIAPIN,P1200#,LMFEMURPIN,P1600#,LMTIBIAPIN,P1600#,LFCOXAPIN,P1200#, |
			LFFEMURPIN,P900#>288,13]
			
			serout s_out, i9600, "SCRIPT PART 4", 13] ;DEBUG 4
			
		pause 288
		for Index = 1 to 10
			serout ssc_out,SSC_BAUTE,"#",RFFemurPin,P2000#,RFTibiaPin,P1600#,LFFemurPin,P900#, |
				LFTibiaPin,P1600#>288,13]
				
				serout s_out, i9600, "SCRIPT PART 5", 13] ;DEBUG 5
			pause 144
			serout ssc_out,SSC_BAUTE,"#",RFFemurPin,P2100#,RFTibiaPin,P1400#,LFFemurPin,P1000#, |
				LFTibiapin,P1400#>288,13]
				
				serout s_out, i9600, "SCRIPT PART 6", 13] ;DEBUG 6
				
			pause 144
		next
			serout ssc_out,SSC_BAUTE,"#",RFCoxaPin,P1500#,RFTibiaPin,P1500#,LFCoxapin,P1500#, |
			LFFemurPin,P900#,LFTibiaPin,P1500#>288,13]
			
			serout s_out, i9600, "SCRIPT PART 7", 13] ;DEBUG 7
			
		pause 288
			serout ssc_out,SSC_BAUTE,"#",RRFemurPin,P1500#,RRTibiaPin,P1500#,RMFEmurPin,P1500#, |
			RMTibiaPin,P1500#,RFFemurPin,P1500#,LMFemurPin,P1500#,LMTibiaPin,P1500#, |
			LFFemurPin,P1500#,LRFemurPin,P1500#,LRTibiaPin,P1500#>576,13]
			
			serout s_out, i9600, "SCRIPT PART 8", 13] ;DEBUG 8
			
		pause 576
			serout ssc_out,SSC_BAUTE,"#",RMCoxaPin,P1500#,RMFemurPin,P1700#,RMTibiaPin,P1700#, |
			LMCoxaPin,P1500#,LMFemurPin,P1300#,LMTibiaPin,P1300#>288,13]
			
			serout s_out, i9600, "SCRIPT PART 9", 13] ;DEBUG 9
			
		pause 288
			serout ssc_out,SSC_BAUTE,"#",RMFemurPin,P1500#,RMTibiaPin,1500,LMFemurPin,1500, |
			LMTibiaPin,P1500#>288,13]
			
			serout s_out, i9600, "SCRIPT END", 13] ;DEBUG END
			
		pause 288
 			sound P9,[250\500]
 ENDIF			[/code]

Just a quick look, but why do you have a ‘>’ in the code?

"P1300#>288,13] "

Should probably look more like:

“P1600T576”,13]

A ‘T’ for the time constant of 288

Alan KM6VV

I tried to change some stuff because it wasnt working. Ths whas one of the things that was accepted by atom pro IDE. (colors change from black to blue)

But that isn’t the problem. I think the problem is with the way how the P1500# for example is written. It goes trough the entire process. just doesn’t move anything…

Hi Mano,

As Alan mentioned, the serout lines don’t look right! For example:

pause 288 serout ssc_out,SSC_BAUTE,"#",RMCOXAPIN,P1500#,RMTIBIAPIN,P1500#,LMFEMURPIN,P1500#, | LMTIBIAPIN,P1500#>288,13]
I am not sure how this would actuall compile let alone work. To debug, you could try changing the SSC_out, SSC_BAUTE to be s_out, i9600 and see what is actually generated.

But looking at the above command I would think it should look more like:

pause 288 serout ssc_out,SSC_BAUTE,"#",dec RMCOXAPIN,"P1500#",dec RMTIBIAPIN,"P1500#",dec LMFEMURPIN,"P1500#", | dec LMTIBIAPIN,"P1500T288",13]
Note things are quoted, likewise what alan said about T. Also you need to output the pins as decimal, not their binary data.

Kurt

this is what i get:

Error: FILE C:\DOCUMENTS AND SETTINGS\MANO\MIJN DOCUMENTEN\HEXAPOD\BLACKWIDOW+HEAD+BUGGED.BAS(LINE 864) : [TOKEN #] : Unexpected token type

i got it to work.

It took me rewriting almost the entire script but it works.
Remember that the servo widths are adjusted for futaba servos so if you want to use it convert them like this:

“P1700#” becomes “P1300#” etc (widths are counted back from 3000 now)

Here is the [code]IF (DualShock(2).bit6 = 0) and LastButton(1).bit6 THEN ;Cross Button test
for Index = 0 to 31
serout SSC_OUT,SSC_BAUTE,"#",DEC Index,“P1500#”]
next
serout SSC_OUT,SSC_BAUTE,“T800”,13] ;default is T200

		serout s_out, i9600, "SCRIPT START", 13] ;DEBUG SCRIPT START
			
			;Attack posture
		serout ssc_out,SSC_BAUTE,"#",dec RMCOXAPIN,"P1200#",dec RMFEMURPIN,"P1700#",dec RMTIBIAPIN,"P1300#", |
			dec LMCOXAPIN,"P1800#",dec LMFEMURPIN,"P1300#",dec LMTIBIAPIN,"P1300#T288",13]
			
			serout s_out, i9600, "SCRIPT PART 2", 13] ;DEBUG 2

; pause 288
; serout ssc_out,SSC_BAUTE,"#",dec RMCOXAPIN,“P1500#”,dec RMTIBIAPIN,“P1500#”,dec LMFEMURPIN,“P1500#”, |
; dec LMTIBIAPIN,“P1500#T288”,13]

			serout s_out, i9600, "SCRIPT PART 3", 13] ;DEBUG 3
			
		pause 288
		serout ssc_out,SSC_BAUTE,"#",dec RRFEMURPIN,"P1200#",dec RRTIBIAPIN,"P1200#",dec RMFEMURPIN,"P1800#", |
			dec RMTIBIAPIN,"P1500#",dec RFCOXAPIN,"P1200#",dec RFFEMURPIN,"P2100#",dec LRFEMURPIN,"P1200#", |
			dec LRTIBIAPIN,"P1800#",dec LRFEMURPIN,"P1800#",dec LMFEMURPIN,"P1200#",dec LMTIBIAPIN,"P1500#",dec LFCOXAPIN,"P1800#", |
			dec LFFEMURPIN,"P900#T2304",13]
			
			serout s_out, i9600, "SCRIPT PART 4", 13] ;DEBUG 4
			
		pause 288
		for Index = 1 to 10
			serout ssc_out,SSC_BAUTE,"#",dec RFFemurPin,"P900#",dec RFTibiaPin,"P1600#",dec LFFemurPin,"P2000#", |
				dec LFTibiaPin,"P1600#T288",13]
				
				serout s_out, i9600, "SCRIPT PART 5", 13] ;DEBUG 5
			pause 144
			serout ssc_out,SSC_BAUTE,"#",dec RFFemurPin,"P1000#",dec RFTibiaPin,"P1400#",dec LFFemurPin,"P2100#", |
				dec LFTibiapin,"P1400#T288",13]
				
				serout s_out, i9600, "SCRIPT PART 6", 13] ;DEBUG 6
				
			pause 144
		next
			serout ssc_out,SSC_BAUTE,"#",dec RFCoxaPin,"P1500#",dec RFTibiaPin,"P1500#",dec LFCoxapin,"P1500#", |
			dec LFFemurPin,"P1500#",dec LFTibiaPin,"P1500#T2304",13]
			
			serout s_out, i9600, "SCRIPT PART 7", 13] ;DEBUG 7
			
		pause 288
			serout ssc_out,SSC_BAUTE,"#",dec RRFemurPin,"P1500#",dec RRTibiaPin,"P1500#",dec RMFEmurPin,"P1500#", |
			dec RMTibiaPin,"P1500#",dec RFFemurPin,"P1500#",dec LMFemurPin,"P1500#",dec LMTibiaPin,"P1500#", |
			dec LFFemurPin,"P1500#",dec LRFemurPin,"P1500#",dec LRTibiaPin,"P1500#T2304",13]
			
			serout s_out, i9600, "SCRIPT PART 8", 13] ;DEBUG 8
			
		pause 576
			serout ssc_out,SSC_BAUTE,"#",dec RMCoxaPin,"P1500#",dec RMFemurPin,"P1700#",dec RMTibiaPin,"P1700#", |
			dec LMCoxaPin,"P1500#",dec LMFemurPin,"P1300#",dec LMTibiaPin,"P1300#T288",13]
			
			serout s_out, i9600, "SCRIPT PART 9", 13] ;DEBUG 9
			
		pause 288
			serout ssc_out,SSC_BAUTE,"#",dec RMFemurPin,"P1500#",dec RMTibiaPin,"P1500#",dec LMFemurPin,dec "P1500#", |
			LMTibiaPin,"P1500#T288",13]
			
			serout s_out, i9600, "SCRIPT END", 13] ;DEBUG END
			
		pause 288
 			sound P9,[250\500][/code]

i got it to work.

It took me rewriting almost the entire script but it works.
Remember that the servo widths are adjusted for futaba servos so if you want to use it convert them like this:

“P1700#” becomes “P1300#” etc (widths are counted back from 3000 now)

Here is the [code]IF (DualShock(2).bit6 = 0) and LastButton(1).bit6 THEN ;Cross Button test
for Index = 0 to 31
serout SSC_OUT,SSC_BAUTE,"#",DEC Index,“P1500#”]
next
serout SSC_OUT,SSC_BAUTE,“T800”,13] ;default is T200

		serout s_out, i9600, "SCRIPT START", 13] ;DEBUG SCRIPT START
			
			;Attack posture
		serout ssc_out,SSC_BAUTE,"#",dec RMCOXAPIN,"P1200#",dec RMFEMURPIN,"P1700#",dec RMTIBIAPIN,"P1300#", |
			dec LMCOXAPIN,"P1800#",dec LMFEMURPIN,"P1300#",dec LMTIBIAPIN,"P1300#T288",13]
			
			serout s_out, i9600, "SCRIPT PART 2", 13] ;DEBUG 2

; pause 288
; serout ssc_out,SSC_BAUTE,"#",dec RMCOXAPIN,“P1500#”,dec RMTIBIAPIN,“P1500#”,dec LMFEMURPIN,“P1500#”, |
; dec LMTIBIAPIN,“P1500#T288”,13]

			serout s_out, i9600, "SCRIPT PART 3", 13] ;DEBUG 3
			
		pause 288
		serout ssc_out,SSC_BAUTE,"#",dec RRFEMURPIN,"P1200#",dec RRTIBIAPIN,"P1200#",dec RMFEMURPIN,"P1800#", |
			dec RMTIBIAPIN,"P1500#",dec RFCOXAPIN,"P1200#",dec RFFEMURPIN,"P2100#",dec LRFEMURPIN,"P1200#", |
			dec LRTIBIAPIN,"P1800#",dec LRFEMURPIN,"P1800#",dec LMFEMURPIN,"P1200#",dec LMTIBIAPIN,"P1500#",dec LFCOXAPIN,"P1800#", |
			dec LFFEMURPIN,"P900#T2304",13]
			
			serout s_out, i9600, "SCRIPT PART 4", 13] ;DEBUG 4
			
		pause 288
		for Index = 1 to 10
			serout ssc_out,SSC_BAUTE,"#",dec RFFemurPin,"P900#",dec RFTibiaPin,"P1600#",dec LFFemurPin,"P2000#", |
				dec LFTibiaPin,"P1600#T288",13]
				
				serout s_out, i9600, "SCRIPT PART 5", 13] ;DEBUG 5
			pause 144
			serout ssc_out,SSC_BAUTE,"#",dec RFFemurPin,"P1000#",dec RFTibiaPin,"P1400#",dec LFFemurPin,"P2100#", |
				dec LFTibiapin,"P1400#T288",13]
				
				serout s_out, i9600, "SCRIPT PART 6", 13] ;DEBUG 6
				
			pause 144
		next
			serout ssc_out,SSC_BAUTE,"#",dec RFCoxaPin,"P1500#",dec RFTibiaPin,"P1500#",dec LFCoxapin,"P1500#", |
			dec LFFemurPin,"P1500#",dec LFTibiaPin,"P1500#T2304",13]
			
			serout s_out, i9600, "SCRIPT PART 7", 13] ;DEBUG 7
			
		pause 288
			serout ssc_out,SSC_BAUTE,"#",dec RRFemurPin,"P1500#",dec RRTibiaPin,"P1500#",dec RMFEmurPin,"P1500#", |
			dec RMTibiaPin,"P1500#",dec RFFemurPin,"P1500#",dec LMFemurPin,"P1500#",dec LMTibiaPin,"P1500#", |
			dec LFFemurPin,"P1500#",dec LRFemurPin,"P1500#",dec LRTibiaPin,"P1500#T2304",13]
			
			serout s_out, i9600, "SCRIPT PART 8", 13] ;DEBUG 8
			
		pause 576
			serout ssc_out,SSC_BAUTE,"#",dec RMCoxaPin,"P1500#",dec RMFemurPin,"P1700#",dec RMTibiaPin,"P1700#", |
			dec LMCoxaPin,"P1500#",dec LMFemurPin,"P1300#",dec LMTibiaPin,"P1300#T288",13]
			
			serout s_out, i9600, "SCRIPT PART 9", 13] ;DEBUG 9
			
		pause 288
			serout ssc_out,SSC_BAUTE,"#",dec RMFemurPin,"P1500#",dec RMTibiaPin,"P1500#",dec LMFemurPin,dec "P1500#", |
			LMTibiaPin,"P1500#T288",13]
			
			serout s_out, i9600, "SCRIPT END", 13] ;DEBUG END
			
		pause 288
 			sound P9,[250\500][/code]

Yup!

3000- value

Alan KM6VV

the problem why it didn’t work was this:

serout ssc_out,SSC_BAUTE,"#" dec RFFemurPin,"P900#",

Should be:

serout ssc_out,SSC_BAUTE,"#",dec RFFemurPin,"P900#",

They look the same to me!

Alan KM6VV

A comma after the “#” was missing.