Software > Software

Help with algorithm for grid solving

(1/3) > >>

Ankit Virdi:
I am using 5 sensors and 2 dc motors. I want to turn my bot by 90deg at a node. I am doing that using delay, the problem i am facing with it is as my battery goes a bit down my delay changes. Is there any other algorithm for 90deg turn as I am not using stepper motors.
here's the code
#define S3 (PINA&(1<<3))
#define S2 (PINA&(1<<2))
#define S4 (PINA&(1<<4))
#define S5 (PINA&(1<<5))
#define S1 (PINA&(1<<1))
void main()

If you need to continue to do this open loop you would need two things - an input to measure your battery voltage (voltage divider into an A/D) and some data that lets you write a function to determine how long to delay for the 90 degree turn.

Other options would be rotation sensors on the wheels, compass sensor or gyro sensors.

Ankit Virdi:
Can I not do it with just the sensors I have? How is this guy doing it?

That guy is using infrared sensors to track the black lines on the ground.

Ankit Virdi:
How is he turning his bot 90deg and 180deg?
By giving specific delays? or is there any other method?


[0] Message Index

[#] Next page

Go to full version