Uncategorized

Choosing motors

Choosing motors

Locked37 posts 

SimonyeeePosts:1Joined: 2019-Feb-23 Sat 5:17 am

Choosing motors

2019-Feb-23 Sat 5:13 pmHi all,

I recently started working with the Raspberry Pi and now I wanted to build a robot and I don’t know which motors to choose.
My robot will be approximatly 20cm x 20cm x 20cm and I want to use 4 motors for 4 wheels. The robot should be able to drive really straight, so sometimes it has to travel 1 meter and should stay on the exact line and not change its orientation. It should also be able to do this if there is more weight on one wheel, because of an uneven ground. If possible it should also be affordable.

I would be really thankful if you could give me suggestions or links to tutorials.
Simonyeee

User avatar

Joel_MckayPosts:295Joined: 2012-Nov-13 Tue 6:22 amContact:Website 

Re: Choosing motors

2019-Feb-23 Sat 10:11 pmYou probably could use $2 stepper motors with gear-boxes for such a small platform (700g/cm). This would allow you to easily keep the two wheels on each side synced while moving. However, you may want to think about the zero turning radius a normal turtle-bot platform gets with only 2 motors (have a look at how the Roomba was designed).

In general, dead-reckoning a small platform is a lot harder than it looks, as odometer based control-loops are not perfect.
;-)

Best of luck,
JpcmanbobPosts:11635Joined: 2013-Jun-01 Sat 5:28 amLocation: Mansfield UK

Re: Choosing motors

2019-Feb-23 Sat 10:53 pmHi.

No matter what motors you use there will always be a slight variation between the drive on each side of your robot just because of slippage between wheel and the surface its running on, any unevenness in the surface will also cause the robot to turn due to each wheel having to travel a different distance to get to the same point.

These differences may be very small but they can soon start to mount up if you are using dead-reckoning.We want information… information… information……………………no information no help
The use of crystal balls & mind reading are not supportedInfravioletPosts:24Joined: 2019-Jan-31 Thu 6:47 am

Re: Choosing motors

2019-Feb-24 Sun 2:37 amPost #2, stepper motors with gearboxes for £1.54? How physically small, how much torque possible from them? I’d be interested to know for future projects of my own.

User avatar

Gavinmc42Posts:6044Joined: 2013-Aug-28 Wed 11:31 am

Re: Choosing motors

2019-Feb-24 Sun 9:52 amNot much torque with those tiny steppers, the gears help but that makes it slower.
Steppers have the most control for synchronized speed, but wheel slip is the next issue.

Some of my bots with DC brush motors actually have a mechanical clutch to lightly lock the wheels together.
DC motors with good gearboxes and a tacho (magnetic or opto) sensor are getting common.
To avoid wheel slip, tracks are much better for straight line travel.
Sumo bots have very sticky wheel treads and low duro rubber tires.
Sumo bots also probably have the best motor/wheel/tire tech and much is DIY.

A new way of compensating is with motion sensors, ie optical mouse type positioning.

A 20x20x20cm bot is too big for those tiny cheap steppers even if using 4 of them.
Would 4 x 17 size steppers work? or two with tracks?
What speed do you need?

I hate DC motor gear noise and I’m looking at magnetic gearboxes.
A magnetic clutch to lock the wheels might work, have not seen that done yet.
I have seen those FPV/Drone camera gimbal motor start being used now.
They are basically drone motors rewound with finer wire and run as 3 phase steppers.

Currently best motor tech is in those drone motors, controllers are setup setup for speed control and not positioning control.
Some of the controllers are hackable, so they could be changed for this application if there was something like an encoder input option.
They would make serious kickarse servo motors for CNC mills, 3D printers etc.
But using these then is more a matter of picking best motor controller.
I have not seen any suitable yet, but have not checked recently, kickstarter project?I’m dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar

Joel_MckayPosts:295Joined: 2012-Nov-13 Tue 6:22 amContact:Website 

Re: Choosing motors

2019-Feb-24 Sun 7:01 pmInfraviolet wrote: 2019-Feb-24 Sun 2:37 amPost #2, stepper motors with gearboxes for £1.54? How physically small, how much torque possible from them? I’d be interested to know for future projects of my own.Modding the 5v version of the $1.60 28BYJ-48 for the more powerful bipolar mode is easy, and allows on to use current-regulated Pololu A4988 Stepper Motor Driver modules. https://www.youtube.com/watch?v=jHLyJbNgcDo
Apparently one can get 800g/cm torque out of them for repeatable positioning, but some types have a slip clutch given they are used as air conditioner vent nozzle actuators.

As with any hardware problem, the old joke really does apply. ;-)
“Fast, good or cheap. Choose two”
Since people probably want to start with something more forgiving of mistakes, than I assume slow and cheap are appropriate design priorities.

People have already 3D printed robot chassis for these:
https://www.thingiverse.com/thing:2779252

Good luck,
J

User avatar

Gavinmc42Posts:6044Joined: 2013-Aug-28 Wed 11:31 am

Re: Choosing motors

2019-Feb-25 Mon 7:41 am“Fast, good or cheap. Choose two”The Pi’s are one of the few things that break that old triangle.
Modding the 5v version of the $1.60 28BYJ-48 for the more powerful bipolar mode is easy,Have not tried that, probably worth trying if the weight of the bot can be kept low.
Chassis of foamcore board?
With 4988 or similar from Ti, use 3S or 4S Li Po battery pack to drive those steppers faster.

Those steppers only have a ferrite magnet, could they be upgraded to rare earth?
There are supposed to be two versions 64:1 and 16:1 reduction.
Too much torque will stuff those plastic gears, they have a tiny tooth profile.I’m dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Feb-25 Mon 10:03 amGavinmc42 wrote: 2019-Feb-24 Sun 9:52 amDC brush motors have a mechanical clutch
DC motors with good gearboxes and a tacho (magnetic or opto) sensor
Sumo bots have very sticky wheel treads and low duro rubber tires
A new way of compensating is with motion sensors, optical mouse type positioning.
I hate DC motor gear noise and I’m looking at magnetic gearboxes.
I have seen those FPV/Drone camera gimbal motor start being used now.
3 phase steppers, drone motors, controllers for speed control and not positioning control.

Magnetic Gearboxe Motor

Never heard of magnetic gear. What is that? I only know metal and plastic gears. 

I am starting a newbie motor project this Monday. Usually first thing first is check out Lady Ada. Her TT (Twin Turbo) motor looks good. So I will order one from TaoBao (Not AdaFruit, too expensive!  )

AdaFruit 3V-6V DC 200rpm TT Gearbox Motor – $2.95
https://www.adafruit.com/product/3777
https://www.youtube.com/watch?time_cont … rIfFRchgn8 (youtube)

AliExpress Yellow DC 3V-6V Dual Axis Gearmotor TT Motor Gear Reducer Motor For Arduino Smart Strong Magnetic with Anti-interference US$1.52
https://fr.aliexpress.com/item/Jaune-DC … 40455.html

TaoBao DC3V-6V Gear Motor TT Anit EMI 4WD – CN¥3.21 (x0.15 ~=US$0.5)
https://detail.tmall.com/item.htm?spm=a … 280dd2cbI am an electronics and smart home hobbyist.

User avatar

Gavinmc42Posts:6044Joined: 2013-Aug-28 Wed 11:31 am

Re: Choosing motors

2019-Feb-25 Mon 10:59 amhttps://en.wikipedia.org/wiki/Magnetic_gear
I get magnets from here, trying to figure out if a high ratio magnetic worm drive gear box could be made
https://supermagnetman.com/

Those TT motors are the best value for hobby bots, good to learn on.
And once those cheap motors wear out you can replace them with lower current, higher voltage 12V ones.
Because they are cheap speed can be dependent on brush wear.
Try driving in a straight line.

Replacement RS-130 size motors are low cost, even here only $1.I’m dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Feb-25 Mon 12:26 pmGavinmc42 wrote: 2019-Feb-25 Mon 10:59 amThose TT motors are the best value for hobby bots, good to learn on.
And once those cheap motors wear out you can replace them with lower current, higher voltage 12V ones.

DC3V TT Motors and DC12V N20 Motors

Yes, my plan is to upgrade to 12V motor later for the following reason.

I am playing with power MOSFET IRL540N to PWM motor speed control . This MOSFET seems to like voltage higher than 6V.

…Attachmentsgear_motor_2019feb2501.jpggear_motor_2019feb2501.jpg (189.46 KiB) Viewed 5461 timesI am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Feb-25 Mon 1:24 pmSimonyeee wrote: 2019-Feb-23 Sat 5:13 pmThe robot should be able to drive really straight, so sometimes it has to travel 1 meter and should stay on the exact line and not change its orientation. It should also be able to do this if there is more weight on one wheel, because of an uneven ground. If possible it should also be affordable.
MPU6050 MEMS 3 axis gyroscope and accelerometer

Perhaps you might like consider the cheapy mems gyro-accelero mpu6050. You can drive laser straight, say less than one degree deviation in 1km, and keep track your 3D position as precise as 1mm (my guessestimate, no guarantee, though). 

AliExpress GY521 3 axis gyroscope MEMS and 3-axis MEMS Accelerometer Module MPU-6050 gyro Digital Module Motion processor US$2.54
https://fr.aliexpress.com/item/1pcs-lot … 32137.html

…..Chip: MPU-6050
…..Power Supply Voltage: 3v ~ 5v
…..Communication Mode: Standard IIC Protocol Communication;
…..Integrated 16bit AD converter, 16-bit data output
…..Angular velocity sensors: ± 250, ± 500, ± 1000, and ± 2000 ° / sec
…..Accelerometer range: ±2G, ±4G, ±8G and ±16G

TaoBao HMC5883L 3-Axis Magnetometer
https://detail.tmall.com/item.htm?spm=a … abbucket=6

HMC5883L Triple-axis Magnetometer Board – US$9.95
https://www.adafruit.com/product/1746

MPU-9255 HMC5883 MAG3110 LSM303DLH Magnetometer/Accelerometer

Arduino Self Balancing Robot Using MPU6050 (youtube)
https://www.youtube.com/watch?v=I6z26LVu5y0
…Last edited by tlfong01 on 2019-Feb-25 Mon 10:56 pm, edited 1 time in total.I am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Feb-25 Mon 2:41 pmtlfong01 wrote: 2019-Feb-25 Mon 12:26 pmGavinmc42 wrote: 2019-Feb-25 Mon 10:59 amThose TT motors are the best value for hobby bots, good to learn on.
And once those cheap motors wear out you can replace them with lower current, higher voltage 12V ones.

Rpi 3V GPIO Direct Drive 12V IRL540N PWM DC3-6V TT Motors

I guess 12VDC low duty cycle PWM can drive 3-6VDC motor with little risk of frying any. Just in case, I have loads of CN¥ 0.5 motors standing by for frying anyway.:mrgreen:

…Attachmentsirl540n_tt_motor_2019feb2501.jpgirl540n_tt_motor_2019feb2501.jpg (129.22 KiB) Viewed 5439 timesLast edited by tlfong01 on 2019-Feb-25 Mon 4:04 pm, edited 1 time in total.I am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Feb-25 Mon 3:54 pmtlfong01 wrote: 2019-Feb-25 Mon 2:41 pmtlfong01 wrote: 2019-Feb-25 Mon 12:26 pmRpi 3V GPIO Direct Drive 12V IRL540N PWM DC3-6V TT Motors
I guess 12VDC low duty cycle PWM can drive 3-6VDC motor with little risk of frying any. Just in case, I have loads of cheap, CN¥ 0.5 motors standing by to fry! 
Vgs 5V 1kHz 5% Duty Cycle Square Wave Driving Vcc 12V IRL540N with RS130 3~6VDC Motor

Everything looks OK. I started with 5% duty cycle and the little motor barely moved. Multi meter displayed around 120mA (rms, I think). Motor moved faster and faster as the duty cycle was increased. (Instead of the Rpi GPIO, I am using a DSP signal generator (40 yuan), because I don’t have that many Rpi’s to fry!)
…Attachmentsirl540n_rs130_3v6v_motor_test_2019feb2502.jpgirl540n_rs130_3v6v_motor_test_2019feb2502.jpg (173.23 KiB) Viewed 5418 timesI am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Feb-25 Mon 5:24 pmInfraviolet wrote: 2019-Feb-24 Sun 2:37 amPost #2, stepper motors with gearboxes for £1.54? How physically small, how much torque possible from them? I’d be interested to know for future projects of my own.
Second Hand, Taken-Out-From-Machines Stepping Motors

When I first learnt how to play with stepping motors, I bought a couple from TaoBao second hand shops.

They sell those “taken out from machines” at as low as one tenth of the new price, some new CN¥200 motors down to CN¥20 second hand. I knew stepping motors have no brushes to wear out, only the connecting wires are broken. So I think they were worth my money.
:mrgreen:

TaoBao 2nd Hand Oriental 42 Series Two Phase Stepping Motor PK245-01A 1.2A 4V 3.3R – ¥33
https://item.taobao.com/item.htm?spm=a2 … t=6#detail

Second Hand Stepping Motors
https://www.taobao.com/list/product/%E4 … %BE_1.htm

Alibaba New Vextra Oriental PK245-01A Motor
https://tw.1688.com/item/-706B3234352D3 … DB4EF.html

Big Stepping Motors
https://www.raspberrypi.org/forums/view … r#p1355744
…Attachmentspk245_stepper_2019feb2501.jpgpk245_stepper_2019feb2501.jpg (152.06 KiB) Viewed 5400 timesI am an electronics and smart home hobbyist.

User avatar

Gavinmc42Posts:6044Joined: 2013-Aug-28 Wed 11:31 am

Re: Choosing motors

2019-Feb-25 Mon 7:49 pmYep stepper motors pretty much last forever.
Pulling old stuff apart is a good way to start a collection.

Some of my best servo robot motors came from old reel to reel mag tape computer drives.I’m dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Feb-25 Mon 8:25 pmtlfong01 wrote: 2019-Feb-25 Mon 3:54 pmVgs 5V 1kHz 5% Duty Cycle Square Wave Driving Vcc 12V IRL540N with RS130 3~6VDC Motor
DC Motor Characteristics

Geared motor seems to take smaller current than no gear motor. I am a little bit confused. I only remember the DC motor characteristics is a bit difficult to understand. So I read my old diary to refresh my memory.

Voltage, current, torque and speed in DC motors – Electronics StackExchange
https://electronics.stackexchange.com/q … -dc-motors

Pololu Motors and Gearboxes
https://www.pololu.com/category/22/motors-and-gearboxes

RobotShop Motors and Actuators
https://www.robotshop.com/en/motors-actuators.html

Pololu Stepping Motors Catalogue
https://www.pololu.com/category/87/stepper-motors

My DC Motor Journal
https://penzu.com/p/a25b1076…Last edited by tlfong01 on 2019-Feb-26 Tue 8:58 am, edited 1 time in total.I am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Feb-25 Mon 9:29 pmSimonyeee wrote: 2019-Feb-23 Sat 5:13 pmMy robot will use 4 motors for 4 wheels.
TB6612 Motor Driver Module

You might also like to consider motor driver modules. I would recommend the cheapy TB6612 motor driver module. Like AdaFruit, SparkFun gives very good tutorials, but their stuff is a bit expensive. 

SparkFun TB6612 Motor Driver – US$4.95
https://www.sparkfun.com/products/14451

AliExpress TB6612FNG Double Motor Driver Module – US$1.31
https://fr.aliexpress.com/item/Hot-TB66 … 2773ceada8

TaoBao TB6612FNG Double Motor Driver Module – CN¥13.85
https://detail.tmall.com/item.htm?spm=a … abbucket=6

SparkFun TB6612FNG Hookup Guide
https://learn.sparkfun.com/tutorials/tb … 1545628477

EPIC “ROBOT SUMO WRESTLING”! ロボット相撲 – 3,352 views
https://www.youtube.com/watch?v=Ykou5fHQqGM

International Robot Sumo Tournament 2016 – 17,987 views
https://www.youtube.com/watch?v=orVAhhQAJ_c

International Robot Sumo Tournament 2013 – 25,547 views
https://www.youtube.com/watch?v=WXEZh30xZqY

International Robot Sumo Tournament 2014 – 17,927 views
https://www.youtube.com/watch?v=aF0gDTbcOxEI am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-11 Mon 12:18 pmGavinmc42 wrote: 2019-Feb-25 Mon 10:59 amTT motors are the best value for hobby bots, good to learn on.
Replacement RS-130 size motors are low cost, even here only $1.

TT RS130 Motors for Toy Cars

Yes, 130 motors are very good for poor hobbyists. So I have started learning. 

tlfong01’s Toy Car DIY PenZu Diary
https://penzu.com/p/39061ac7

/ to continue, …
…Attachmentstt130_2019mar1101s.jpgtt130_2019mar1101s.jpg (152.77 KiB) Viewed 5042 timesI am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-11 Mon 10:58 pmtlfong01 wrote: 2019-Mar-11 Mon 12:18 pmTT RS130 Motor Toy Car
tlfong01’s Toy Car DIY PenZu Diary
https://penzu.com/p/39061ac7

Toy 4WD Assembly and Testing Notes

Plastic cheap things are very good for quick prototyping. I am using a old plastic box cover to hold the gear motors. Both the box and motors are very forgiving for poor, careless, absent minded newbie hobbyist craftsmanship. I don’t to care much about precision, because plastic is easy to “machine”, using hand tools such as the electric drill and files.

Now the four motors are running clumisily, and wheels laughingly out of alignment and way off centre. But I think IF one day, perhaps 3 months from now, I can successfully climb up the very steep learning curve of the great Gyro/Accelero MPU6050, I can, proudly command this ugly looking yellow 4WD to do impressive things like moving in a straight line, remember orientation, etc etc.

But of course I am only day dreaming now, and there are too many more things to learn, such as the DC motor driver TB6612FNG, …

Toy 4WD Test Youtube
https://youtu.be/ygn3MgYIO7M (youtube)

SparkFun 3-Axis Gyro/Accelerometer IC MPU-6050 US$12.95
https://www.sparkfun.com/products/10937

The MPU-6050 is a serious little piece of motion processing tech! By combining a MEMS 3-axis gyroscope and a 3-axis accelerometer on the same silicon die together with an onboard Digital Motion Processor (DMP) capable of processing complex 9-axis MotionFusion algorithms. The parts’ integrated 9-axis MotionFusion algorithms can even access external magnetometers or other sensors through an auxiliary master I2C bus, allowing the devices to gather a full set of sensor data without intervention from the system processor.

SparkFun Motor Driver – Dual TB6612FNG – US$5
https://www.sparkfun.com/products/14451

The TB6612FNG Motor Driver can control up to two DC motors at a constant current of 1.2A. Two input signals (IN1 and IN2) can be used to control the motor in one of four function modes: CW, CCW, short-brake and stop. The two motor outputs (A and B) can be separately controlled, and the speed of each motor is controlled via a PWM input signal with a frequency up to 100kHz.
…Attachmentstoy_4wd_2019mar1101.jpgtoy_4wd_2019mar1101.jpg (168.48 KiB) Viewed 5004 timesI am an electronics and smart home hobbyist.

User avatar

Gavinmc42Posts:6044Joined: 2013-Aug-28 Wed 11:31 am

Re: Choosing motors

2019-Mar-12 Tue 8:50 amPixart have nice sensors for robot vacuum navigation type apps.
Just a fancy optical mouse sensor with longer range.
Should help those bot suck in straight lines.

Ah young whippersnapper you are so spoilt ;)
When I first started gyros had a motor and a big spinning wheel.
Accelerometers were about the size of single serve baked beans cans.
Motors had open frames and weak magnets.
Logic was done with valves etc, batteries lasted minutes.
An IMU as accurate as the 6050 was only on Nuclear submarines or later on cruise missiles?I’m dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-12 Tue 3:35 pmGavinmc42 wrote: 2019-Mar-12 Tue 8:50 am1. Pixart robot vacuum navigation, optical mouse sensor, help bot suck in straight lines
2. gyros had a motor and a big spinning wheel.
3. Accelerometers size of single serve baked beans cans.
4. An IMU as accurate as the 6050 was only on Nuclear submarines or later on cruise missiles?

Nuclear submarine grade IMU

I don’t understand what you are talking about, because I have zero experience in using gyro, accelero, magnetometer (pressure sensor, barometric altimeter). I once wrongly thought that IMU is hardware and includes gyro and accelero. I think I need to google very hard before pretending to know the basics and build up more reputation and respect than I deserve.

But I am glad to hear that MPU6050 is nuclear submarine grade. So now I can boast to my friends that I doing nothing much research, just simple nuclear submarine grade gyro and accelero, you know, those motion and position devices in sea and air carriers like b737max  , …

Anyway, I googled the following tutorial from SparkFun, and made a summary.

Accelerometer, Gyro and IMU Buying Guide – SparkFun
https://www.sparkfun.com/pages/accel_gyro_guide

Accelerometers and gyros are becoming increasingly popular in consumer electronics, so maybe it’s time you added them to your project! Scrolling through SparkFun’s sensors category reveals a huge list of these sensors that might be perfect for your next project, if only you knew what they did, and which one best fit your project.

The goal of this buying guide is to get you speaking the same language as these sensors’ datasheets and to help you select the one that is best-suited for your needs.

Accelerometers
What’s an accelerometer measure? Well, acceleration. You know…how fast something is speeding up or slowing down. You’ll see acceleration displayed either in units of meters per second squared (m/s2), or G-force (g), …

Accelerometers are used to sense both static (e.g. gravity) and dynamic (e.g. sudden starts/stops) acceleration. One of the more widely used applications for accelerometers is tilt-sensing. Because they are affected by the acceleration of gravity, an accelerometer can tell you how it’s oriented with respect to the Earth’s surface. For example, Apple’s iPhone has an accelerometer, which lets it know whether it’s being held in portrait or landscape mode. An accelerometer can also be used to sense motion. For instance, an accelerometer in Nintendo’s WiiMote can be used to sense emulated forehands and backhands of a tennis racket, or rolls of a bowling ball.

Finally, an accelerometer can also be used to sense if a device is in a state of free fall. This feature is implemented in several hard drives: if a drop is sensed, the hard drive is quickly switched off to protect against data loss.

Now that you know what they do, let’s consider what characteristics you should be looking for when selecting your accelerometer:

Range , …

Interface, … digital accelerometers usually feature a serial interface be it SPI or I²C.

Depending on your experience, these may be the most difficult to get integrated with your microcontroller. That said, digital accelerometers are popular because they usually have more features, and are less susceptible to noise than their analog counterparts.

Number of axes measured – This one’s very straightforward: out of the three axes possible (x, y, and z), how many can the accelerometer sense? Three-axis accelerometers are usually the way to go; Power Usage, … Bonus Features, …

Gyros
Gyroscopes measure angular velocity, how fast something is spinning about an axis. If you’re trying to monitor the orientation of an object in motion, an accelerometer may not give you enough information to know exactly how it’s oriented. Unlike accelerometers gyros are not affected by gravity, so they make a great complement to each other.

In the past, gyros have been used for space navigation, missile control, under-water guidance, and flight guidance. Now they are starting to be used alongside accelerometers for applications like motion-capture and vehicle navigation.

A lot of what was considered when selecting an accelerometer still applies to selecting the perfect gyro: Range, … Number of axes measured, … Power Usage, …

IMUs
Gyroscopes and accelerometers are great, but alone they don’t give you quite enough information to be able to comfortably calculate things like orientation, position, and velocity. To measure those and other variables many people combine the two sensors, to create an inertial measurement unit (IMU) which provides two to six degrees of freedom (DOF). IMUs are widely used in devices that require knowledge of their exact position, for example robotic arms, guided missiles, …

SparkFun’s IMUs can really be broken down into two classes: simple IMU combo boards, which just mount an accelerometer and gyro onto a single PCB, and more complex units that interface a microcontroller with the sensors to produce a serial output, …

…Last edited by tlfong01 on 2019-Mar-13 Wed 4:00 pm, edited 1 time in total.I am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-12 Tue 5:05 pmtlfong01 wrote: 2019-Mar-12 Tue 3:35 pm2. gyros had a motor and a big spinning wheel.
3. Accelerometers size of single serve baked beans cans.
4. An IMU as accurate as the 6050, …

MEMS MPU6050

My MPU6050 module measures 1.5cm x 2cm (update – the chip is only 4mm x 4mm x 0.9mm).

So how big is your big spinning wheel? Did you take a selfie? 

MPU6050 Gyro Accelero Module Picture and Schematic
https://penzu.com/p/39061ac7

InvenSense MPU6050 6-axis Motion Tracking Device Specification
https://store.invensense.com/datasheets … V3%204.pdf

Spinning wheel – Blood Sweat & Tears – 2,829,175 views
https://www.youtube.com/watch?v=kK62tfoCmuQ
…Attachmentsmpu6050_schematic_2019mar1701ss.jpgmpu6050_schematic_2019mar1701ss.jpg (45.41 KiB) Viewed 4722 timesLast edited by tlfong01 on 2019-Mar-17 Sun 11:26 am, edited 3 times in total.I am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-12 Tue 9:17 pmtlfong01 wrote: 2019-Mar-12 Tue 5:05 pm
MPU6050 Newbie References

I googled and found a blog site by BitiFly with python examples on how to use MPU6050. I think it is good for newbies. I also found a python library by Tijnadgamer but I do’t find enough documentation for newbies. So I will first try the BitiFly’s examples.

Interfacing Raspberry Pi and MPU-6050 (Using Python) – BitiFly 2013nov06
http://blog.bitify.co.uk/2013/11/interf … -6050.html

mpu6050 Python Module – Tijndagamer 2018jul29
https://github.com/Tijndagamer/mpu6050I am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-12 Tue 10:31 pmtlfong01 wrote: 2019-Mar-12 Tue 9:17 pm
MPU6050 i2cdetect and i2cset test OK

I followed BitiFly’s tutorial and found i2ctools commands i2cdetect can detect MPU6050 at 0x68 and i2cset can read its register 0x75.

Next is to write a python program to do more tests.

Interfacing Raspberry Pi and MPU-6050 (using i2ctools commands i2cdetect and i2cget) – BitiFly 2013nov06
http://blog.bitify.co.uk/2013/11/interf … -6050.html

To detect mpu6050 at address 0x68
sudo i2cdetect -y 1

To get output from register 0x75 which has the value 0x68
sudo i2cget -y 0 0x68 0x75

Reading data from the MPU-6050 on the Raspberry Pi (using python) – BitiFly 2013nov07
http://blog.bitify.co.uk/2013/11/readin … berry.html
…Attachmentsmpu6050_test_2019mar1201.jpgmpu6050_test_2019mar1201.jpg (182.81 KiB) Viewed 4913 timesI am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-12 Tue 11:07 pmtlfong01 wrote: 2019-Mar-12 Tue 10:31 pmNext is to write a python program to do more tests.
Reading data from the MPU-6050 on the Raspberry Pi (using python) – BitiFly 2013nov07
http://blog.bitify.co.uk/2013/11/readin … berry.html

MPU6050 Block Diagram

Newbie must do – look at the block diagram before writing any python program!
…Attachmentsmpu6050_block_diagram_2019mar1201.jpgmpu6050_block_diagram_2019mar1201.jpg (200.75 KiB) Viewed 4904 timesI am an electronics and smart home hobbyist.


User avatar


tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-13 Wed 8:18 pmtlfong01 wrote: 2019-Mar-12 Tue 11:07 pmReading data MPU-6050 on Rpi Python – BitiFly 2013nov07
http://blog.bitify.co.uk/2013/11/readin … berry.html

MPU6050 References

Now I am collecting more references for programming MPU6050.

MPU6050 Datasheet R3.4 – InvenSense 2013
https://store.invensense.com/datasheets … V3%204.pdf

MPU-6000/MPU-6050 Register Map and Register Descriptions Document V4.2 – InvenSense 2013
https://www.invensense.com/wp-content/u … r-Map1.pdf

Washington University CSE 466 Lab 4: I2C Gyroscope control (Using Teensy)
https://courses.cs.washington.edu/cours … l4/l4.html

An Efficient Orientation Filter For Inertial and Inertial/Magnetic Sensor Arrays – Sebastian OH Madgwick 2010Apr30
https://courses.cs.washington.edu/cours … report.pdf

Open source IMU and AHRS algorithms – x-io tech 2012jul31
http://x-io.co.uk/open-source-imu-and-ahrs-algorithms/

MPU6050 Basic Teensy Example with IMU – Beerware by Kris Winer 2014apr10
https://courses.cs.washington.edu/cours … 050IMU.inoLast edited by tlfong01 on 2019-Mar-13 Wed 11:12 pm, edited 2 times in total.I am an electronics and smart home hobbyist.Starscream205Posts:4Joined: 2019-Mar-01 Fri 5:58 am

Re: Choosing motors

2019-Mar-13 Wed 9:18 pmhttps://www.amazon.co.uk/gp/aw/d/B07HBN … b_pd_title

These are the motors I am using for my robot project and they seem pretty good, I’ve tested them through a picon zero.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-13 Wed 10:57 pmStarscream205 wrote: 2019-Mar-13 Wed 9:18 pmhttps://www.amazon.co.uk/gp/aw/d/B07HBN … b_pd_title
These are the motors I am using for my robot project and they seem pretty good, I’ve tested them through a picon zero.

TT RS130 1/120 Motor with Hall Effect AB Encoder 1440 pulses per wheel revolution

Picon Zero looks good.

I just started testing the motors. I bought the two shaft model, wrongly thinking that I could DIY an optical encoder on one geared shaft. But then I read that the resolution is too low to do any self balancing job or gyro thing. So I bought another model with encoder at the motor shaft. I don’t have the skill and knowledge to DIY that sort of sophisticated quadrature Hall effect encoder. 

4tronix PiCon Zero
https://4tronix.co.uk/blog/?p=1224

MiaoLab TTM1 Motor with encoder
https://item.taobao.com/item.htm?id=568690950220

Update 2019mar14 – 4tronix Robot Car with Wheel Encoder Sensors
http://4tronix.co.uk/pi2go/WheelEncoders.pdf

I visited 4tronicx and found their Pi2Go-Lite also has wheel encoders.

These simple encoders provide 16 pulses per revolution of the main wheels and allow user to program the car to:

Travel in straight lines, even if the motors naturally move at slightly different speeds
* Travel a fixed distance
* Turn a set angle
…Attachmentsencoder_motor_2019mar1301.jpgencoder_motor_2019mar1301.jpg (166.71 KiB) Viewed 2024 timesI am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-14 Thu 12:30 pmtlfong01 wrote: 2019-Mar-13 Wed 10:57 pmStarscream205 wrote: 2019-Mar-13 Wed 9:18 pmhttps://www.amazon.co.uk/gp/aw/d/B07HBN … b_pd_title
These are the motors I am using for my robot project and they seem pretty good, I’ve tested them through a picon zero.
4tronix PiCon Zero
https://4tronix.co.uk/blog/?p=1224
I visited 4tronicx and found their Pi2Go-Lite also has wheel encoders.
These simple encoders provide 16 pulses per revolution of the main wheels and allow user to program the car to:
Travel in straight lines, even if the motors naturally move at slightly different speeds
* Travel a fixed distance
* Turn a set angle

Wheel Encoders

/ to continue, …
…Attachmentswheel_encoder_2019mar1402.jpgwheel_encoder_2019mar1402.jpg (154.46 KiB) Viewed 1999 timesI am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-14 Thu 12:50 pmtlfong01 wrote: 2019-Mar-13 Wed 8:18 pmMPU6050 Datasheet R3.4 – InvenSense 2013
https://store.invensense.com/datasheets … V3%204.pdf
MPU-6000/MPU-6050 Register Map and Register Descriptions Document V4.2 – InvenSense 2013
https://www.invensense.com/wp-content/u … r-Map1.pdf
MPU6050 Programming Notes

Now I have written my first very simple python program which reads the MPU6050’s register 0x75. The program is fully listed below.

tlfong01’s MPU6050 Programming Penzu Diary
https://penzu.com/p/bcc27149

/ to continue, …

Code: Select all

# mpu6050_test03_2019mar1401 tlfong01 2019mar14hkt1424
# Rpi3B+ stretch linux 4.14.34-v7+ arm python3.5.3

# *** Description ***

# 1. Setup I2C channel
# 2. Reset MPU
# 3. Wakeup MPU
# 4. Read and print register default value 0x68 of register 0x75 (WhoAmI)

# *** Imports ***

import smbus
from   time import sleep

# *** Device Address ***

mpu6050Addr = 0x68

# *** Register Addresses ***

whoAmIAddr     = 0x75
powerMgmt1Addr = 0x6b

# *** Control Bytes ***

resetByte  = 0x80
wakeupByte = 0x00

# *** Read Write Print Device/Register Functions ***

def writeDevTwoBytes(i2cPort, devAddrByte, dataByte1, dataByte2):
    i2cPort.write_byte_data(devAddrByte, dataByte1, dataByte2)
    return

def readDevRegOneByte(i2cPort, devAddrByte, regAddrByte):
    readByte = i2cPort.read_byte_data(devAddrByte, regAddrByte)
    return readByte

def writeDevRegOneByte(i2cPort, devAddrByte, regAddrByte, writeByte):
    writeDevTwoBytes(i2cPort, devAddrByte, regAddrByte, writeByte)
    return

def printDevRegOneByte(i2cPort, devAddrByte, regAddrByte, printTitle):
    readByte = readDevRegOneByte(i2cPort, devAddrByte, regAddrByte)
    print(printTitle, hex(readByte))

# *** MPU6050 Functions ***

def operationDelay():
    sleep(0.000020) # 20 micro seconds
    return

def resetMpu(i2cCh):
    print('      Begin resetMpu(), ...')
    writeDevRegOneByte(i2cCh, mpu6050Addr, powerMgmt1Addr, resetByte)
    operationDelay()
    printDevRegOneByte(i2cCh, mpu6050Addr, powerMgmt1Addr, '        Reg 0x6b (PowerMgmt1) =')
    print('      End   resetMpu().')
    return

def wakeupMpu(i2cCh):
    print('      Begin wakeupMpu(), ...')
    writeDevRegOneByte(i2cCh, mpu6050Addr, powerMgmt1Addr, wakeupByte)
    operationDelay()
    printDevRegOneByte(i2cCh, mpu6050Addr, powerMgmt1Addr, '        Reg 0x6b (PowerMgmt1) =')
    print('      End   wakeupMpu().')
    return 

# *** Test Functions ***

def readPrintMpu6050RegWhoAmI():
    print('      Begin readPrintMpu6050RegWhoAmI(), ...')
    printDevRegOneByte(i2cCh, mpu6050Addr, whoAmIAddr, '        Reg 0x75 (Who_Am_I)    =')
    print('      End   readPrintMpu6050RegWhoAmI().')
    return

def testMpu01():
    readPrintMpu6050RegWhoAmI()   
    return

# *** Init Functions ***

i2cCh = smbus.SMBus(1)
resetMpu(i2cCh)
wakeupMpu(i2cCh)

# *** Main ***

testMpu01()

# *** End ***

'''
# *** Begin Sample Output 2019mar14hkt1442 ***
      Begin resetMpu(), ...
        Reg 0x6b (PowerMgmt1) = 0x40
      End   resetMpu().
      Begin wakeupMpu(), ...
        Reg 0x6b (PowerMgmt1) = 0x0
      End   wakeupMpu().
      Begin readPrintMpu6050RegWhoAmI(), ...
        Reg 0x75 (Who_Am_I)    = 0x68
      End   readPrintMpu6050RegWhoAmI()
# ** End Sample Output ***
'''

Last edited by tlfong01 on 2019-Mar-14 Thu 3:08 pm, edited 2 times in total.I am an electronics and smart home hobbyist.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-14 Thu 1:31 pmtlfong01 wrote: 2019-Mar-14 Thu 12:30 pm
4tronix Robots References

Amazon 4tronix Picon Zero v1.3 Intelligent Robotics Controller Board for Raspberry Pi
https://www.amazon.co.uk/4tronix-Intell … B01E8MXQWY

robotics controller board for Raspberry Pi
Fully supported with extensive Python library
drive Servos, NeoPixels, LEDs, Motors and many other output devices
use Analog or Digital inputs, or even directly access temperatures with a DS18B20
Multiple power options for the output devices and motors

4tronix Robots summary notes

Motors
TT130 plastic geared DC3~6V motor
N20 metal geared motor
28BYJ-48 stepping motor ULN2003 boards

Motor/Servo Driver
L293DD H-Bridge motor driver
DRV8833 DC/stepping motor driver
ULN2003 stepping motor driver
PCA9685 16-channel PWM servo driver

Sensors
DS18B20
DHT11

LED
WS2812 Neopixel LED

Raspberry Robotics Robotics for beginners with the Raspberry Pi – Richard Keenes 2019mar10
https://raspberryrobotics.home.blog/
…Attachmentspicon_zero_2019mar1401.jpgpicon_zero_2019mar1401.jpg (161.48 KiB) Viewed 1989 timesI am an electronics and smart home hobbyist.jameshRaspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum ModeratorPosts:29300Joined: 2011-Jul-31 Sun 3:41 am

Re: Choosing motors

2019-Mar-14 Thu 5:37 pmtlfong01 wrote: 2019-Mar-14 Thu 1:31 pmtlfong01 wrote: 2019-Mar-14 Thu 12:30 pm
4tronix Robots References

Amazon 4tronix Picon Zero v1.3 Intelligent Robotics Controller Board for Raspberry Pi
https://www.amazon.co.uk/4tronix-Intell … B01E8MXQWY

robotics controller board for Raspberry Pi
Fully supported with extensive Python library
drive Servos, NeoPixels, LEDs, Motors and many other output devices
use Analog or Digital inputs, or even directly access temperatures with a DS18B20
Multiple power options for the output devices and motors

4tronix Robots summary notes

Motors
TT130 plastic geared DC3~6V motor
N20 metal geared motor
28BYJ-48 stepping motor ULN2003 boards

Motor/Servo Driver
L293DD H-Bridge motor driver
DRV8833 DC/stepping motor driver
ULN2003 stepping motor driver
PCA9685 16-channel PWM servo driver

Sensors
DS18B20
DHT11

LED
WS2812 Neopixel LED

Raspberry Robotics Robotics for beginners with the Raspberry Pi – Richard Keenes 2019mar10
https://raspberryrobotics.home.blog/
…Can you please avoid spamming the forums with loads of links, and also reduce the amount of colour in your posts, its disconcerting and makes your posts difficult to read. Must also take ages to write for no benefit.Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Applications Team.

User avatar

tlfong01Posts:1312Joined: 2018-Jun-02 Sat 9:43 pmLocation: Hong Kong

Re: Choosing motors

2019-Mar-14 Thu 8:40 pmjamesh wrote: 2019-Mar-14 Thu 5:37 pmtlfong01 wrote: 2019-Mar-14 Thu 1:31 pmtlfong01 wrote: 2019-Mar-14 Thu 12:30 pm
4tronix Robots References

Amazon 4tronix Picon Zero v1.3 Intelligent Robotics Controller Board for Raspberry Pi
https://www.amazon.co.uk/4tronix-Intell … B01E8MXQWY

robotics controller board for Raspberry Pi
Fully supported with extensive Python library
drive Servos, NeoPixels, LEDs, Motors and many other output devices
use Analog or Digital inputs, or even directly access temperatures with a DS18B20
Multiple power options for the output devices and motors

4tronix Robots summary notes

Motors
TT130 plastic geared DC3~6V motor
N20 metal geared motor
28BYJ-48 stepping motor ULN2003 boards

Motor/Servo Driver
L293DD H-Bridge motor driver
DRV8833 DC/stepping motor driver
ULN2003 stepping motor driver
PCA9685 16-channel PWM servo driver

Sensors
DS18B20
DHT11

LED
WS2812 Neopixel LED

Raspberry Robotics Robotics for beginners with the Raspberry Pi – Richard Keenes 2019mar10
https://raspberryrobotics.home.blog/
…Can you please avoid spamming the forums with loads of links, and also reduce the amount of colour in your posts, its disconcerting and makes your posts difficult to read. Must also take ages to write for no benefit.Thank you for you advice. So I will avoid spamming links and colouring posts. My apologies for any disconcerting caused.I am an electronics and smart home hobbyist.jackbarks234Posts:1Joined: 2019-Jun-19 Wed 4:43 pm

Re: Choosing motors

2019-Jun-19 Wed 4:48 pmGavinmc42 wrote: 2019-Feb-25 Mon 10:59 amhttps://en.wikipedia.org/wiki/Magnetic_gear
I get magnets from here, trying to figure out if a high ratio magnetic worm drive gear box could be made
https://supermagnetman.com/

Those TT motors are the best value for hobby bots, good to learn on.
And once those cheap motors wear out you can replace them with lower current, higher voltage 12V ones.
Because they are cheap speed can be dependent on brush wear.
Try driving in a straight line.

Replacement RS-130 size motors are low cost, even here only $1.
Is it important where you buy the magnet? Supermagnetman doesnt ship to my country, but https://magnetpartner.com/ does. I guess its pretty much the same thing? Or?

User avatar

Gavinmc42Posts:6044Joined: 2013-Aug-28 Wed 11:31 am

Re: Choosing motors

2019-Jun-20 Thu 9:09 amIs it important where you buy the magnet?Not really important, I think most are made in China anyway.
I get from Supermagnetman because he has a very wide range and I get 100’s at a time.
There are wholesalers that might restock his stuff, industrial suppliers not online retailers.

Those 5mm coloured spheres look interesting, I don’t have any of those ;)I’m dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar

OutoftheBOTSPosts:711Joined: 2017-Aug-01 Tue 6:06 pm

Re: Choosing motors

2019-Jun-20 Thu 1:44 pmI seem to be coming to this discussion very late.

How to answer the age old question that has dogged robot builders since the beginning of time “How to make my robot drive straight“. I have lost count at how many hours I have spend chasing this unicorn :)

There is a few options.

1.
Stepper motors as they turn very very precise and is why they are used in CNC machines.

2.
Servo type motors that have a feed back loop on the position of the motor (usually a quadrature encoder). Basically it is a fast loop that reads the position of the encoders then if they are incorrect for what you want then it adjust the PWM power to the motor then repeats. This is not easy to do on a RPi because RPi isn’t real time. It is much easier to use a MCU that has a hardware encoder counter like the STM32 MCU family.

3.
Using a feed back loop for another sensor for positioning like the MPU family of IMUs but this requires some pretty fancy coding to do sensor fusion to remain accurate

The stepper motor option will be the simplest one to implement. Just buy a stepper motor with enough torque and a Driver that can handle the need current. I suggest using micro stepping not for accuracy but rather for smoothness of motor rotation. You can see an example of both servo motors and stepper motor in action on the 5x5x5 rubik’s cube solving robot I build. Servo motors open and close the grippers but all the rotation is done by steppers https://www.youtube.com/watch?v=sD4bG8hPYLQ

User avatar

Gavinmc42Posts:6044Joined: 2013-Aug-28 Wed 11:31 am

Re: Choosing motors

2019-Jun-21 Fri 9:49 amI once had to drive two electric linear rams at the same speed for a solar panel tilt mechanism.
I used one of those small DSP micros from Microchip which had two encoder inputs.
All I did was keep the counts within +/-5 or 10 of each other, slow one down when it gets ahead etc.
Probably the simplest DSP coding I have ever done and it still works fine 10 years later.

Steppers are ok but can loose sync that’s why most CNC machines have Zero position detectors.
DC motors with encoders are also ok.

3Phase Brushless outrunner motors with gyro/accel feedback are the newest solution.
How good these are is shown in all those camera gimbals on drones.

Could you use gyro/accel/compass with DC motors?

Well Drones are now using Arm Cortex M3/4s for stability controls, Pi’s will need this too.
Could a Pi Zero be used instead of M3/4?
Probably, with latency issues?
Could the QPUs be used for the Quaterion coding?

One guy has done a drone with a Pi, so a two motor ground bot should be much easier.I’m dancing on Rainbows.
Raspberries are not Apples or Oranges

.END

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.