Mark1953
Posts: 25
Joined: Fri Oct 18, 2013 9:07 pm

CamJamEDUKit 3 Motors go at different speeds

Sun Jun 11, 2017 5:28 pm

I've been playing with the CamJam EDUKit 3 for a couple of weeks now. My hope was to create an autonomous robot that could travel around avoiding things in front of it and to "map out" the area by sensing what was in front of it.

However, I have two problems:

1. The distance sensor seems to be pretty inaccurate, when the robot is stationary, the distance can vary by 30 cm or more regardless of what I do; and
2. The motors don't turn at the same rate for the same command so the robot spirals around rather than going in a straight line. I've tried making the duty cycle of the motors different to give more power to one or the other but it doesn't seem to be consistent so I'm almost at the point of giving up.

I know its only a cheap (inexpensive) kit and therefore perhaps I was expecting a bit much but has anybody else experienced similar behaviour?

pcmanbob
Posts: 6671
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: CamJamEDUKit 3 Motors go at different speeds

Tue Jun 13, 2017 10:33 am

Hi.

Motors will never run at exactly the same speed for a given input, but if yours a wildly out and are not constant in there variation I would look at your wiring, it sounds like you might have a bad connection giving a high resistance or an intermittent disconnection.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Mark1953
Posts: 25
Joined: Fri Oct 18, 2013 9:07 pm

Re: CamJamEDUKit 3 Motors go at different speeds

Tue Jun 13, 2017 12:35 pm

Thanks, pcmanbob, for your reply.

Based upon your comment, I checked the motors by connecting them directly to the battery. The result is that one is about 5% faster than the other. I'm going to go back to CamJam EDUKit 3 Worksheet 7 to see if using the motors more simply works.

When running them yesterday (when I got really frustrated), what I noticed was that the motors accelerated and decelerated on their own when just running them at what was supposed to be a constant speed and I am beginning to wonder whether using an old Raspberry Pi B+ is causing driver problems so I'm going to do exactly the same but with my PiZero W

pcmanbob
Posts: 6671
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: CamJamEDUKit 3 Motors go at different speeds

Tue Jun 13, 2017 2:07 pm

Mark1953 wrote:Thanks, pcmanbob, for your reply.

Based upon your comment, I checked the motors by connecting them directly to the battery. The result is that one is about 5% faster than the other. I'm going to go back to CamJam EDUKit 3 Worksheet 7 to see if using the motors more simply works.

When running them yesterday (when I got really frustrated), what I noticed was that the motors accelerated and decelerated on their own when just running them at what was supposed to be a constant speed and I am beginning to wonder whether using an old Raspberry Pi B+ is causing driver problems so I'm going to do exactly the same but with my PiZero W

No as long as both Pi's are running the same OS then both should work the same. it does sound like you might have a hard ware problem if they were changing speed on their own, not having one of these kits I cant comment on the actual hardware or software used. if you want to post some good quality pictures I will see if I can off some advice based on them.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Mark1953
Posts: 25
Joined: Fri Oct 18, 2013 9:07 pm

Re: CamJamEDUKit 3 Motors go at different speeds

Wed Jun 14, 2017 4:13 pm

Hi pcmanbob,

There aren't any meaningful pictures to show, the motor controller comes as a single unit to plug in to the headers on the pi.

However, going back to first principles, I think I've found the problem.

The motors don't run at the same speed but, by fiddling with duty cycle and frequency parameters, I managed to get them to go at the same speed when powered by a Pi power supply. (Interestingly enough I'm not sure they are the same forwards and backwards but that's further testing).

However, when I use the battery I bought, which has a 1A output, I get the problems of different speeds of the two motors and the speeds changing so (I assume) the Pi and motor controller are demanding more power than the battery is willing to supply so it looks like I've got a different problem to solve.

Thanks for your help.

User avatar
mikronauts
Posts: 2717
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: CamJamEDUKit 3 Motors go at different speeds

Wed Jun 14, 2017 4:48 pm

I've seen +/- 25% different unloaded motor speeds with the cheap yellow gear motors, between motors from the same kit.

These days I measure the unloaded motor speeds of all motors on a bot and use PWM to get the speeds as close as is feasible.

My last two articles in SERVO talked about this.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Mark1953
Posts: 25
Joined: Fri Oct 18, 2013 9:07 pm

Re: CamJamEDUKit 3 Motors go at different speeds

Fri Jun 16, 2017 4:49 pm

To end the discussion.

Today I went out and bought a power pack which (claims to) generate up to 3.4 amp. The motor behaviour is more consistent in that the speed doesn't vary (as much) whilst just running flat out. The motors are of different speed so I'll have to fiddle around until I get them close enough for what I was trying to do.

Finally (however) they seem to behave differently forwards and backwards which will make whatever code I write slightly more difficult.

Thanks for your help.

Return to “Automation, sensing and robotics”