Shop OBEX P1 Docs P2 Docs Learn Events
Request Help MSR1 Propeller Board + 2 Sabertooth Motor Controllers + 1 — Parallax Forums

Request Help MSR1 Propeller Board + 2 Sabertooth Motor Controllers + 1

Manorris111Manorris111 Posts: 2
edited 2010-01-07 21:17 in Propeller 1
My son and I have built a fully customized robot using

(1) MSR1 Robot Contol Board
(2) Sabertooth Motor Controllers
(4) DC Motors
(1) Vex Receiver & Transmitter (6 Channel)

We have attached:

- Schematic of interface for our Vex Receiver and Motor Controllers to the Propeller MSR1 Robot Control Board

- (3) Spin Objects
-- VexDemux Call··· (Top Oject)
-- Vex Demux········ (Demux the PPM to PWM ~ I think)
-- VexMotorEngine··(Intended to communicate PWM to Sabertooth MC's)

We are fairly new at this and have dove in head first - can anyone help us with the SPIN Objects.
They are all taken from past Propeller forum and·object exchange efforts.· We have done the initial modifications to the first two files and are more·stumped on the third,,, as well as the others.

Any help is greatly appreciated.

Thanks in advance.

Comments

  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2010-01-07 10:58
    You shouldn't have to change VEXDemux.spin at all.

    You will need to use a different object for you motors though. This object (obex.parallax.com/objects/51/) will do what you need. You will also need to connect the ground wire for both channels of the motor controller to the propeller board (I didn't do it on a board I was using and it took us several hours to figure out why the motors weren't running properly).

    You will need some code in VexDemux Call.spin something like this to get it all to work properly.


    CON
      motor1pin=1 'you'll have to change these to what you are using
      motor2pin=2
      motor3pin=3
      motor4pin=4
    VAR 
        long channel[noparse][[/noparse]6]               ' Renamed because this holds the actual values, not a pointer to channel variables (6 longs)
        long syncOutPtr               ' sync output that is true while receiving new pulse
    
        'Pub Motors Variables
        Word Chan2                    'Used to store forward or back PWM values for Pins 1 & 22
        Word Chan1                    'Used to store left or right PWM values for Pins 0 & 23
                    
    OBJ           
        VEX : "VEXDemux"                                    ' Create VEX Demux Object
        MOTORS : "servo32v7"                           ' Create Vex Motors Object that is used to control the motors
    
    PUB Start 
        VEX.Start (15, @channel, @syncOutPtr)            ' Initialize VEX Decoder Object
                                                            ' VexRcvPin - VEX Receiver PPM Output        
                                                            ' channelValues - current channel
                                                            ' values in microseconds
    
        Motors.Start                                        ' start the motor driver
    
        repeat                                              'go into an endless loop
          Motors.set(motor1Pin,channel[noparse][[/noparse] 0])                  'update the value for the first motor
          Motors.set(motor2Pin,channel[noparse][[/noparse] 1])
          Motors.set(motor3Pin,channel[noparse][[/noparse] 2])
          Motors.set(motor4Pin,channel[noparse][[/noparse] 3])
    
    
  • Manorris111Manorris111 Posts: 2
    edited 2010-01-07 21:17
    Steve,

    Thank you so much for the reply - very much appreciated.

    We will give this a try and let you know how it goes.
Sign In or Register to comment.