RD01 (MD23) and picaxe 40X1 issues

taux3

Member
Dear all,

I have interfaced a picaxe 40X1 with the RD01 drive system (http://www.robot-electronics.co.uk/shop/Motorsx47Wheels2094.htm) and although they "talk" to each other I am getting a weird behaviour.
This is what my code looks like


start:
i2cslave $b0, i2cslow, i2cbyte ' setup i2c port for MD23
t1:
writei2c 0, (255,255) 'both motors full speed forward
pause 5000
writei2c 0, (128,128) 'both motors stop
pause 5000
writei2c 0, (0,0) 'both motors full speed backward
pause 5000
writei2c 0, (128,128) 'both motors stop
pause 5000
goto t1

The motors actually go forward for about 3 secs, then stay still for about 12 secs, then go backwards for about 3 secs and then stand still for 12 secs.

It looks like it is a timing issue because when I try the following:

start:
i2cslave $b0, i2cslow, i2cbyte ' setup i2c port for MD23
t1:
writei2c 0, (255,255) 'both motors full speed forward
pause 1000 '1 sec delay
writei2c 0, (0,0) 'both motors full speed backward
pause 1000
writei2c 0, (128,128) 'both motors stop
pause 1000
goto t1

It goes forward for more time than it goes backwards, although it should be the same (1 sec)
Finaly if I reduce all the delays to pause 100 it all goes bananas doing random actions. Especially if I press reset in the micro the motors start turning even in different directions (between each other).

Does it have to do with the acceleration rate register ? I have tryed to set it to 10 (i.e,. fastest responce) using writei2c 14, (10)
and still no change maybe a bit more consistent action.
Is there a way to disable the acceleration ? I am trying to do line following robot and I need quick motor respone to follow the line curves at fast driving speed.
Also have you had allen screws undone in the wheels after some motor use (3 days of experimenting with a 4Kg robot) ? Is it wise to use some locktite in the threads ?

Regards
Antony
________
silver surfer vaporizer
 
Last edited:
Top