Pc to robot?

I have a question. Is there any way to use my laptop or my pocket pc or something like this as the microcontroller of my robot???if yes can you tell me how?

If you have a Microcontroller or an SSC-32 servo controller, you could have a device such as a PDA or laptop send serial commands to the robot controller.

I have a basic stamp board with the microcontroller from parallax but how can i give it commands.if i will write the programm in the basic stamps program.then it will be running in the robot’s microcontroller.

You have to control the robot from a Microcontroller. there is no way you can control it directly from the PC. My point was that you could program the Stamp to receive the commands being sent from the PC and make decisions based on them.

What you mean is if you write the Stamp program it will only run on the Stamp MCU (microcontroller), which is true, but you need to send commands from the MCU program to the servo controller. You do this by connecting RX/TX wires to your MCU pins so you can communicate with the SSC-32.

If you look at the SSC-32 manual, available online, you will see how to configure this type connection. The manual also shows what baud rates to use, what jumper settings to use and what commands to send to the SSC-32.

You CAN use your pc to send commands to the SSC-32 via a cable or wireless serial comms.

that is highly dependant upon the program you write.

look at it this way… write a program that listens to the serial port for characters, and then parse the characters received into actual activities.

for example, lets say you have 3 LEDs attached to your stamp, red, yellow, and green. You write some code that when it sees an ‘r’ turns on the red LED, when it sees an ‘R’ it turns off the red LED, and when it sees a ‘ctrl-r’ cauus the red LED to toggle off to on or on to off. Similarly you can define a set of commands based upon the ‘y’ character for yellow and ‘g’ character for green.

now expand you horizons, connect a servo and write some code to allow you to send it pulses from 1000us to 2000us in duration every 20,000us. using the LED example above as a reference for concept, map the letter ‘l’ to send 1000us to the servo, the letter ‘c’ to send 1500us, and the letter ‘r’ to send 2000us. the letters correspond to left, center, and right.

now you can write a program on your pc or what have you to send “commands” via a serial port based up on the mappings you create in the stamp.

for the record this example is overly simplistic however it is intended to get you thinking along the lines of how you could implement a low level set of code in your stamp for toggleing bits and what have you based upon a higher level command set used by your PC based program.

I think you have not understand me.I want my robot to do many calculations. Unfortunately, my basic stamp alone cannot do all this calculations quickly and it stack between its movements.I would like to
use my laptop’s cpu to make these calculations so that it wont stack.
Is it possible?

Furthermore: I will not press any buttons . i want to have it running alone.

yes, you collect the data needed for the calculations, transmit it to your laptop via a serial connection, crunch the numbers, send the results back to the stamp over the serial connection. where is the mystery?

again i am new but i think this is along the lines of what he is looking to tolynxmotion.net/phpbb/viewtopic.php?t=3004

or somithing like that with the pc onbord

how can i transmit to the robot when it is running?
how can laptop recognize the data which the robot will collect?(in basic stamp?)

other than a wired tether? bluetooth, wlan, xbee, zigbee, there are lots of options out there to choose from for wireless serial connections.

a program running on the laptop would obviously need to be listening to the serial port for data to crunch.

Via serial comms. wirless or cable (teathered)

via serial comms. wirless or teathered :unamused:

If you’re asking how to program both the PC and the Stamp to make the comms work, I think most people will not have that kind of available time to spoon feed you a complete working tutorial. I’d recommend reading the SSC-32 manual, do some research, and take baby steps and do a few “hello world” serial comm programs before going any further.

We are here to help but not to spoon feed. :smiley:

Actually…

You COULD write a control program for the PC that would use a real parallel port to generate the R/C servo PWM signals on it’s 8 data pins. I run stepper motors that way. (no R/C code available).

Two parallel ports, 16- 20+ servos!

Alan KM6VV

Of course that would require extensive knowledge in programming, wouldn’t it?

Extensive? Maybe not. I’m actually thinking of a C or BASICA program running under good old DOS. It simplifies things, and keeps the OS from stealing cycles and ruining your timing! That’s how some of my CNC control programs run.

Could it be written with Visual BASIC under Windoz? possibly.

If the SSC-32 is retained, than sending serial commands from a BASIC program is a snap! The timing issues of running the R/C servos directly is passed on to the SSC-32 as we know.

Best bet would be to get up to speed on an Atom Basic or Pro chip, I think, as has been undoubtedly been suggested.

Just thought I’d throw it out as a possibility! The serial and wireless suggestions that have already been made are on point.

Alan KM6VV

Um even meeting the timing requirements for remotely jitter free operation of the servos under good old DOS for servos would be a major undertaking… especially as a background process unless you were wiling to write off massive percentages of processor time where you could be guaranteed of no interruptions.

As for attempting this under a modern operating system… rotflmao.

It depends on the specific capabilitys of the laptop and the pocket pc, but probably easy to do depending on what you have in mind. What are the details of what you want to do?

Actually if you had a Dual core processor the timing wouldn’t be too difficult. Right? The first thread the OS could use and the second thread for sending commands to a servo.

Yeah, only really possible with DOS (6.22). Although EMC running under Linux can run steppers quite nicely as well. Actually, there is ONE CNC control program, MACH3, that uses a special timer (?) in the Pentium core, and gets away with it. But few can make the special hardware work (or want to).

As I said, under DOS, which can easily be made to stay out of the way, it’s no big trick to do the timing for 4-8 stepper motors at high speeds and high pulse rates. This would directly equate to running the simple 20ms PWM signals of several R/C servos.

So yeah, it could be done. But using a dedicated micro (SSC32) to generate the re-occurring PWM signals makes more sense for the R/C servos.

Alan KM6VV

typically if the stepper pulses are going to a drive then there is little requirement on the duty cycle of the pulse waveform beyond meeting some minimum pulse width and possibly a maximum duty cycle. so what you are needing to achieve is a frequency which can be attained using the timer interrupt available on the classic pc mainboard and its interrupt.
with a hobby servo command signal you are needing not only to control the frequency but the precision of the duty cycle to within a microsecond or so with little jitter between pulses. unless you are willing to sit there with interrupts disabled and effectively bitbang those edges, precluding all other processing, you might as well be using mg995 servos. :open_mouth: