Motor control

I have the following small problems:

In the beggining I had them posted in the wrong place,

So i moved them here:

Problem one: i tried hooking up two motors.

they both had one wire soldered up to V2, and the other one to outputs (6 and 7). i now typed this code:

main:

high 6

high 7

pause 3000

low 6

low 7

pause 1000

goto main

notning happened. any ideas?

PS: i dont have a motor drive.

 


Now for the next important question,

 

does this look about right?

Picture_028.jpg

I just dont want to make my picaxe 28x1 go up in flames.

its a 5V regulator by the way. And yes, i am going to put a 9volter in there.

 

regulator

Nick,

It’s always a good idea to protect your expensive electronics with regulators. But I never worked with these voltage regulators. All I can do is read the docs I would find on internet. I’d rather let a more experienced LMR member answer this question.

without motor driver

I doubt that your microcontroller is capable of supplying enough power (current) to a motor, even if it is a little one.

From what you describe I understand that you connected it like this:

Is that correct? I am making a lot of assumptions here. Please check all of them:

V2 has power? V2 has 5 Volt? or 9 Volt? Can you confirm this with a meter?
Your micro controller is connected to its own power V1? That is 5 Volt? Did you measure it?
Your motor works when you connect it directly to your power source? Which way is it turning? write down how you connected it!

Alright, you checked it all, now let's examine that circuit you built. Your micro controller is behaving like a very expensive, but very little switch. Sometimes your output pin is connected to Vcc (V1= 5 Volt). This is called high in your program. Sometimes it is connected to ground. That is low.

Can you see how the current flows through your switch and motor when you tell it to go high or low? Remember, electricity always goes from the higher to the lower voltage. Just like the water flows from your Swiss mountains to my Dutch basement.

;-) Rik

Test first

For your first question: It is never a good idea to hook up your motors directly to output pins. But since I think I’m seeing a tiny corner of a picaxe 28 starter board in your picture, i asume you hooked it up with the darlington chip in place. In that case it sounds like the motors are connected right. Show us pictures of the setup otherwise we have to guess how things are connected.

In answer to your second question: The way to tell if you connect the voltage regulator correct, is to test it. You should get a multimeter and measure the voltage between the middle leg and the right leg (in the picture). Be sure to disconnect it from the picaxe first before you hook up the 9V.

According to this

According to this http://www.datasheetcatalog.org/datasheet/stmicroelectronics/2143.pdf - (if its a L7800 series - kindof hard to see) - that would be correct

pin 1 input
pin 2 gnd
pin 3 output for up to 1.5 Amps

When interfacing electronics to motors I “should” always use optocouplers, but I dont…

I don’t ever allow digital inputs or output sink or source motor current.

From small to large motors you can wire it this way. - it accepts TTL voltages (TTL is transistor to transistor logic) , which in a nutshell means 0 to .8 V is off and 2.2 to 5 Volts is on.

ttl2.jpg

 

GroG
my robots
my garden

sorry,

sorry if im a bit dull, but i dont get most of the stuff you guys are telling me. but i apprieciate the help all the same^^.

i just want to know how to hook up two motors, and the code i need to use them. but yes, they do work with 5V. in fact, theyre

too fast. way too fast.

Picture_029.jpg

language or techno?

Nick,

Is it the english language that makes it hard to understand us? Or is it the technology stuff?

(or both)

Rik

its not the volts that’s the

its not the volts that’s the issue, it’s the amperage. The digital outs on an MCU are only going to supply maybe 100ma I think(don’t know exact figure), you need to use a transistor, relay, or h-bridge as a switch, then the MCU just flips the switch, rather than actually supplying power directly to the motor. regular hobby motors like you have pictured will need as much as 1A perhaps at stall. plus, the feedback from the motors could possibly fry your MCU…

one of the above posts has a good drawing of how to connect a transistor to be your switch, but if you want the motors to spin both ways, you need an h-bridge, and for that I suggest you check out the first robot tutorial https://www.robotshop.com/letsmakerobots/start if you are using picaxe, and https://www.robotshop.com/letsmakerobots/node/2038 for arduino, or https://www.robotshop.com/letsmakerobots/node/2074 for general info on h-bridges.

also, your motors need gearboxes, it doesn’t look like they have any…

good luck!

BTW: since you mention you are using a PICAXE 28x1, the picaxe first robot tutorial above will show you how to use a L293 chip with that board specifically, the chip itself should be cheap, sparkfun has them for <$3

:slight_smile:

I can see a couple problems, here…

First of all you need a L293D Motor Driver --There is a space for it on the 28 board and you will also notice 2 connections A and B that will go to your motors. Second, it seems that you glued the motor shafts directly to your wheels. This is a no-go as well. Mind you, the motor driver will run these motors quite well, but they will never make any kind of chassis go -You need some gearing. It seems a lot of your questions could be answered by going through the “Start Here” post including some great little motor/ gearbox motors and wheels you could use to get yourself started.

If nothing else, I would say to knock it off with the motor straight to the Picaxe business --This could easily release the magic blue smoke (not a good thing).

My advice, grab a beer (I recommend Pabst Blue Ribbon) and just take an hour or so to cruise the forums. --There is a ton of posts from people who have had the same problems you are having.

One more…
When you go to code your stuff using the picaxe programming editor, take a sec to check under the "help" menu. All the picaxe manuals are there in PDF form as well as the manuals that go with all the picaxe boards. These are a goldmine of info and I find myself using them everytime I write code.

Chris, dude!

Check the guy’s profile. He’s turning like 12 in three weeks from now!

Forget the beer comment Nick. But DO take Chris’ advice on reading the forums and the start here instructions.

And ask questions here. The forum needs to eat too!

Rik

Ohh

oh, no its defenetly not the language. Im a fully bred 100% USA citizen.

sure, spelling isnt my strong suit, but it nevers was or will be.

Its mostly the Techy stuff and the drawings… they make my head spin.

Ok

I know iv sort of been taking the easy way out… and im sorry for asking for the info

to be served on a gloden plater. ill try better.

just one question: are you sure about needing gearboxes? and why? i hooked the up to a 4.5 V batterie, and they maneged to drag pretty fast…

The motors aren’t geared so
The motors aren’t geared so they will spin fast, but when you put it on the ground they likely won’t move or will take a while to get up to any sort of speed. This is because torque is low very low. Check out the post Fritz did on gearing. It will give you a lot more info that you ever wanted!

easy to test the need for gears
Just build a little vehicle with these motors and these wheels and the same battery. See if it will run. See if it will run if you put some more weight on it. Could be just a plank with 2 wheels.

Sorry 'bout the beer reference…

Yup Rik,

I didn’t notice the profile… Wow, '96 --That’s after I graduated! Man, I’m old.

Allright Nick, everything ELSE (except the beer) still stands. I really can’t stress it enough, the picaxe manuals are gold. The BASIC one has great snippits of code to study and the ones for the picaxe boards are great when you need to double check a pin arrangement or whatever.

And for the record, I was about 12 when I first played around with BASIC. Of course then it was on a TRS-80. --Do a google search for that if you want a laugh at us old folks.

Keep it up, dude you’ll get it.

I was 8 when I wrote my

I was 8 when I wrote my first program on an Apple IIe. Then it was on to basic using an IBM clone running Win 3.1. Man those were the days. PCs were stupid and that’s the way we liked it!

Anyway to keep this mildly on topic. Don’t try to start big. If you scan the forums people who tried to start big got frustrated and never made a robot. Those that started making an LED light up using a PICAXE then made it blink, then added a motor, then… went on to make some nice bots. ALWAYS start small. You have a lot to learn and trying to skip past the beginner stuff will only make it take 10 times longer to make something it will also frustrate you to no end.

There are a few tutorials about how to make a LED blink or even light up using a breadboard on this website. I highly recommend you look through the tutorials and start small.

Hi Nick,For reference I made

Hi Nick,

For reference I made a motor control component node. It might be too much information for you at this point, but use it as a reference. In turn, I need your help to point out parts you do not understand, need more explanation, or areas where I have made general assumptions which beginners might not get. I would like it to be useful from absolute beginners to EE majors, so any input, questions, or suggestions you might have would be greatly appreciated.

GroG
my robots
my garden

ok…

im still a bit confused, so im just going for THe L23D motor drive, just like the start here.

BTW: are these good geared motors?

Picture_030.jpg

Yes, No, and Maybe. It

Yes, No, and Maybe. It depends on the RPM of the motors, the required speed of the bot, and the required torque of the bot. If you have a heavy robot you need more torque than speed. If your bot is light and you want it to mvoe fast, you want a motor with faster RPM and a gear ratio that keeps the RPM high. If you look at a car the lower gears may have a 200-1 ratio. In other words while you are moving slower the engine turns at 2000 RPM but the tires rotate only 10 times per minute. At a higher gear the gear may be a 1-1 ratio (every time the motor turns the tires turn at the same rate so at 2000RPM the tires are turning at 2000RPM).

Why would you do this? Well when the car is stopped a 1-1 ratio would put a LOT of force on the engine to try to turn the tired from a stopped state. With little torque the engine wouldn’t be able to budge the car and your transmission goes BOOM! When travelling at high speeds you need a smaller gear ratio or you engine would over heat from turning too fast. When moving quickly you don’t need the torue (unless you are going up a steep hill).

Long story short this gear box may or may not work. It depends on the RPM of the motors and the ratio of the gears that are attached.