Hi all,
Thinking of trying this out as a project and wanted to run it past everyone here to see what people think and if anyone has any suggestions or ideas.
Basically I'm going for an LDR style black-line-on-white line follower. However I want it to learn the track the more times it goes round.
Im thinking use a 28X1 as it gives me the 4 PWMs, two of which can drive FETs for the motors, one for each back wheel. My idea at the moment is to have the LDR on the left control the left motor, and right LDR for the right motor. I will ADC the LDRs, and if one starts getting darker the PIC can drop the PWM on that side to slow the motor slightly to steer the buggy into the corner.
As for the memory, I'm thinking use the settimer as a background clock with a 20Hz 555 astable. On the first run, the system pauses every 50ms to check the sensors. Every time it needs to change direction itself it writes the "timestamp" (timer variable) to EEPROM as well as the corresponding speeds of each motor.
On the next run, it only pauses every 100ms, running its recorded program but still checking the sensors. On subsequent runs, it stops less and less frequently until it can do the track without using sensors.
Things I haven't quite worked out:
- How, when going along a straight line, do I stop it "snaking" back and forth across the line?
- How, from the points at which it changes direction, can I create a smooth turn?
- Are there any better ways of making it learn (ie. instead of learning each individual point)?
These are only initial thoughts! If anyone can think of an entirely better way of doing this I'd love to hear it.
Thanks very much,
*j
Thinking of trying this out as a project and wanted to run it past everyone here to see what people think and if anyone has any suggestions or ideas.
Basically I'm going for an LDR style black-line-on-white line follower. However I want it to learn the track the more times it goes round.
Im thinking use a 28X1 as it gives me the 4 PWMs, two of which can drive FETs for the motors, one for each back wheel. My idea at the moment is to have the LDR on the left control the left motor, and right LDR for the right motor. I will ADC the LDRs, and if one starts getting darker the PIC can drop the PWM on that side to slow the motor slightly to steer the buggy into the corner.
As for the memory, I'm thinking use the settimer as a background clock with a 20Hz 555 astable. On the first run, the system pauses every 50ms to check the sensors. Every time it needs to change direction itself it writes the "timestamp" (timer variable) to EEPROM as well as the corresponding speeds of each motor.
On the next run, it only pauses every 100ms, running its recorded program but still checking the sensors. On subsequent runs, it stops less and less frequently until it can do the track without using sensors.
Things I haven't quite worked out:
- How, when going along a straight line, do I stop it "snaking" back and forth across the line?
- How, from the points at which it changes direction, can I create a smooth turn?
- Are there any better ways of making it learn (ie. instead of learning each individual point)?
These are only initial thoughts! If anyone can think of an entirely better way of doing this I'd love to hear it.
Thanks very much,
*j