Let's Make Robots!

How to control the motor speed on picaxe28x1?

Hello,

i've build the "start here"-robot version 2.0 (http://letsmakerobots.com/start) and

did a lot of programming for fun to control the robots functions via serialport commands.

No problems so far. Lights on off, Sound output. Move forward, backward, turn, and so on.

My next challenge is to control the motor speed (from slow to faster to maximum speed) but

at the moment I have no proper solution. I tried using "pulsout" and "pwmout" command.

Has anyone tried something similar, using the default tutorial hardware settings and pins?

Is my approach even possible on picaxe28x1?

Would be thankful for any idea, example code or solution.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I found a link to a forum post on this site that might help. http://letsmakerobots.com/node/20374

The "standard" 28x board, using a 28x1, has "regular" output pins going to the motor driver. Even if you wanted to PWM one of the direction pins (which would work) it is simply not wired that way. The only way to get a PWM signal to any pin on the motor driver would be to physically cut traces and re-route with hand-soldered jumpers.

 

I have read about a way around cutting traces that requires some care. Pull the L293, carefully bend pin 1 and pin 9 (pin 1 is nearest the dimple and pin 9 is the bottom of the other side) outward about 90 degrees, replace the chip in the socket, solder a couple wires (one per pin) 4" or so was suggested, plug said wires into PWM 1 and 2 on the board.

I sure hope I was clearer than mud.

The 28X1 can do PWMOUT but the command shares the same internal timer as the SERVO command so you can't have both at once (28X2's have additional timers to work around this issue). The 28 project board is not the best for speed control of the motors either. Usually you PWM the enable lines on the motor driver to control speed. On the 28 project board the enable lines are hardwired into V+. It would be a somewhat difficult process to modify the board to accomodate PWM on the motor driver enable pins.