PC Based robot control code

This is the latest control code for my robot.

http://64.46.156.80/robot/ The source code should compile on Linux without any special libraries.

The code: i2cdev.cpp and i2cdev.h, a class to interface I2C devices. k8000.cpp and k8000.h, a class to use the i2cdev to interface to a Velleman K8000 I/O board. mencoder.cpp and mencoder.h. a class to use a PS/2 mouse as an encoder. mfkbd.cpp and mfkbd.h, a class to interface with the keyboard. motorctl.cpp and motorctl.h, a generic class to implement a PID control loop on a number of motors. mousecode.h, info about PS/2 mice. mouse.cpp and mouse.h, a class to interface to a PS/2 mouse. mpid.cpp and mpid.h, a class to implement PID calculations per motor. pcmctl.cpp and pcmctl.h, a subclass of motorctl, for the robot. robot.cpp and robot.h, a simple program to run the motors. util.cpp and util.h, simple utilities functions.

Reply to
mlw
Loading thread data ...

Are you using the parallel interface to talk to the motors?

Eljin

Reply to
Eljin

Right now I am using a Velleman K8000 I/O board which talks on a parallel port I2C bus.

The motor amplifyer accepts +- 5Volts negative voltage go faster backwards and positive voltage goes faster forward. I am using two of the velleman D/A converters to drive the motors.

Reply to
mlw

Why not just hook it up to the printer port?

So, you're producing the PWM/PID on the computer or is that what the PWM board is about? If so, you are just sending it commands?

Eljin

Reply to
Eljin

That's how the K8000 board works.

The motor amplifier accepts, as I said, +- 5V for control, it produces direction and PWM for the H-Bridge

Reply to
mlw

I was looking at your web site again and I just realized that you are using the same drive motors as I am. Did you get yours from the Barbie Jeep too? :-)

What motor amps are you using?

Eljin

Reply to
Eljin

No, mine came off a BJs Wholesale "Scrambler." $65. I've seen it for as low as $35.

My own.

Reply to
mlw

I like your encoder mount.

can you please give more detailed pictures, and perhaps more information?

How do you mount the encoder to the metal bracket?

Rich

Reply to
aiiadict

Thanks.

Not without taking it apart again :(

With the single tool that rivals duct tape for usefullness: JB Weld epoxy.

Reply to
mlw
[snip]

Good stuff -- I've used it to make wheel shaft mounts for fairly heavy robots and have yet to see it fail, even under a fair amount of torque. It's amazing how well (and how long) this stuff holds up when properly applied.

Reply to
the Artist Formerly Known as K

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.