line follower with dspic33fj128mc802

A place to document your own projects.

line follower with dspic33fj128mc802

Postby exapod » Mon May 14, 2012 2:07 pm

i'm planning of building a robot with a dspic33fj128mc804 and two encoders for implement some dead reckoning algorithms so for learn something on the dspics i build a line-follower, it uses 6 analog sensors that are read with the auto-scan capability of the chip, the pwm is 12 bit and the control loop runs at almost 30 kHz (it only calculates the line position and the do a very simple PD routine that use fixed point math).
The controller runs at almost 40 MIPS.
I win most of the parts on the sparkfun freeday :D.
Here it is a video : http://www.youtube.com/watch?v=B0XdQ6GRexo&feature=plcp .
Attachments
IMAG0217.jpg
top
IMAG0215.jpg
bottom
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: line follower with dspic33fj128mc802

Postby rajaafiq » Mon Jul 29, 2013 11:31 pm

can i get the coding for my reference since i using dspic33fj64mc802 for my robot. but still can code well. this is my email: "mutiara_hitam02@yahoo com"
rajaafiq
Newbie
Newbie
 
Posts: 1
Joined: Mon Jul 29, 2013 11:28 pm

Re: line follower with dspic33fj128mc802

Postby exapod » Tue Jul 30, 2013 7:08 am

Here it is the code, it is very very bad written but it works ok...
Attachments
PID.zip
(317.83 KiB) Downloaded 347 times
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: line follower with dspic33fj128mc802

Postby adamsya » Tue Jul 30, 2013 10:49 pm

Hi Exapod,

I have download your coding and go through,but can I get your schematic/components too?

What IR sensor do you use & bluetooth module you use?

Did you display printf using Hyper terminal?

If i am using USB microstick (dspic33fj64mc802), where should the printf be display? because hyper terminal only support serial communication?

=)
adamsya
Newbie
Newbie
 
Posts: 2
Joined: Tue Jul 30, 2013 10:41 pm

Re: line follower with dspic33fj128mc802

Postby matseng » Wed Jul 31, 2013 12:21 am

Good speed in the video - looks like almost 0.5 meters per second. This make me want to build my own line follower.... Maybe some day....

Hey rajaafiq - Nice email address. It's strange how one can pick up parts of a language without even trying. After 3.5 years in Malaysia I actually know what Mutiara Hitam means in bahasa :-)
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: line follower with dspic33fj128mc802

Postby exapod » Wed Jul 31, 2013 7:05 am

Hi,
i'm sorry but i don't have a written schematic, but it is very simple...
The two cell lipo is regulated to 3.3v with a linear regulator ( not the best choice but it was the only thing i had around), the sensor are QRD1114 and i'm reading them with the ADC of the pic, i have a n-mosfet for switching the led on or off, the circuit is similar to this http://www.pololu.com/catalog/product/960 . The dspic has the core cap and the 100nF on the supply lines.And that's it, let me know if you have any problem
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: line follower with dspic33fj128mc802

Postby adamsya » Wed Jul 31, 2013 8:42 pm

Thanks for the info,

But what about the PrintF communication between dspic and PC, where do you diplay the value? on window hyperterminal or in MPlab?
adamsya
Newbie
Newbie
 
Posts: 2
Joined: Tue Jul 30, 2013 10:41 pm

Re: line follower with dspic33fj128mc802

Postby exapod » Thu Aug 01, 2013 5:42 am

I display it on my pc with putty, but any terminal program will work
exapod
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Jul 17, 2011 7:18 am

Re: line follower with dspic33fj128mc802

Postby GilbertoLV » Thu Oct 24, 2013 8:15 am

Hi,
I'm brazilian and I'm an Eletrical Engenering Student. I'm working on a project really similiar to yours, but I'm not sure of a lot of points. Actually, I'm kind of "lay". So, I'd like to know if you can send me your codes or even some information about the components of your sistem. It would really help a lot and I'd be thankfull. Anyway, thanks and congrats.

gilberto_loiola@hotmail com
GilbertoLV
Newbie
Newbie
 
Posts: 1
Joined: Thu Oct 24, 2013 8:10 am


Return to Project logs