Hi Guys,
I’ve got a day off from work so I’m playing with TA today. Yeah! ![:slight_smile: :slight_smile:](//community.robotshop.com/forum/images/emoji/twitter/slight_smile.png?v=9)
So far I found 2 issues that I need some help with.
A: SSC false readings
I noticed that sometimes the SSC gives me some false values when querying the servo positions. To test this further I made the following test program:
[code]sethserial1 H38400
var1 var word
var3 var word(31)
cSSC_OUT con P21 ;Output pin for (SSC32 RX) on BotBoard (Yellow)
cSSC_IN con P20 ;Input pin for (SSC32 TX) on BotBoard (Blue)
cSSC_BAUD con i38400;i115200 ;SSC32 BAUD rate 38400 115200
i var word
legindex var word
main:
pause 100
hserout 1, "send: "]
for legindex = 0 to 31
hserout 1, " ", dec legIndex, " ", dec (1500+(legindex10))]
serout cSSC_OUT, cSSC_BAUD, “#”, dec legIndex, “P”, dec (1500+(legindex10))]
pause 1
next
hserout 1, [13]
serout cSSC_OUT, cSSC_BAUD, [13]
pause 100
gosub QueryServoPulses
hserout 1, "query: "]
for i = 0 to 31
hserout 1, " ", dec i, " ", dec var3(i)]
pause 1
next
hserout 1, [13]
pause 1000
goto main
;--------------------------------------------------------------------
;[QUERY SERVO PULSES] Queries the current angles of the servos
; Using the SSC binary bit mask
;- byte 1 = (binary) 1 0 1 1 s3 s2 s1 s0
;- byte 2 = (binary) 0 s10 s9 s8 s7 s6 s5 s4
;- byte 3 = (binary) 0 s17 s16 s15 s14 s13 s12 s11
;- byte 4 = (binary) 0 s24 s23 s22 s21 s20 s19 s18
;- byte 5 = (binary) 0 s31 s30 s29 s28 s27 s26 s25
;WARNING! rearanging the servo pin numbers also requires to rearanging the QueryPinMask AND PWM Serin order.
; PWM serin returns 2 bytes for each queried servo. The read order is from low (P0) to high (P31).
QueryServoPulses:
serout cSSC_OUT, cSSC_BAUD, [0xBF, 0x7F, 0x7F, 0x7F, 0x7F]
serin cSSC_IN, cSSC_BAUD, [var3(0).highbyte, var3(0).lowbyte |
,var3(1).highbyte, var3(1).lowbyte |
,var3(2).highbyte, var3(2).lowbyte |
,var3(3).highbyte, var3(3).lowbyte |
,var3(4).highbyte, var3(4).lowbyte |
,var3(5).highbyte, var3(5).lowbyte |
,var3(6).highbyte, var3(6).lowbyte |
,var3(7).highbyte, var3(7).lowbyte |
,var3(8).highbyte, var3(8).lowbyte |
,var3(9).highbyte, var3(9).lowbyte |
,var3(10).highbyte, var3(10).lowbyte |
,var3(11).highbyte, var3(11).lowbyte |
,var3(12).highbyte, var3(12).lowbyte |
,var3(13).highbyte, var3(13).lowbyte |
,var3(14).highbyte, var3(14).lowbyte |
,var3(15).highbyte, var3(15).lowbyte |
,var3(16).highbyte, var3(16).lowbyte |
,var3(17).highbyte, var3(17).lowbyte |
,var3(18).highbyte, var3(18).lowbyte |
,var3(19).highbyte, var3(19).lowbyte |
,var3(20).highbyte, var3(20).lowbyte |
,var3(21).highbyte, var3(21).lowbyte |
,var3(22).highbyte, var3(22).lowbyte |
,var3(23).highbyte, var3(23).lowbyte |
,var3(24).highbyte, var3(24).lowbyte |
,var3(25).highbyte, var3(25).lowbyte |
,var3(26).highbyte, var3(26).lowbyte |
,var3(27).highbyte, var3(27).lowbyte |
,var3(28).highbyte, var3(28).lowbyte |
,var3(29).highbyte, var3(29).lowbyte |
,var3(30).highbyte, var3(30).lowbyte |
,var3(31).highbyte, var3(31).lowbyte]
return
;--------------------------------------------------------------------
[/code]
When running the program a couple of times I get the following result:
send: 0 1500 1 1510 2 1520 3 1530 4 1540 5 1550 6 1560 7 1570 8 1580 9 1590 10 1600 11 1610 12 1620 13 1630 14 1640 15 1650 16 1660 17 1670 18 1680 19 1690 20 1700 21 1710 22 1720 23 1730 24 1740 25 1750 26 1760 27 1770 28 1780 29 1790 30 1800 31 1810
query: 0 1500 1 1510 2 1620 3 1530 4 1540 5 1550 6 1560 7 1570 8 1580 9 1790 10 1600 11 1610 12 1620 13 1630 14 1640 15 1650 16 1660 17 1670 18 1680 19 1690 20 1700 21 1710 22 1720 23 1740 24 1740 25 1750 26 1760 27 1770 28 1780 29 1790 30 1800 31 1810
send: 0 1500 1 1510 2 1520 3 1530 4 1540 5 1550 6 1560 7 1570 8 1580 9 1590 10 1600 11 1610 12 1620 13 1630 14 1640 15 1650 16 1660 17 1670 18 1680 19 1690 20 1700 21 1710 22 1720 23 1730 24 1740 25 1750 26 1760 27 1770 28 1780 29 1790 30 1800 31 1810
query: 0 1510 1 1510 2 1520 3 1530 4 1540 5 1550 6 1560 7 1570 8 1580 9 1590 10 1600 11 1610 12 1620 13 1630 14 1640 15 1650 16 1670 17 1670 18 1680 19 1690 20 1700 21 1710 22 1720 23 1730 24 1740 25 1750 26 1760 27 1770 28 1780 29 1800 30 1800 31 1810
send: 0 1500 1 1510 2 1520 3 1530 4 1540 5 1550 6 1560 7 1570 8 1580 9 1590 10 1600 11 1610 12 1620 13 1630 14 1640 15 1650 16 1660 17 1670 18 1680 19 1690 20 1700 21 1710 22 1720 23 1730 24 1740 25 1750 26 1760 27 1770 28 1780 29 1790 30 1800 31 1810
query: 0 1500 1 1510 2 1520 3 1530 4 1540 5 1560 6 1560 7 1570 8 1580 9 1590 10 1600 11 1610 12 1620 13 1630 14 1640 15 1650 16 1660 17 1670 18 1680 19 1690 20 1700 21 1710 22 1720 23 1730 24 1740 25 1750 26 1760 27 1770 28 1780 29 1790 30 1800 31 1810
send: 0 1500 1 1510 2 1520 3 1530 4 1540 5 1550 6 1560 7 1570 8 1580 9 1590 10 1600 11 1610 12 1620 13 1630 14 1640 15 1650 16 1660 17 1670 18 1680 19 1690 20 1700 21 1710 22 1720 23 1730 24 1740 25 1750 26 1760 27 1770 28 1780 29 1790 30 1800 31 1810
query: 0 1500 1 1620 2 1520 3 1530 4 1740 5 1550 6 1560 7 1570 8 1580 9 1590 10 1600 11 1610 12 1620 13 1630 14 1640 15 1650 16 1660 17 1670 18 1680 19 1690 20 1700 21 1710 22 1720 23 1730 24 1740 25 1750 26 1760 27 1770 28 1780 29 1790 30 1800 31 1810
send: 0 1500 1 1510 2 1520 3 1530 4 1540 5 1550 6 1560 7 1570 8 1580 9 1590 10 1600 11 1610 12 1620 13 1630 14 1640 15 1650 16 1660 17 1670 18 1680 19 1690 20 1700 21 1710 22 1720 23 1730 24 1740 25 1750 26 1760 27 1770 28 1780 29 1790 30 1800 31 1810
query: 0 1600 1 1650 2 1520 3 1530 4 1540 5 1550 6 1560 7 1570 8 1580 9 1590 10 1600 11 1610 12 1620 13 1630 14 1640 15 1650 16 1660 17 1670 18 1680 19 1690 20 1700 21 1710 22 1720 23 1730 24 1740 25 1750 26 1760 27 1770 28 1780 29 1810 30 1800 31 1810
I marked all the false readings in red.
I’ve tried the following firmware versions:
- SSC32-V2.05Alpha4A-EGP
- SSC32-V2.06Alpha1B-EGP
- SSC32-V2.07Alpha1A-EGP
All versions give me the same result ![:frowning: :frowning:](//community.robotshop.com/forum/images/emoji/twitter/frowning.png?v=9)
Am I overlooking something or does this show an, as we call it, “a hidden feature” (aka bug). Maybe mike could help out here.
B: baud rate
The Query Servo Pulses function is copied from the Hybrid which was communicating on a baud of 38400.
Kurt, can you tell me what changes must be made to upgrade the baud to 115200?
Thanks!
Xan