"Proper" mixing is open to debate :-).
An issue is that you have to make decisions about how fast a track is moving under pure signals from a single pot and what to do when signals from the other pot are included. For example, if you push the FB (Forward-Backward pot fully forwards, and if both motors then run at full speed ahead, how do you deal with the addition of a small amount of LR (Left-Right) pot being added. To get rotation you have to have one track going faster that the other. So, if you are already running at maximum forwards speed on both motors you must decrease one or other track speed in order to turn. But, if you had been standing still you would have accelerated one or other track to achieve the same result.
So, all that said, here is a simple off-the-cuff starting solution out of my head which seems like good start.
If pots are mechanically independant then both can be at 100% simultaneously.
If both are on a joystick type arrangement, if Yaxis = 100% and Xaxis = 0%, then adding some B will usually reduce A. A joystick could be constructed where the above is not true, but these are unusual.
Assume that the joystick is of the type that increasing Y% when X = 100% will reduce X. Other assumptions can be made.
FB = front-back pot. Centre zero, +Ve for forward motion of pot
LR = Left right pot. Centre zero. +Ve for pot at right.
K is a scale factor initially 1.
If any result exceeds 100% then adjust K so result = 100% and use same K value for other motor also.
- eg if Left motor result = 125 and Right motor result = 80 then.
As 125 x 0.8 = 100, set K = 0.8. Then.
Left = 125 x 0.8 = 100%. Right = 80 x 0.8 = 64%.
Then:
Sanity checks:
LR = 0 (centered), FB = full fwd -> Both motors run full forwards.
LR = full left, FB = 0 ->
Left motor runs full backwards,
Right motor runs full forwards.
Vehicle rotates anti clockwise.
FB was 100%, Lr = 0%. Add 10% of LR to right.
L = FB+LR = 100%- + 10%
R = FB-LR = 100%- - 10%
If largest axis < 100%, scale until = 100%.
Then scale other axis by same amount.
Many home made pick and place machines are very similar to CNC milling machines, and this is where you should take your inspiration from.
The machine consists of three linear axes, each of which consists of:
- some kind of linear bearing or rail to allow the axis to slide freely.
- some kind of motor to actuate the movement.
These two parts will probably make up the bulk of the cost of your machine. Your budget is extremely tight; you're looking at less than $20 per axis! I'm tempted to say that this is impossible, but I hate naysayers, and I love a challenge.
As you've already pointed out, your design is flawed because there's nothing really to prevent rotation of the parts on the threaded rods. It's also missing the important rotary axis which is needed to rotate the parts to the correct orientation before placement. Some designs get around this by placing some of the parts, then asking the operator to rotate the PCB 90ยบ, then placing more parts, etc. You might want to take this option.
Your real problem is the budget, and you're going to have to work very hard to either make many of the parts yourself (those that you can make) or find those parts cheaply somehow (perhaps from broken down machines). One place you look is in old printers. They contain quite nice linear rails which you can salvage, including a fast motor and encoder strip.
Motors: There are two types of motor you can choose from:
- Servo Motors. You'll basically be making these up yourself. They consist of a DC motor, electronics to drive the motor, a sensor to measure the position of the motor, and a controller which calculates how much power to apply to the motor to get it to the correct position quickly and accurately.
- Stepper Motors. This type of motor doesn't spin freely, rather it can be commanded to move one step at a time. You don't need a position sensor, but you do need to keep track of exactly how many steps you've made in each direction to know exactly where you are, and how far you need to go to get to your next position.
I would recommend the stepper motor approach. Most small CNC machines use these. You should also try to find a driver which supports some microstepping. Not only does this increase your resolution, but it also helps overcome resonance at certain speeds. If you want fast motion, then you'll need acceleration. If you're accelerating, then you'll likely hit the motor's resonant speed and miss steps.
Resolution: High resolution is not that difficult to achieve. For example, if you're using a stepper motor with 200 steps per revolution, driving an M8 threaded rod (which has a 1.25mm pitch) then you can expect each step to produce 1.25mm/200 = 0.00625mm of movement. However, that doesn't mean that your machine is accurate to 0.00625mm. Thread non-linearity, backlash, step drift, and other factors will conspire to increase your error.
Software: Writing the software for this kind of machine isn't that difficult, but it all takes time. Why not check out The Open PNP Project. Their software is already full of features.
Complexity: Unfortunately, as with all robotics projects, you start off with grand goals of simplicity. You can often get simple things working quickly, but you eventually discover that you do need quite a lot of complexity to get things working well, reliably and for a long time. There is no particular problem having the PCB move on one axis, and the head move on another axis. One might think that the moving PCB will shake of the components, but this is unlikely to be a problem. The components are usually very light (unless you're placing large connectors or very large ICs) and they're stuck in a blob of solder paste. I often clumsily manhandle by PCBs into the reflow oven, and I've never seen a part slide out of place. However, if you have a lot of parts to place, then you're moving quite a large table around, and you'll need longer rails and a stiffer table.
Pick up: This is going to be another expensive part, unless you want to suck on a tube to pick up each part. Vacuum pumps can be surprisingly expensive (if your budget is only $100) and you'll also need a valve. You may also need to make a removable pick head so that you can pick parts of different sizes. Small parts need a small tube (obviously) but big parts need a larger tube because they're heavier, and need more surface area for the vacuum to operate over.
Best Answer
How is motion feedback produced? The first time I tried to program a robot with motion feedback (decades ago), I failed to consider that motors could coast a little bit when they were powered off, and so attempting to move the motor e.g. 23 pulses would sometimes cause it to move 23 and sometimes 24. That could cause the next move to be processed incorrectly. To solve such problems, one should (1) slow down the motor as it approaches its destination, and dynamically brake it when it reaches its destination, to avoid or minimize overshoot, and (2) use a constantly-modified quadrature encoder to determine when overshoot occurs, and adjust the next move request based upon the overshoot (each count of overshoot should shorten the next move by a count if it's in the same direction, or increase it if it's in the opposite direction).