PBP projects for R/C models


Closed Thread
Results 1 to 40 of 772

Hybrid View

  1. #1
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Have you fixed the easier of your 2 issues yet? Expecting it to work correctly at 1220Hz when it is waiting for 50Hz may be a bit of a stretch. You can create a multi-channel, interrupt-driven, software PWM with a PIC16 and a 16-bit timer - such as TIMER1. If you don't know how to do that, then select a PIC18 and use DT's 2-CH Hardware Servo Driver (see CMS articles on the right of the HOME page). It is limited to only 2 channels but will work for your project for now.

    When you have that working correctly, then you can progress to the PID stuff which looks like this:
    Name:  TEST-6A.jpg
Views: 1576
Size:  41.8 KB

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rmteo View Post
    When you have that working correctly, then you can progress to the PID stuff which looks like this:
    Attachment 4944
    Hey RMTEO,

    Don't be shy about posting actual code. We would love to see your PBP example of the above.
    http://www.scalerobotics.com

  3. #3
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    Hey RMTEO,

    Don't be shy about posting actual code. We would love to see your PBP example of the above.
    Hey SCALREOBOTICS,

    What made you think that I was going to do that in PBP? I do not think that PBP would be the way to go for Ken's situation but I would be happy to have you prove me wrong.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rmteo View Post
    Hey SCALREOBOTICS,

    What made you think that I was going to do that in PBP? I do not think that PBP would be the way to go for Ken's situation but I would be happy to have you prove me wrong.
    Then why would you suggest that Ken do it? Other than to add more confusion or a chance to say something else is better.

    Why do you not post something to try helping. Always posting that another compiler is better is not a help. Other compilers might be better but that is not the issue here.

    So I will ask you to not to post on this forum if that is all you have to say.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rmteo View Post
    Hey SCALREOBOTICS,

    What made you think that I was going to do that in PBP?
    Uh ....... in case you didn't notice, this is a PicBasic forum. That would be what is spoken here. Each language that you recommend have their own forum. And we don't go there talking about PBP, do we?
    http://www.scalerobotics.com

  6. #6
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Ken, good luck with your project.

  7. #7
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Smile OKAY, gang, I get the picture

    rmteo's comments DO help. I went to WIKIPEDIA and looked up PID and pretty much understand what it is - sort of. It ain't so complicated as the single formulaic representation makes it appear.

    Question about PBP and my 16F887. I think the spec for my robocar says to produce one PWM pulse every 20 msec. Each pulse varying in width from 1 to 2 msec in 256 segments. A 1.5msec (created by 127 segments) pulse is neutral. In the case of my Electronic Speed Control anything above 1.5msec is FORWARD. Anything shorter than 1.5msec is BACK. What must I do to scale my chip's 4MHZ oscillator to accomplish this fete?

    What I am presently doing I came across by trial and error. I am not sure what shape the PIC is actually producing.

    Ken

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Dave
    Always wear safety glasses while programming.

  9. #9
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Great point Bert.

    Ken, can you remind me again, what sonar sensor you are using? Parallax's sensor looks like it can do just about every 20ms. But not sure what it will do with echos that are further away. But I don't think you are using their sensor, so it probably has different specifications.

    Walter
    http://www.scalerobotics.com

  10. #10
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Ken, I really don't know much about control math either. I tend to think of things as instant. So at some point This whole thing may very well go over my head. FWIW, I am thinking about your sensors as if they were a gyro on an R/C copter. The gyros watch for any movement not commanded by the Rx. when this happens, they instantly modify the signal to the servo to correct and bring the controlled axis (usually the tail) back to where it was. The more movement the harder it tries to bring it back. Now if we think about this in terms of a little older equipment, this can only happen every 20 msec. but that is plenty fast enough to keep the tail looking rock steady.

    With your car, I look at it like this: if you want to maintain a distance, say 12 inches from the right wall, every command to the steering will have some adjustment in it to keep it there. Sensor takes a distance-wall is 11.9" away, turn left a little. next loop, wall is still 11.9 turn more. next loop, wall is 12.02", turn back.

    Same with the front wall, except for the amount to turn will need to be more because the wall is approaching. the side sensor will also need to know it should expect to move away from the wall and not fight the front sensor.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 13:55
  2. PBP Extensions, What are they?
    By PJALM in forum PBP Extensions
    Replies: 9
    Last Post: - 28th September 2021, 12:26
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 20:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th December 2005, 00:30
  5. Making PBP code more modular
    By forgie in forum General
    Replies: 30
    Last Post: - 25th October 2005, 17:24

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts