Shop OBEX P1 Docs P2 Docs Learn Events
Sumo-bot and Figure-8 — Parallax Forums

Sumo-bot and Figure-8

DaimorteDaimorte Posts: 1
edited 2008-08-12 13:59 in Robotics
Hello there nice and fuzzy forum comunity!

I just got myself a SumoBot from parallax and started to assemble it together, I got to where I need to program the SumoBot to follow different patterns, square and triangle were easy, but I have the following problem when I try it to get it to follow a Figure-8 pattern.
I can't seem to get enough speed for my right SumoBot wheel so I wondered if anyone could give me some sample codes and see if it works with them. I'm still pretty new and know very little about microcontroller programming so be gentle please. [noparse]:D[/noparse]

Here's what I tried to make him to do:
'
[noparse][[/noparse] Title ]
' Mini Sumo 2.1 : Motor Test
' {$STAMP BS2}
' {$PBASIC 2.5}

'
[noparse][[/noparse] I/O Definitions ]
LMotor········· CON···· 13····················· ' left servo motor
RMotor········· CON···· 12····················· ' right servo motor
'
[noparse][[/noparse] Constants ]
LFwdFast······· CON···· 10000··················· ' left motor forward; fast
LFwdSlow······· CON····· 800··················· ' left motor forward; slow
LStop·········· CON····· 750··················· ' left motor stop
LRevSlow······· CON····· 700··················· ' left motor reverse; slow
LRevFast······· CON····· 500··················· ' left motor reverse; fast
RFwdFast······· CON····· 10··················· ' right motor forward; fast
RFwdSlow······· CON····· 710··················· ' right motor forward; slow
RStop·········· CON····· 750··················· ' right motor stop
RRevSlow······· CON····· 800··················· ' right motor reverse; slow
RRevFast······· CON···· 1000··················· ' right motor reverse; fast
'
[noparse][[/noparse] Variables ]
pulses········· VAR···· Byte··················· ' counter for motor control
'
[noparse][[/noparse] Initialization ]
Start_Delay:
· PAUSE 2000··································· ' time to disconnect cable
RESET:
· LOW LMotor
· LOW RMotor
'
[noparse][[/noparse] Main Code ]
Main:
· FOR pulses = 1 TO 250
··· PULSOUT LMotor, LFwdFast
··· PULSOUT RMotor, RFwdSlow
· NEXT
· FOR pulses = 1 TO 250
··· PULSOUT LMotor, LFwdSlow
··· PULSOUT RMotor, RFwdFast
· NEXT
END

Thanks for any help you can give me.

Comments

  • dandreaedandreae Posts: 1,375
    edited 2008-08-12 13:59
    Is your left servo fast enough?· If so, you may have to re-calibrate your right servo.· You can adjust the speed the of the servo by adjusting the PULSOUT value.· You'll will have to experiment with the values to get it dialed in.



    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
Sign In or Register to comment.