Main Site Documentation

[SOLVED] FEZ Mini with Existing Car motor


#1

Hello,

Recevied a few weeks ago the FEZ Mini Robot Kit. Awesome!

Question; I have an existing electric running remote-controlled car.
I have managed to get the servo working on the FEZ mini without any problems.
But, instead of the dc motors in the kit i want to use the motor of the remote-controlled car, cause they are powerfull.
But, they don’t have the correct connectors to connect with the FEZ Mini.

Does anyone have any experience with other motors for the FEZ Mini?

Do I need another component or shield to control the motor?
Forgive me if i am wrong, but i think the motor i’ve got from the existing car is something like this:

http://www.conrad.com/MOTOR-SPEED-MACHINE-23X2.htm?websale7=conrad-int&pi=229757&ci=SHOP_AREA_19779_1202032&Ctx=%7Bver%2F7%2Fver%7D%7Bst%2F3ec%2Fst%7D%7Bcmd%2F0%2Fcmd%7D%7Bm%2Fwebsale%2Fm%7D%7Bs%2Fconrad-int%2Fs%7D%7Bl%2Fint%2Fl%7D%7Bsf%2F%3Cs1%3Emotor%3C%2Fs1%3E%2Fsf%7D%7Bp1%2F817cbac6970dc7de29a312e083b7d028%2Fp1%7D%7Bmd5%2Fbf21a85d2e8a8ef051bb38d9078bc932%2Fmd5%7D

and another one like this one:

http://www.conrad.com/MOTOR-X-FLY-400.htm?websale7=conrad-int&pi=229115&ci=SHOP_AREA_19779_1209040&Ctx=%7Bver%2F7%2Fver%7D%7Bst%2F3ec%2Fst%7D%7Bcmd%2F0%2Fcmd%7D%7Bm%2Fwebsale%2Fm%7D%7Bs%2Fconrad-int%2Fs%7D%7Bl%2Fint%2Fl%7D%7Bsf%2F%3Cs1%3Emotor%3C%2Fs1%3E%2Fsf%7D%7Bp1%2F817cbac6970dc7de29a312e083b7d028%2Fp1%7D%7Bmd5%2Fbf21a85d2e8a8ef051bb38d9078bc932%2Fmd5%7D

Second question. I want to add a GPS. I want the car to drive itself :wink: Sound awesome. Want to build an autonomous car.
Which GPS should i use and do i need a shield of some kind of connector for this too?

Can someone help me with this?

Thanks in advance.

Best regards,
Colin


#2

So you want to use the RC car and leave the motors in it?

I would think the simpliest approach is replace the receiver with the Fez. A servo shield (or board) should be all you need I would think. Keep your ESC and connect to a servo port on the shield. Then your not changing much and swap back to RC if needed. Other people here should have more to offer. I would get your fez-car running and programming tweaked. Then look to add GPS.


#3

William, thanks for your reply.

That is what i was thinking, i’ve tried connecting ESC to FEZ, but without any succes. Where do i connect ESC on my FEZ to?

On the ESC are several component and connectors, like, Battery pack, on/off switch and cables to connector motor.
Do i still have to connect the battery pack?
And the FST connector, on what port should i connect it on my FEZ?

Anyone any ideas?

Thanks and good evening!


#4

You should look for information on how your rc car operates. They all has a common scheme:

motor -> motor controller -> receiver

What a motor does I hope You undrstand :smiley:

Motor controller. This part controls how much “energy” goes form a batery to motor. If there is more energy - motor spins faster. So to answer to your questions:
ESC needs to conect to batery (probably with a switch You mentioned), and it must conect to the motor.
The conection left is for conection to receiver.
Since You trying to replace the receiver this must go to Your FEZ.

How to connect:
there is diferent color codes, but all connections use the same scheme - signal, “+”, “-”. You need only signal and “-”. http://fatlion.com/sailplanes/servos.html
Do not connect “+” anywhere for now. Later it is possible to power FEZ from it, but You need to messure how much V you get from it (it can be 5-6V).
"-" goes to Your FEZ GND pin.
And signal to any digital pin.

Now, to drive your motor You need to generate signal (servo pulse) on pin You puted signal on. There is couple of libraries writen on http://code.tinyclr.com type “servo” in search.

Hope it helps You.

And like William said, first try to run a car, then we will help You with GPS.


#5

@ Rimvis, thanks!

Managed to get the motor running via PWM.Di6 and Digital.Di9.
But, the motor only running forward (e.g. byte 50) but always the same speed, even i change the byte to 1 or 100.
And also when i change the byte to negative, e.g. -1 or -50, the motor will do nothing.

I have connected the ESC component to Motor B on the RBX Controller board beneath the FEZ Mini (i’ve got the FEZ Mini Robot Kit)…

Anyone any ideas?

Ps; At the moment, GPS is step 2, get the car running well is step number 1.

Thanks for replies!


#6

MotorB is highV out to power a motor not electronics. Luckly it is probably only 5Vout or you could have fried your ESC. Much depends on your ESC type (fubata, etc). Here is something that may help.
http://www.mcmanis.com/chuck/Robotics/projects/ServoGizmo/esc.html

Pictures and name/model would help.


#7

So i need to connect the ESC to a Servo Port ( number 7 or 8 )?

The ESC is a Hitec SP-560 (see attachment).


#8

You control the esc ~like a servo. From what I read, esc has a center position you need to find and maybe a start marker like low speed for some period. But need to find specific info or use logic probe to know for sure. Others here have more experience in this area that should be able to help more.

Here are some refs I found.
http://forum.sparkfun.com/viewtopic.php?f=14&t=24996&p=114676&hilit=ESC+pwm#p114676
http://www.hitecrcd.com/files/ManualSP560.pdf
http://www.rctech.net/forum/radio-electronics/256112-speed-control-arduino.html
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1226292633

And from our own King Chris. May have to tweak for your specific ESC if it setup different.


#9

Look for information and drivers here related to King Chris’ project “RWAR”.


#10

William, Brett, will look into it. Thanks for oyur help.
Will let you know when i found out more.

To be continued.


#11

FWIW. Here is a bare-bones version that may help you reason about it and get started.


#12

William,

I have used the code you supplied. I have added the class to my project and add the following code in the Main function:


FEZ_Components.SpeedController ESC = new FEZ_Components.SpeedController(PWM.Pin.PWM6);
ESC.Speed = 25;
Thread.Sleep(1000);
ESC.Stop();

Didn’t try this code yet, i have a question first.
In this code, and other code snippets i have to select a PWM pin. But how do i know which PWM pin is the connector on the board?

Attached to this post, a picture i just made of the board i’ve got.
Can someone tell me where to connect the ESC controller to?

Thanks!


#13

On top you have 2 3-pin headers, connect the ESC to one of those.


#14

Okay, on a servo port. Checked both, servo ports 7 and 8, without any succes.

I used PWM.Pin.PWM6 to control it.

Motor is connected to ESC, ESC has external power, ESC is connected to Servo Port 7 (or 8).

How do i know which PWM pin i need to call?
I have tried different PWM pins, but sometimes it gives me a Hardware Exception.


#15

The mini has hardware PWM on di3, 5, 6, 9, 10. Servo ports are di7-di8. You have to use software (i.e. OutputCompare or manually) pwm I think. You can use sw pwm, but code will change. If you want to solder, you can solder a header onto mini to get access to di3 pwm pin. You can also pull the mini off the robot board. You then have access to pin on underside. I think at this point, the other stuff is getting in the way. Then use jumper wire to connect servo wire to di3 or di5. Other two servo wires to 5v and gnd.

If want sw pwm, OutputCompare sample usage for sw pwm:
http://www.ghielectronics.com/downloads/FEZ/Component/FEZ_Components_ServoMotor.cs

Also, I updated my code a tad, so may want to grab again.


#16

Found out something with OutputCompare;


oc = new OutputCompare((Cpu.Pin)pin, true, 5);

uint forward = 100 * 15;
uint reverse = 100 * 10;

timings[0] = direction;

// 100 * 1000 = Slower speed
//  50 * 1000 = Higher speed

timings[1] = 50 * 1000;
oc.Set(true, timings, 0, 2, true);

Now i need to find what it’s stop signal to stop the motor running.

William thanks!

To be continued.


#17

Yes! Managed to get the code running. I do need some tweaks here and there, but it is running!

See the following blog post for the code.

http://www.hoeist.nl/post/2011/03/26/FEZ-Mini-with-Existing-RC-motor-and-Servo.aspx

More testing and tweaking tomorrow.

See yah and thanks for your help guys!

@ William, I have add your blog (i asume it’s yours) to my favorites. http://staceyw1.wordpress.com/


#18

Coolness. Glad it is working!
Could you write up what you discovered on your esc. What was timings to make your esc work (i.e. direction, forward, reverse, stop). A video and code at Code (fezzer) section is good for all. :slight_smile:

BTW - I really like your blog engine. Which is it? What client editor are you using to format code blocks and text? nice.


#19

Hey William, i will look in to the fezzer code thing when i am done programming with the ESC.
I just have to found out the right timings/signal to stop the motor, cause it’s still little buggy :wink:

Will let you know asap.

Blog engine :wink: Just what you said, “Blog Engine.NET” is the engine. You can download (or create by yourself) a lot of Extentions and stuff, Syntax Highlighter is one of it.


#20

Wanted to let you know the basic assambly is done. I have a picture attached.

Now I have to tweak the source code to run the engine. Will do some more tests in the afternoon.