Shop OBEX P1 Docs P2 Docs Learn Events
Question about UPS servo controller and the BS2px24????? — Parallax Forums

Question about UPS servo controller and the BS2px24?????

kingspudkingspud Posts: 128
edited 2006-07-11 04:04 in BASIC Stamp
Hello,
I need help setting up my UPS servo controller with my BS2px24 chip!!

What is the buad setting for the BS2px24 chip?
What is in the command line that controls each of the 0 to 15 servos?· IS it the channel number of that servo?
If I use P15 on the BS2px24 chip does that mean I connect the white wire to that port?· I am useing the PDB and was wondering if I could use the two servo ports for the controller?· And if so what is the command to control those two ports.

Any code would be great... Just some code that would control one server on the controller with the correct baud setting and I think I can do the rest!!!

thanks

Joe

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-10 01:28
    Joe,

    ·· Doesn't this UPS Servo controller have a manual?· As for the baud rates for the BS2px24 they're in the BASIC Stamp Manual as well as the Help File.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • kingspudkingspud Posts: 128
    edited 2006-07-10 05:09
    It does have a manual but I am trying to use it with the PDB board and this is a different setup! The PDB board has two servo control outputs but I don't know if I am suppose to use them or just hook it up to a port?
    Also, I have looked in the help file and I can't figure out which buad rate to use in the serin or serout command.
    I little but more info would help instead of just telling me there is a help file. Isn't that what tech support is for to give us the info if we are totally lost!
    Thanks
    Joe
  • kingspudkingspud Posts: 128
    edited 2006-07-10 05:54
    I don't mean to be a pain but there is no clear documentation for a BS2px24 chip on the PDB board using the UPS servo controller!!!!!
    Can ANYONE please give me a simple picture "even a crumby picture" of the hookup for this setup and some simple code that will center a servo on channel 0 of the PSC. I think I can do the rest if I have this starting point!
    Plus, a long time ago one of the tech support guys "I think it was Chris" had some code that you could add to your program that would automatically set the baud rate depending on what type of chip you had... Does any one have that code?
    Thanks again,
    Joe
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-07-10 16:59
    The PDB is so named because it assumes a certain level of experience (Professional Development Board)-

    Using a BS2PX on the PDB is no different than using any 24 pin Stamp module.

    The servo connectors on the PDB are called out on page 7 of the PDB documentation. The X4 header connects to the signal pin of each channel. You must connect an I/O pin to the servo channel you want to use.

    Kingspud, you keep making reference to the UPS servo controller- do you mean the PSC (from Parallax) or a different servo controller?

    The PSC has two baud modes available, 2400 and 38K4. This can be found in the documentation of the PSC, page 4. Connection to a servo header (the same thing as the three pin connector on the PDB) can be seen on page 3 of that same documentation.

    Given that you are using a BS2PX, you will need to set the baud parameter accordingly.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • kingspudkingspud Posts: 128
    edited 2006-07-10 17:28
    Dear Parallax technical support,

    Thanks for the nice poke on the "level of experience" comment... this is very helpful. thanks.

    By the way, I do have a certain level of experience with the PDB but the documentation is poor when it comes to multiple combinations of external devices.
    Such as... using the PSC (from Parallax) or using different types of BS chips in combination with other devices!

    More detailed program code examples with these types of external devices would relieve a lot of the confusion and questions!

    I know how to connect servos to this board but what I don't know is if I should connect the PSC to the X4 connector or just off the bread board with a three prong connector pin and use P15 as the port???

    Plus I have tried in vain to run the programs in the documention that everyone is so eager to point out but none of them work for me! Hence why I NEED the correct baud setting or a simple program that would move a servo on the PSC!
    I get the green LED on the PSC to flash when a program runs but no servo movement!
    Maybe the power I am supplying is low but I would think that at least 5 volts to the PSC would be enough to move a servo? Maybe not… you tell me.

    I would assume that as a tech support person for Parallax you would have these similar devices to hookup and create a code that you could give me. I still do not understand why this is so hard to do. You guys are the experts? right? I have a project that I want to get started on and this word play is not helping!
    Can someone at Parallax PLEASE setup these devices... BS2px24, PDB, PSC, one or two servos "standard or continues" and create a code that will move it and center it!
    That’s all I am asking for!!! I can do the rest after that!!! I didn't think that this was too much to ask. I'm sorry but that is the reason I use this forum because it gives me the answers to the questions I can't figure out!
    Yet so far I am at the same point in which I started... dead in the water!

    Joe
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-07-10 18:19
    That wasn't mean as a poke kingsbud, and I'm sorry if you took it that way, that wasn't the intention. The intent of that comment was to address the level of documentation available- since the PDB is not intended for beginners, the documentation is structured differently than say WAM.

    There was also confusion as to which servo controller you have- we were unsure if "UPS" was simply another servo controller put out by another company.

    You can connect the PSC either way you describe, that is up to you. (That is either via the X3 servo connectors, or via the breadboard)-

    What are you using for Servo power? (Not the logic power, but the servo power, connection to the PSC via the screw terminals)

    I would also like to verify: do you have a jumper on the X2 header of the PSC?


    For finding version number:
    ' {$STAMP BS2px}
    ' {$PBASIC 2.5}
    
    
    Sdat PIN 0                ' Serial Data I/O pin
    Baud CON 1646             ' Constant for 2400 baud
    buff VAR Byte(3)          ' temporary variable
    
    FindPSC:                  'Find and get the version
      DEBUG "Finding PSC", CR ' number of the PSC.
      SEROUT Sdat, Baud, [noparse][[/noparse]"!SCVER?",CR]
      SERIN  Sdat, Baud, 1500, FindPSC, [noparse][[/noparse]STR buff\3]
      DEBUG "PSC ver: ", buff(0), buff(1), buff(2), CR
    STOP
    


    (Note the only things changed were the Stamp directive and the baud number. All other code is identical.)

    For moving a servo:
    '{$STAMP BS2px}
    '{$PBASIC 2.5}
    
    ch VAR Byte
    pw VAR Word
    ra VAR Byte
    Sdat CON 0
    baud CON 1646
    ra = 1
    ch = 14
    
    
    DO
      pw = 300
      SEROUT Sdat, Baud,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
      PAUSE 3000
      pw = 1100
      SEROUT Sdat, Baud,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
      PAUSE 3000
    LOOP
    




    Both of these codes can be found in the documentation for the PSC.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • kingspudkingspud Posts: 128
    edited 2006-07-10 21:09
    Hello Ryan,

    First let me say thanks for your fast response, I don't mean to be harsh but I am trying the things that people suggest and nothing works!
    I do have separate power connected to the PSC and it is the 7.2 volt batteries. These are similar to what you would use on an RC car or truck. I need to charge them up again because they are showing only 4.7 or 4.8 volts and this may be too low!
    The jumper on the PSC is not connected, if you are talking about X2 it is there but only on one pin.
    Its very strange... as I said, I see the green LED blink as if it is doing something but the servos don't move! I took one of the sample code that runs a 10 iteration loop and the Green LED flashed 10 times and stopped but no servo movement.
    What is the optimal voltage that I need to run servos on the PSC?
    Will it not work if it gets down to a low voltage such as 5V or lower?

    How do I change the baud from between the 2400 and 38K4?
    I tested different values and still no servo movement!
    What am I doing wrong?
    Joe
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-07-10 21:17
    Just to clarify:

    Do you have the USB or Serial verison of the PSC?

    The PSC will default to 2400 baud. The code I attached was run from a BS2PX- if the green light is flashing then the PSC is seeing serial traffic, however this does not mean that the PSC is understanding what it is seeing (ie it only indicates traffic on the line, not that the correct baud rate is being used)-

    Sometimes if you've tried other baud rates the PSC will try to shift into a higher mode- try powering everything off, then back on, then running the code as I posted above. Make sure that you are addressing a servo that you have plugged in (the correct servo port number)-

    By far the easiest way to test your connection is to run the code to find the version number. This will let you know if you are talking to the unit correctly. The code in my previous message uses PIN 0 from a BS2PX, and 2400 baud. I would suggest starting with that.

    Verify your power sources the best you can.

    If you are using your PDB, make sure you have run a jumper wire from the pin on the stamp that you are using (in the X15 header) to the correct servo header (X4).

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • kingspudkingspud Posts: 128
    edited 2006-07-10 21:51
    The PSC I have is the USB version.
    The most frustrating thing about this problem is at one time, a long time ago I got this setup to work!!!
    Problem is I can't find the code that I wrote! Or the code that Jon sent me. I think at the time I had presented this same problem and Jon Williams gave me some help on this issue and i got it resolved but I know it was over a year ago and I can't find it in the search. Your search only goes up to a year! If I could find this forum guestion I gave a long time ago I know it would resolve all of this!
    He also gave me some code that helped before with the baud rate but it doesn't seem to work anymore. Here it is below, maybe you can find out what is wrong with it.
    This code use to work great but now it doesn't seem to work correctly.

    #SELECT $STAMP
    #CASE BS2, BS2E, BS2PE
    T1200 CON 813
    T2400 CON 396
    T9600 CON 84
    T19K2 CON 32
    T38K4 CON 6
    #CASE BS2SX, BS2P
    T1200 CON 2063
    T2400 CON 1021
    T9600 CON 240
    T19K2 CON 110
    T38K4 CON 45
    #CASE BS2PX
    T1200 CON 3313
    T2400 CON 1646
    T9600 CON 396
    T19K2 CON 188
    T38K4 CON 84
    #ENDSELECT
    Inverted CON $4000
    Open CON $8000
    Baud CON T38K4 + Inverted
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-07-10 22:07
    You cannot go directly to 38k4 baud. You must connect with 2400 baud and send the commands to set the module to 38K4 (as per the docs)-

    To test your power setup, you can simply plug in your USB connection, servo power, and use the PSCI software to check servo control with the GUI program.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • kingspudkingspud Posts: 128
    edited 2006-07-11 03:41
    Hurray!!!!!!!! The finding version program worked!!!!
    This is what I got!!
    Finding PSC
    PSC ver: 1.4
    So what does ver: 1.4 tell me? Am I up to date?

    Also, I tested the second program and it worked too!!!
    Thank you, Thank you, Thank you, Thank you, Thank you, Thank you!!!!

    This is what I was looking for! I just needed some correct sample program to get me started!
    Now I can get working on my project!!!!

    Too everyone:
    If you have my setup using the BS2px24, the PDB, and the PSC then use the programs above... they work!

    Thanks again Ryan! This is the type of tech support that really works!
  • kingspudkingspud Posts: 128
    edited 2006-07-11 04:04
    I just thought I would add an updated program for others to use that turns two servos on CH0 and CH1 on the PSC board using a BS2px24 chip in the X4 servo connector on the PDB board!!!

    ·
    '{$STAMP BS2px}················ ‘ This is a PSC servo program for the BS2px24 chip
    '{$PBASIC 2.5}
    ·
    ch1 VAR Byte·· ······················ ‘ This is the channel variable for the continuous servo
    ch2 VAR Byte············· ‘ This is the channel variable for the standard servo
    pw VAR Word
    ra VAR Byte
    Sdat CON 15··························' this connects the PSC to port 15 of the BS2px24 chip
    baud CON 1646····················· ‘*** This baud rate is critical to know for the BS2px24 chip
    ra = 7
    ch1 = 0··································· ' This sets the channel number of the servo to Ch0 on the PSC board
    ch2 = 1··············· ··················· ·' This sets the channel number of the servo to Ch1 on the PSC board
    ·
    DO
    · pw = 500·········································· ‘ This will turn the servo to the right
    · DEBUG "turn right", CR
    · SEROUT Sdat, Baud,[noparse][[/noparse]"!SC", ch1, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    · SEROUT Sdat, Baud,[noparse][[/noparse]"!SC", ch2, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    · PAUSE 3000
    · pw = 750·········································· ‘ This will stop a continuous servo or center a standard servo
    · DEBUG "stop or center", CR
    · SEROUT Sdat, Baud,[noparse][[/noparse]"!SC", ch1, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    · SEROUT Sdat, Baud,[noparse][[/noparse]"!SC", ch2, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    · PAUSE 3000
    · pw = 1000········································ ‘ This will turn the servo to the left
    · DEBUG "turn left", CR
    · SEROUT Sdat, Baud,[noparse][[/noparse]"!SC", ch1, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    · SEROUT Sdat, Baud,[noparse][[/noparse]"!SC", ch2, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
    · PAUSE 3000
    LOOP

    I hope this helps others who maybe stuck like I was!!
    Thanks again!

    Joe
Sign In or Register to comment.