Lol, not yet. I just have speed control of both motors in reverse at once. 8)
hahaha, id like to see that
Ready, Set, GO! spacejunk’s sumo flies off the ring backwards
I’ve been trying to get a friend of mine interested in Sumo because I think it would be cool. He is not interested, at least right now, and he can’t afford to build a robot. He has a family, and they are a real drain on him in every way.
8-Dale
You laugh untill it happens to you!
im not so much the sumo type of guy cough 5’9" and 130 lbs cough
im more the explorer rover bot which i plan on making a bridge for to ross small gaps lol
anyway, wat do u plan on for a game plan for the sumo?
woot 1000 post
My interuppt is working perfectly now! All you need to do is set two values and the motors go that speed.
nice work, what micro are u usuing? and might i borrow that code?
I don’t have any real plan for a Sumo, at least not as far as competition goes - but that could be fun also. I just thought it would be interesting to build a six wheeled Sumo and have matches with my friend.
Besides, I already have two robot projects going, and one of those is a subpart of another.
8-Dale
It is a parallax SX chip. Yes feel free to use the code. I’ll post the dual motor version soon.
oh…damn, i have a BA
I don’t think th BA could handle this program.
How about the Atom PRO?
8-Dale
No, It’s not fast enough to do full PWM with an interrupt and still operate properly.
Actually for the Atom(or AtomPro or most PICmicros) I’d just use the HPWM command in MBasic. You can have two PWM channels running on an Atom and 3 on a Pro. Also they are 10bit pwm instead of the 8bits thats being generated via a timer interrrupt on the SX chip. From the code above I’m assuming this is a Ubicom SX chip at 50mhz running Parallaxes Basic compiler for the SX.
The Atom PRO has hardware PWM.
8-Dale
Oh, I forgot about that feature. That would work fine. Yes Acidtech; that is what I am using.
Here is the code I am using for anyone who wants it:
DEVICE SX28, OSCHS2, TURBO, STACKX, OPTIONX
FREQ 50_000_000
' -------------------------------------------------------------------------
' IO Pins
' -------------------------------------------------------------------------
PWMPinR VAR RA.0
PWMPinL VAR RA.2
' -------------------------------------------------------------------------
' Constants
' -------------------------------------------------------------------------
' -------------------------------------------------------------------------
' Variables
' -------------------------------------------------------------------------
PWMCount VAR Byte
PWMValueR VAR Byte
PWMValueL VAR Byte
' -------------------------------------------------------------------------
INTERRUPT
' -------------------------------------------------------------------------
ISR_Start:
\ADD PWMCount, #1
IF PWMCount >= PWMValueR THEN
\CLRB PWMPinR
ELSE
\SETB PWMPinR
ENDIF
IF PWMCount >= PWMValueL THEN
\CLRB PWMPinL
ELSE
\SETB PWMPinL
ENDIF
ISR_Exit:
RETURNINT 250
' =========================================================================
PROGRAM Start
' =========================================================================
' -------------------------------------------------------------------------
' Subroutine Declarations
' -------------------------------------------------------------------------
' -------------------------------------------------------------------------
' Program Code
' -------------------------------------------------------------------------
Start:
TRIS_A = %0000 ' All outputs
OPTION = $81 ' Enable RTCC interrupts, RTCC Prescaler = 1:4
PWMValueR = 0
PWMValueL = 0
\SETB RA.1
\SETB RA.3
Main:
GOTO Main
' -------------------------------------------------------------------------
' Subroutine Code
' -------------------------------------------------------------------------
' =========================================================================
' User Data
' =========================================================================
I know what you mean. I wish I knew someone interested in any kind of robotics!
I’m eventually going to build two little min-sumo bots and a Ring, but I’m not in a big hurry.
I was wondering if I could use a current sensing resistor to detect the other robot attacking?
How big a sense resistor would I need?