Total newbie question
m00se
Posts: 6
My knowledge of DIY electronics is limited to changing a lightbulb, so this question might seem a bit odd...
I bought the Propellor servo controller, and I'm able to move the servo using the "Parallax Servo Controller Interface", however I would like to do some scripting. The manual gives some examples like:
I understand the code, but I have totally no idea how to get this running on the controller.
Thanks in advance
I bought the Propellor servo controller, and I'm able to move the servo using the "Parallax Servo Controller Interface", however I would like to do some scripting. The manual gives some examples like:
' {$STAMP BS2} ' {$PBASIC 2.5} ch VAR Byte pw VAR Word ra VAR Byte Sdat CON 15 baud CON 396 ra = 7 ch = 11 DO pw = 1100 SEROUT Sdat, Baud+$8000,["!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR] PAUSE 1000 pw = 300 SEROUT Sdat, Baud+$8000,["!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR] PAUSE 1000 LOOP
I understand the code, but I have totally no idea how to get this running on the controller.
Thanks in advance
Comments
1. Do some of the tutorials with the propeller on a propeller demo board
2. Downlaod the Basic Stamp library from the object exchange. It will make it very easy to port PBASIC programs over to the propeller. Eventually you can do the tasks natively in spin.
Alternate: Go with a Basic Stamp controlled BOE-BOT
Good luck!
Furthermore, the code I mentioned comes out of the manual of this product and it does not mention I need another hardware part.
http://forums.parallax.com/showthread.php?t=126712
The Propeller Servo Controller is preprogrammed with a program that takes commands from the serial port, interprets them, and produces the servo control pulses needed to implement the commands. As programmed from Parallax, it needs either a PC or some kind of microcontroller to send the commands expected. If you want to use the existing program, you will need some kind of controller. The sample program you listed is intended for the BS2 Stamp.
If you want the Propeller Servo Controller to work on its own, you can do that, but you'll need to replace the existing program with one of your own. There are "objects" in the Propeller Object Exchange that will take care of the servo handling for you and one of them (Servo32v2) is used by the program that comes with the Servo Controller.
To write programs for the Propeller, all you need is a copy of the Propeller Tool. This comes with some of the objects that you will need. The others can be found in the Object Exchange. There are plenty of tutorials available. Check out the "Getting Started" thread in this forum.
Thanks for linking him to the other thread. I was just about to do so.
OOps, Mike Green step in as I was writing this. Mike covered most of what I was going to say.
What I might add to Mike's wisdom, you could use the PSCI software found on the Servo Controller page at the lower left to save scripted moves that can be saved on a PC and run over the USB port.
You could also take the Basic examples and use them to program the Propeller in PropBasic:
http://forums.parallax.com/showthread.php?t=118611
Jim
I can get the proper 'spin' onto the board now, however I can't seem to find a way to address sub routines of the spin. For example, the following sub: ... is part of the spin, so I now expect to be able to tell the board to change a certain servo to a certain position. Following my logic or do I totally miss something :idea:
So:
- How do I send an order after the spin is loaded.
- What do I send?
I already wrote a script in .NET to send strings to the board, but my successes are currently limited to blinking a led on the board.
============================
Edit: I got it working by just sending the bytes directly to the board!
Alternatively, you could download and examine other servo drivers from the Object Exchange like this one that only handles two servos, but is simple, written in Spin only, and well documented.
not very much about programming and different programming languages.
That's really OK. You just can't expect that by changing two or three characters the thing will run.
The propeller-servo-controller is pre-programmed with a firmware.
firmware is sonething different than a software. It's the BASE for the software.
If you change the firmware this is like if you would change the system32.dll
of operation system "windows vista" or "windows 7" to act in a different way. You should do this only if you know windows 7 VERY VERY good.
To write scripts for the propeller-sevo-control-board to do some pre-configured movements is done on the PARTNER of the propeller-servo-control-board (short term: pscb)
You have the pscb that RECEIVES commands.
example: the VER?-command
If the partner of the pscb is a PC and on the PC there is running the program hyperterminal the "script" for this would be
typing on the keyboard VER? Enter
If the partner of the pscb is a arduino you would have to program some arduino-code to send the bytesequence "VER?#13" to the pscb
If the partner is a basic-stamp the code you qouted above would be programmed into a basic-stamp to send the bytesequence "VER?#13" to the pscb
in every programming language you have some characters that are specific to the programming language and some "characters" that represent the serial bytesequence.
So first thing to do is to understand which part of the code is that one
thet represents the bytesequence.
Then you have to learn how to add the programming-specific-part
that makes the hardware send the bytesequence.
If you tell us with what kind of hardware and with wich programming-language you want to send the serial bytesequences to the pscb the forum
can help you to realise that.
so please tell us what is the hardware of the propeller-servo-control-board
you want to use
and what is the programming-language you want to use.
If you tell as "the big frame" what you want to do in the end this help too
to find suitable solutions.
So feel free to write a big posting that describes that all.
Write some guesses how you think it should work.
If you do that the forum can see clearly where you are and can guide you towards the target. Right now most of it is guessing in the fog
best regards
Stefan
The hardware, as mentioned before, is a Parallax Servo Controller (part number 28830). Connected to a pc by USB.
Well, I wanted to use the propellor tool using 'spin' as Mike suggested, but I really didn't get a servo to move; and yes, I did read some tutorials.
So I switched to adressing the serial port directly. Instead of for example following PBasic code (which requires a Stamp as I have now learned):
...I did it like this (VB.NET):
...which does work fine and is in some way sufficient as I don't need to use the board without a pc attached. However I thought it could be done easier.