PBP projects for R/C models


Closed Thread
Results 1 to 40 of 772

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Next step is the SN7407 MOS driver

    I have forgotten most everything I ever knew about v=iR.

    Is there any reason that you all can recall why I should not just put the a digital 16F887 output pin directly into one of the input lines of the SN7407N?

    Ken

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


    Did you find this post helpful? Yes | No

    Default One more question

    How does HPWM work when the pulses are set for 50 per second (20msec) period and the code loops more quickly than that. ie the next HPWM command happens before the last one got a chance to count out the 20 msec.

    Is it obvious if I study the ASM code? I wish I could find a compact library so I could read ASM easily.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    The hardware parts of the PIC run independant of the code.
    That is one of the reasons we use interrupts. Gives the code a chance to see what the hardware is doing.

    I do not think reading ASM will help much. The chip does not really care about the language.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kenjones1935 View Post
    How does HPWM work when the pulses are set for 50 per second (20msec) period and the code loops more quickly than that. ie the next HPWM command happens before the last one got a chance to count out the 20 msec.

    Is it obvious if I study the ASM code? I wish I could find a compact library so I could read ASM easily.

    Ken
    I don't know if I understand the question. To set HPWM at 20ms, you need to slow your pic down to 0.5 Mhz (if you are using the hardware PWM). But then you only get about 32 different settings from 1ms to 2ms. Maybe you are asking what happens to the servo when you send the 1.5ms pulses quicker than 50 hertz?

    How are you doing it Ken?
    Last edited by ScaleRobotics; - 10th March 2010 at 05:04.

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


    Did you find this post helpful? Yes | No

    Question Serious technical question

    When I toggle from radio control to PIC control I would like the car not to go through a sudden change of commands. I would like the PIC to know what the RC receiver had just told the electronic speed control and the steering servo so that at the instant of toggle it can duplicate these commands.

    Hopefully a solution is while in RC mode to loop two PULSIN commands looking at the signals the radio receiver is sending to the ESP and the servo. The technical question I have is, "How do I process the input from a PULSIN to create a HPWM that is equivalent?"

    The PBP textbook description is not clear to me.

    Ken

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


    Did you find this post helpful? Yes | No

    Wink My previous question

    The question I was trying to ask was this.

    All my code is a continuous loop. The PIC is way fast compared to the fifty pulses per second which is the specification for the radio control car PWM.

    I am doing many HPWM commands within a fiftieth of a second. What does that look like on the output pin? Actually now that i have an oscilloscope I can find out for myself.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kenjones1935 View Post
    The question I was trying to ask was this.

    All my code is a continuous loop. The PIC is way fast compared to the fifty pulses per second which is the specification for the radio control car PWM.

    I am doing many HPWM commands within a fiftieth of a second. What does that look like on the output pin? Actually now that i have an oscilloscope I can find out for myself.

    Ken
    Hey Ken,

    We would not know what it looks like, because we have not seen any code. We really do not know any details, HPWM settings, or oscillator settings even. But you do seem like you are getting along pretty well. This might help us answer your previous question too! I would be curious to see your oscilloscope measurements as well. The only way I know to use HPWM for the 20ms period HPWM, is to slow the oscillator down to 0.5 mhz . And the resolution kind of stinks using that method.

    But I have a feeling you are using an "unkenventional" method, which is cool. Just would like to hear some details of what it is.

    Thanks,

    Walter

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


    Did you find this post helpful? Yes | No

    Smile Beginning to see the light...

    OKAY,

    With the help of the new-to-me oscilloscope I saw what I had been suspecting. The PIC's HPWM signal is not structured like the RC receiver signal. This explains why the PIC has not been able to command a smooth gradation of steering servo positions or wheel driving torque.

    The RC receiver produces a pulse every 20 milliseconds (50 Hz). The pulses are between 1 and 2 milliseconds long. The PIC's HPWM machine produces a pulse every 3.8 milliseconds (263 Hz). The pulses are between 1 and 2 milliseconds long.

    This matches scalerobotics comment of yesterday. It also matches the PBP textbook. Now that I understand what it is saying.

    What I have does give me steering and wheel drive control. It is more bang/bang than I would like. It goes FAST. Which leads me to the problem of getting the car to steer left soon enough when approaching a corner in the wall.

    The RC versus PIC control toggle works. Under RC control the car reacts like the original system. RC channel 3 provides the toggle signal. The PULSIN command does a fine job differentiating short from long PWM on this incoming signal. The code then controls the AZ8222 Subminiature DIP DPDT Relay via the SN7407N DIP MOS driver. This DPDT switch selects either the PIC output or the RC receiver output to send to the electronic speed control and the steering servo.

    I'll make a video when I get the kinks out. I am afraid my prototyping technique is not robust enough to withstand the bumps needed to straighten out the feed back loops.

    Thanks again for your help and encouragement.

    Ken

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. PBP Extensions, What are they?
    By PJALM in forum PBP Extensions
    Replies: 9
    Last Post: - 28th September 2021, 11: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, 19:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  5. Making PBP code more modular
    By forgie in forum General
    Replies: 30
    Last Post: - 25th October 2005, 16:24

Members who have read this thread : 1

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