Thứ Sáu, 29 tháng 12, 2017

Auto news on Youtube Dec 29 2017

In this video, I'm going to teach you about servos!

What they are, how they work, and how to use them.

Then I'm going to show you a practical example where we make a simple laser turret!

Finally, I'm going to show you how to program an Arduino to control

the laser turret using a free, open source, visual

programming language called XOD.

What is a servo?

In this context, the term servo is short for servo motor.

The term servo means there is a closed loop control system that accurately

regulates the position of the servo's output shaft.

Now let me go into more detail.

In my previous video about H bridges I showed you a circuit that can control the speed

and direction of a motor.

But that's all it can do.

The motor just moves faster or slower depending on the

duty cycle.

And if you put a load on the motor it slows down.

And there's no way to accurately control how much the motor rotates.

This is what is called an open loop control system i.e. there is no way to regulate

the output, you're just changing the power going to the motor and hoping for the best.

A servo motor is a motor with a closed loop control system.

This means that you do have a way to control the speed and position, regardless of the

load.

Here's how they work.

You've got a DC motor being powered by an H bridge.

Then you have a series of gears to increase the torque of the system.

Most cheaper servos will have a plastic gearing system, but servos designed for higher holding

torque will usually have metal gears.

(alert noise) Metal Gear?!

Yes.

They're very solid.

Next, a servo will have some sort of feedback system that detects the rotation angle of

the output.

It could be a potentiometer, a magnetometer or

an encoder, but for hobby servos it's usually just a

potentiometer.

Inside the servo motor there's some circuitry that compares the user's desired rotation

angle with what the servo's feedback system is measuring.

If the output has rotated even a tiny bit in the wrong direction, it

adjusts the power to the H bridge, and makes sure the output is exactly where it's supposed

to be.

When you put all these things together, you get a very useful building block in robotics.

From simple toys to industrial robotics and animatronics nearly

every robot will have servo motors in some form or another.

There are many types of servos out there, from many different manufacturers, and they

all have different ratings.

The main specifications to look out for are the input voltage range, the stall torque,

and the speed.

You should also be aware of the servo's travel.

This refers to how much the output shaft can rotate.

It could be anywhere from 90 degrees to 200 degrees

or more.

And you can even get servos that continuously rotate.

Servos come in standardized sizes.

These are "standard" servos, and these are sub micro servos.

These would probably be all you'd ever care about

for projects at home, but I want you to be aware that for

bigger robotics projects you can get servos in larger form factors.

If all these options seem overwhelming to you, don't worry.

A good general purpose servo you can use is the Hitec HS-311.

It's been around for years.

It's functional and it's reliable.

In bulk you can get sub micro servos for $2 a pop.

I'll put links in the video description section.

Ok, so now you know what servos are and where to get one.

Let's talk about how to use them.

Every servo will come with a bag of extra parts.

These things are called servo horns.

The output shaft of a servo has these little teeth on them that grip the horn.

Screw the horn onto the output shaft, and then you can

wiggle the horn around.

(Juvenile laughing)

The point of the horn is that you can screw other mechanical parts onto it.

Here's an example where I have some plastic gears attached to the horn, and

when I rotate the servo shaft the gripper opens and closes.

And you can use servos to control pretty much anything mechanical in any axis.

Next let's talk about how to actually control a servo.

In addition to horns, servos also have pigtails.

I swear I'm not making this stuff up.

The colors will be either orange red brown or yellow red black.

Red and brown is where you connect power to the servo, and this

usually needs to be between 4.5 and 6 volts.

So most people use either a 3 or 4 cell alkaline or NiMH

battery pack, or sometimes people will use a 5 volt switch mode power supply.

For this project I'm just going to use my bench power supply set to

5V.

This third wire is where you connect the input signal that controls the servo.

Technically the signal is a PWM signal, but it's a very special PWM signal.

We're going to start by sending out a pulse that is 1.5ms wide, at 50Hz.

And the pulse is 0 to 5 volts.

This will center the servo.

You can repeat the pulses slightly faster or slower than 50Hz and the servo will still

work.

The most important thing here is the pulse width, not the frequency.

If we change the pulse width from 1.5ms to 2ms, the servo rotates clockwise.

And if we change the pulse width from 1.5ms to 1ms, the

servo rotates counterclockwise.

You can move a little further than those extremes, but the standard signal

is expected to be 1 to 2 ms wide.

I've been using a fancy waveform generator to generate these pulses for demonstration

purposes.

But you don't need one of these to do this at home.

It is possible to generate servo pulses with a 555 timer circuit,

but I would not recommend it.

Really the best way to do it is with a microcontroller like an Arduino

because it will give you very precise control over the timing.

Make sure you've watched my previous tutorial on Arduino if you need an introduction,

and then soon I'm going to show you how to use XOD to

create the servo signals.

Okay, let's talk about assembling the laser turret.

If you want, you could simply glue a second servo to a

servo horn, and tape on a laser, but I wanted something a little nicer than that for the

video.

So I ended up buying a pan-tilt servo kit from Digikey.

You can get them pre-assembled or buy the servos separately.

You can use any dollar store laser pointer for

the laser, or you can get them in bulk for even less than a dollar

on Amazon.

The laser modules have integrated resistors, so you just need to give them 3 to 5 volts

and they will work without any special circuitry.

Since they are cheap, I glued two of them onto the pan tilt head.

To control the turret in the X and Y direction, I'm using two 10k potentiometers.

The output of these will feed a 0 to 5 volt analog signal into the

Arduino on pins A0 and A1.

If you're really creative you could hack an old analog joystick to be the controller.

I already mentioned I'm going to power the servos with an external 5 volt supply, and

over here you can see how I'm using Arduino output pins 8 and

9 to feed the servo pulse signals into the servos.

Here's a view of the overall project.

Notice how I have a jumper wire connecting the ground from the external

5 volt supply to the ground of the Arduino.

They both need to have a common ground connection in order

for things to work reliably!

Okay, that takes care of the hardware side of things, now let's talk about programming

the Arduino so we can control the servos with the potentiometer.

We're going to be using a free, open source visual programming environment called XOD.

Go to XOD.io, then click IDE, Download Desktop IDE at the

top.

Register if you want, but I'm going to proceed without

registration.

Now you can download XOD for any of the major operating systems.

After you run the installer and start XOD, you'll be greeted with the option to run through

a set of tutorials.

I do recommend you check these out at some point, but for now let's create a blank new

project.

We give it a name... and now we have a blank space to work with.

So the first thing we're going to do is go to the common hardware list on the left.

You can see a lot of devices are supported but we are just going

to look for pot, short for potentiometer.

And we're going to drag two of them onto the workspace.

These little boxes are called "nodes", and the way XOD works is

you create a bunch of these little nodes that represent inputs and outputs on the microcontroller,

and you connect them with wires in the interface.

Now let's go back to our hardware list and create two nodes for the two servos we want

to control.

And we're going to connect the output of the potentiometers to the servos by dragging a

couple of wires.

At this point I recommend you go to view, toggle helpbar.

This will give you a guide to what all the little

input and output parts of each node are.

For example, a servo node has two inputs: the output port

number on the Arduino, and the value to send the servo.

In this case the servo node accepts a value from 0

to 1 to represent the servo's rotation.

And for the potentiometer, you can see how the output is a value from 0 to 1, depending

on how much you have rotated the potentiometer.

This is perfect, it's exactly what the servo node would expect to see

on the input, so we can connect the two nodes directly with a wire.

Next, for the sake of clarity, we should start giving our potentiometers and servos meaningful

names.

And we do that by clicking on the nodes, and then

typing names into the properties section on the left.

We're just going to call them X and Y potentiometers

and servos.

Now that we have some meaningful names, we can start defining which pins our hardware

is connected to.

I want my X potentiometer input to be Arduino pin A0, so we are okay here.

I want my Y potentiometer input to be pin A1, so let's change the port

number to 1.

I want my X servo output signal to come from Arduino pin 8, so we set that to 8, and let's

make the Y servo signal appear on pin 9.

And that's it!

We're done!

Let's go to Deploy, Upload code to Arduino.

Double check your board type and COM port settings are correct, and hit upload.

It'll take a few seconds to compile the visual, node based

programming into native microcontroller code.

And there you go!

Now we can use the potentiometers to rotate the laser turret in different directions.

But there is a small problem...

I don't like how in the Y direction, the head can move all the way down to

the floor, or point straight up at the ceiling.

I'm not enemies with Spiderman.

I'd rather have it so a full potentiometer rotation will move the servo

up and down in roughly a 40 degree arc.

To do this, let's go back to XOD, and let's browse the list of core nodes.

These are all the different math operations you can do.

We're looking for one called map range.

Let's drag that onto the workspace, and we can delete the existing wire by clicking

on it and hitting backspace.

Then we connect the potentiometer's output to the map range node's

input, and connect its output to the servo.

If we click on the map range node the help bar will explain how it works, and we're going

to make it so that a value of 0 to 1 coming from the potentiometer

will end up being mapped to a value between 0.5 and

0.75 going to the servo.

This should limit the movement of the Y axis servo.

After compiling and uploading the code to the Arduino again, now the travel range of

the Y servo is a lot more practical.

It's a very simple project, but the principles you learned here will apply to building more

serious robots... or more fun robots!

Thank you for watching!

And be sure to check out other videos on my channel to learn more about

electronics.

For more infomation >> Arduino and Servos: How to Make a Laser Turret with XOD - Duration: 12:32.

-------------------------------------------

Networking to Build a Team, What's That? - Duration: 5:00.

Good morning, good morning, good morning. I'm outside so it must be a networking

Thursday. It's freezing outside. Well maybe not freezing but close to

freezing. I think the high's like 40 today, my wife told me. So I'm getting

all set up on social media here. Alright so I got that all set up now. I

like to, I like to come outside for when I talk about networking because I have a

mentor that has a saying that says, you got to get out the house. And that's what

networking is all about. Business networking is all about getting out of

the house. You've got to get out and talk to people. You've got to mingle with

people. You've got to rub shoulders with people. You got to share your elevator

pitch. You got to, you got to talk to people. You got to get out the house. And

so I like to get out of the office and stand here on the patio and freeze my

hiney off so I can I can make a point this morning. And as we're talking about

network marketing, I had a fantastic conversation with the the CEO and

president of the northeast Tarrant County Chamber, one of the chambers in my

local area that I just began going to. And we had a great conversation

yesterday. We talked for about 15 minutes. Wasn't really intending on it but we had

a great conversation. We were talking about networking and particularly we

were talking about building a team. And I think that's one of the biggest mistakes

that new business networkers make is that they don't have a team mindset. They

maybe come from a business, a large organization, that they were on a team or

they led a team but they don't translate that into being

an entrepreneur and how that works. And so maybe they're a solopreneur. Maybe

they're the only one in their business right now and they don't have a team. And

you go and let's say, let's say you're a, you got a car washing business and it's

just you and you go to cars and you wash them. And you've got a friend that

has is a high-end oil change business where

he does high-end cars. Maybe you know European cars, something like that, German

engineered cars and you meet them at a networking event. You're like hey that's

cool man and we can talk car stuff because we're both like cars. That's

great but you never put together that hey maybe that's a potential person that

could be on your team. And what you have to do and what I want to encourage you

to do when you are at a networking event is look for people that you can

collaborate with and put a win-win proposition together. So what does that

mean? What does that look like? Well a win-win proposition for the car washing

guy, the on-demand car washing guy and the high-end oil change guy would be

that the oil change guy says, hey I want to offer free car washes to all of

my people after they get oil change and I want that to be signature

and I want it to be high-end. I want it to be nice. I want it to be a good car wash. And

you say well let's make that happen. Maybe you charge $40 for a car wash

because it's really nice, it's detailed but at cost you can do it for $20. And

your oil change guy, the guy that works on German cars he says I could pay

you $20 bucks. I can factor that into my cost and I want to add that and have it

be a bonus. And you come here on-site and you wash the cars

and I'll line up, like you know you'll have a steady stream of ten a day or

something like that, that you can wash. So you're making money. You're breaking even

but you're also gaining new customers because they only need an oil change

maybe once every three months but they need a carwash every week. And I'm

starting to shiver out here. It's so cold. They need a carwash every weekend so you

just put together a win-win proposition where he's happy because he's able to

offer greater service for his people and you're happy because you have steady

business and opportunity for more business. And that's what I want you to

think about in this new year in 2018. I want you to be thinking about what's a

win-win proposition? What, who is someone in this room that I could connect with

and I could put together a win-win proposition? Collaborate on something we

could both gain more business and more exposure and take advantage of building

a team in our business networking events? Alright I'm gonna end it there because

I'm freezing. But really I want you to be thinking about this in 2018

because this is huge and could be huge for your business. Alright I love you

guys. I care about you. I want to see your business succeed. Please like, subscribe,

comment below and tell me where you're struggling in your business

networking. I'd love to help. Alright bye.

Không có nhận xét nào:

Đăng nhận xét