New to stamps, need advice controlling a motor
AR15barrels
Posts: 6
I'm a complete newb to stamp controllers, but I need some advice on a project I am tasked with where I think I may need to use and program a stamp controller.
I need to control a motor that moves a device back and forth between a set of limit switches.
All the mechanics are pre-existing.
There are existing brushed DC motors in the mechanism I am working with so switching to an encoded motor or adding an encoder to the mechanism is not really desireable.
I need to keep the cost down as much as possible, this is just a project for a buddy.
I already have the system working with a Pololu simple motor controller and an analog joystick on the bench.
I now need to extend the working distance of the joystick away from the motor controller.
I do not feel comfortable running an analog circuit long distances so I think I should move to some control method using serial communication.
I have a little motion control experience, but I am more of an analog electronics guy than a programmer, but I'm here to learn...
The basic requirements are very simple:
Variable speed motor control with limit switches
Operator uses a simple joystick to make the motor move and stop.
200ft working distance between joystick and motor controller.
Existing Cat 5 cable in place
Are there off-the-shelf easy solutions to read a couple joystick pots and then generate the serial commands that I can pipe to a motor controller that has integrated limits inputs?
I need to control a motor that moves a device back and forth between a set of limit switches.
All the mechanics are pre-existing.
There are existing brushed DC motors in the mechanism I am working with so switching to an encoded motor or adding an encoder to the mechanism is not really desireable.
I need to keep the cost down as much as possible, this is just a project for a buddy.
I already have the system working with a Pololu simple motor controller and an analog joystick on the bench.
I now need to extend the working distance of the joystick away from the motor controller.
I do not feel comfortable running an analog circuit long distances so I think I should move to some control method using serial communication.
I have a little motion control experience, but I am more of an analog electronics guy than a programmer, but I'm here to learn...
The basic requirements are very simple:
Variable speed motor control with limit switches
Operator uses a simple joystick to make the motor move and stop.
200ft working distance between joystick and motor controller.
Existing Cat 5 cable in place
Are there off-the-shelf easy solutions to read a couple joystick pots and then generate the serial commands that I can pipe to a motor controller that has integrated limits inputs?
Comments
A stepper would be noisy and would draw power all the time unless we got into fancier motor controllers that would turn down the power while resting.
The existing motors are gear motors, they draw less than an amp and run at up to 24v dc, but we find we like the speeds we get when we stay around 18v max.
I'm using a polulo simple controller now, but it does not have enough input channels to setup two limits per axis so I will be replacing the motor controller with something more advanced.
I have found a bunch of robot controllers in the $50 to $100 range that look to be able to do what I need to do at the motor end.
I'm mostly concerned with the joystick end and the communication link.
I think the best way to do it is to keep the power supply and motor wires short and then extend the control signal wires between the motor controller and the joystick/stamp with perhaps RS422.
I would rather stick to a wired connection for noise or interference rejection reasons.
I have driven serial commands down long hardwired runs of copper and fiber for years and they are rock solid reliable unless you cut the copper or fiber.
I have not had the same luck with wireless gear...
Using the parallax joystick and the pdf link above that tobec posted, I ended up with this code that is doing what I need it to do:
The rest of the components are a basic stamp 2 on the homework board and a pololu 18v7 motor controller.
The motor controller has inputs configured for the limit switches.
I'm just spewing a serial command down the output line with the scaled results of the RCTIME input using the mini SSC protocol and all is good!
All that's left is to insert a pair of RS-485 driver chips and 200ft of cat5 cable into the place of the two wires carrying the serial stream now.
Then I will be ready to actually hookup the real motor and put limit switches on the hardware.
Now I have the rs-485 drivers hooked up and its running through 500ft of cat5 cable.