My daughter got a
Velleman KSR6 kit for Christmas, and the other day she finished it's assembly. We tested it out and it's motors ran as they should, but the robot didn't turn when closing in on objects. I sighed a bit and started troubleshooting. When looking into the design I started thinking it actually was quite cool. It's control system was made from four op-amps. No digital circuitry at all. I can't publish the whole schematic here, since it's copyright Vellemans, but it can be found in the manual in the above link. I made a simplified Spice simulation of the circuit and made some comparing measurements. I'll briefly explain what the different parts do and compare simulations to measurements:
|
Simplified LT-Spice schematic drawing |
U1
A pulse of about 1ms is fed through the DC-blocking C1. The pulse in the actual design comes from the IR-diode, which picks up reflected IR from the IR-LED.
U1 is simply a non-inverting amplifier which is AC-coupled using C2. C2 makes the gain roll of to unity at DC.
|
The big pulse is from the IR-LED, for triggering purposes. The small pulses are from the U1+ node, a high pass filtered pulse. |
|
And the same filtered pulse in LT-spice. Very similar to reality. |
U1 amplifies the positive going pulse to look like this:
|
Amplified pulse, almost rails the output of U1. |
|
Amplified pulse of U1, looks very similar when simulated. |
U2
This is an emitter follower with a diode on the output and a bleeder resistor to ground. U2 can only source current to node U3+. After U3+ is charged,the voltage is kept high by C3 and R4 for a while.
|
The small pulse of node U3+ is not what we expect. |
|
The simulation shows what I expected. A high step that slowly bleeds out through R4. |
So the problem is probably in node U3+. Perhaps a bad connection to the cap or a bad cap. I'll look more into it. In the following sections I'll just explain what is supposed to happen and show the simulations.
U3
Is a slow integrator that keeps the output high while U3+ is discharging. If the original incoming pulse (at U1+) is smaller than some threshold, U3o won't have time to integrate to any significant level before U3+ is discharged. U3o then stays low.
|
U3o when it has had time to integrate to a high voltage level. |
U4
This is a comparator. If U3o is over 3V, U4o drops to it's lowest level. If U3o is below 3V, U4o kicks up to it's max output.
|
Complementary outputs of U3 and U4 |
U3 and U4 has complementary voltage levels at their outputs and the are used to drive the H-bridge to one of the robots motors, making the motor reverse for a while when the robot receives a big echo from it's IR-receiver. This makes the robot back out and spin 90 degrees before continuing forward.