PBP projects for R/C models


Closed Thread
Results 1 to 40 of 772

Hybrid View

  1. #1
    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
    Here is my latest stumbling block. I have an arrangement with some folks who are willing to contribute brand new HPI Racing Sprint cars to my project. I received my first new car last week. HPI has drastically changed the Electronic Speed Control. This is the package that translates incoming PWM signals (from the radio receiver or from my PIC) into outgoing DC current for the motor that drives the wheels. I am not doing well with the HPI WEB site getting technical information about this SC-15 WITH REVERSE SPORT CONTROL.
    Hey Ken,

    Congratulations on getting the donation! It is a great idea you have, and I am glad you have stuck with it. As for your newest stumbling block, what code are you currently using? You might be running into the same problem of not having a standard R/C output pulse going to the controller. And MIBAM will not work, because it is meant for lighting, and will confuse your speed controller even more.

    All analog servos (not the newer digital ones) use a standard protocol. A pulse width from about 0.9mS to 2.1mS or so, pulsed every 20 mS. Since this controller does not say digital on it, I would bet that it is analog, and works the same as all the servos in my house. Since it has reverse, as well as forward, I would bet that somewhere in between .9mS and 1.1 mS is neutral. Less is probably reverse, and more is forward.

    I don't think you need a manual for it. Just start feeding it some PWM that matches that protocol, and you will be good.

    Assembly is a tough nut to crack. It's just one of those things, the more you use it, the more you learn. But one of the things I learned this week from the forum, was that I could have an instant ASM interrupt without using any ASM. No, I didn't know that when I wrote some similar code for the 12f683. So in my example above, I only used two lines of assembly code. a BSF and a BCF. (Bit set and bit clear). So you can have almost no nuts with this code, or you can change them to PBP code if they drive you ... um ..... nuts.

    I think you already know this, but I just found the gif file, and I like it, so I'll post it here. - Walter

    Attached Images Attached Images  
    Last edited by ScaleRobotics; - 29th July 2010 at 16:04.

  2. #2
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    All analog servos (not the newer digital ones) use a standard protocol. A pulse width from about 0.9mS to 1.1mS or so, pulsed every 20 mS.
    I was always led to believe it was typically 1ms to 2ms with a 20ms frame rate this gave 1.5ms pw for centre stick, at least that's what I've always based my SSC type projects on.

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


    Did you find this post helpful? Yes | No

    Default I think this ESC is different

    I agree with both of you on the size, shape and frequency of standard PWM signals. I have been running my car (an older version of this same HPI Sprint) successfully for the last couple of months. With the exception of frequency my HPWM pulses agree with your specs. I found the correct HPWM commands by trial and error.

    This new Transmitter, Receiver, ESC combo is different. Leaving out my PIC for the moment if I on the radio transmitter I give full forward (trigger full back) and suddenly go to full reverse (trigger full forward) the car goes from full forward to stop (neutral in the PWM sense) and stays there until I bring the trigger to neutral for at least two seconds. Then giving it full back will work fine.

    Somewhere in the system is protection against slamming the DC motor with reversed polarities. That is good, but when I tried to emulate that system in my code it did not work.

    Thank you sooo much for your support and interest. Oh, yes, the electronic speed control wheel driving system is not a classic servo. Steering is. Wheels used to be - in the day - but no longer.

    Ken

  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
    Leaving out my PIC for the moment if I on the radio transmitter I give full forward (trigger full back) and suddenly go to full reverse (trigger full forward) the car goes from full forward to stop (neutral in the PWM sense) and stays there until I bring the trigger to neutral for at least two seconds. Then giving it full back will work fine.

    Somewhere in the system is protection against slamming the DC motor with reversed polarities. That is good, but when I tried to emulate that system in my code it did not work.
    Ken
    Well, that's a completely different problem than what I thought you had. Why not talk to your friends at the R/C store and find out if they know of any controllers that let you go reverse from full forward. If they do, sell the controllers you have on Ebay, and buy the ones you want with the money?

    You might also be able to hack the speed controller if it is for a brushed motor. But you run the risk of breaking a $55 speed control. You could also build your own controller for a brushed motor, but easier to find one off the shelf that will do what you want, if it exists.
    Last edited by ScaleRobotics; - 29th July 2010 at 18:20.

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


    Did you find this post helpful? Yes | No

    Default Yea, but...

    I have been successful in attracting some support for my project. Check out
    http://www.ten80education.com

    They use HPI Sprint cars.
    If I can design a 'simple' enough PIC kit to add to the standard HPI product, the schools might get a pretty good deal. My new car was a support gift cost me nothing.

    Ken

  6. #6
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kenjones1935 View Post

    This new Transmitter, Receiver, ESC combo is different. Leaving out my PIC for the moment if I on the radio transmitter I give full forward (trigger full back) and suddenly go to full reverse (trigger full forward) the car goes from full forward to stop (neutral in the PWM sense) and stays there until I bring the trigger to neutral for at least two seconds. Then giving it full back will work fine.

    Ken
    Electronic braking system. - You might be able to go into the programming mode and disable this function.

  7. #7
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    Electronic braking system. - You might be able to go into the programming mode and disable this function.

    Uhmm maybe that's not an option. I can't see anything on programming the end points on this controller

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


    Did you find this post helpful? Yes | No

    Default Just got back into town...

    OKAY,

    I have discovered through the use of my oscilloscope that PAUSE stops the HPWM output pulses. In order to emulate the radio system I want to try giving the ESC two seconds worth of neutral PWM between switches back and forth between forward and reverse. This is a race car. It will not be going backwards very often, but it is necessary sometimes. Looks like I need to figure out how to set a two second interrupt. Hmmmm. NUTS!

    Ken

  9. #9
    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
    I have discovered through the use of my oscilloscope that PAUSE stops the HPWM output pulses.
    Hey Ken, welcome back to town.

    Do you mind posting some of your code for us to figure out what is going on? The HPWM command, or using the CCP hardware PWM with your own commands should both work independently of your code. I have a 2 second pause that is repeated, but HPWM keeps pumping out pulses the entire time. But if I repeatedly call HPWM and set it using PBP, it can give me some screwy results. Probably better setting the registers directly, like Bruce shows in this example: http://www.picbasic.co.uk/forum/show...1478#post61478

    What PIC hardware are you using?

    Thanks,

    Walter
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    I was always led to believe it was typically 1ms to 2ms with a 20ms frame rate this gave 1.5ms pw for centre stick, at least that's what I've always based my SSC type projects on.
    Edit: oops, yes I meant to say 2.1 as the highpoint, not 1.1. Thanks Malc!

    Hey Malc,
    Yeah, me too! As a basic rule it works. But then I built my first passthrough device, I built it for that range and it got discombobulated when the signals from my transmitter exceeded the 2 mS. My transmitter has endpoint adjustments, so it allows you to go beyond the 1 to 2 mS. Some transmitters will only give 1.1 to 1.9ms.

    Check out the HiTech web site regarding the signals:

    Quote Originally Posted by HiTech
    Q. What signal do servos require to operate?
    A. All Hitec servos require a 3-4V peak to peak square wave pulse. Pulse duration is from 0.9ms to 2.1ms with 1.5ms as center. The pulse refreshes at 50Hz (20ms).
    You are probably right, I just was not sure if a forward and reverse speed control would be centered at 1.5 mS. My planes don't have reverse.
    Last edited by ScaleRobotics; - 29th July 2010 at 16:04.

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


    Did you find this post helpful? Yes | No

    Default

    Usually an H bridge is used for forward and reverse. It is pretty much what you describe, only using two more fets. Microchip has an application note about one here: http://ww1.microchip.com/downloads/e...tes/00893a.pdf . It shows a nice diagram of the different states of forward and reverse on page 3.

    In your post, I don't understand the " It could steer the correct MOSFET signal with a third 'direction' output." part though.... Don't you steer with a servo?
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default Not the clearest I am

    When I wrote, "It could steer the correct MOSFET signal with a third 'direction' output."
    I was thinking of simplifying the speed control functionality by separating out the FORWARD and BACKWARD aspect. HPWM can easily create a PWM signal between one and two millisec. A second digital HIGH and LOW could dictate rotation direction. I've seen reference to something like this, but I did not think it through.

    Ken

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


    Did you find this post helpful? Yes | No

    Smile need some new ideas..

    I think I have the ESC nailed. I have a procedure for powering up that seems to give predictable robocar behavior.

    Do you all have some creative ideas for things to do with this little car. Right now it follows a wall counter clockwise looking down at a leisurely pace. High speed introduces response time problems. Two sonar proximity sensors can be placed looking anywhere from the car and a pot controls the top forward speed the half forward speed.

    I can show you all the code if you like. It is crude, but it works.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    You say looking down. Do you also have it looking for drop offs? Along that line maybe something like a seeing eye dog/bot?
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default I have thought about parallel parking

    There is a new car out that parallel parks itself. My car could do that if I put one sonar on the back bumper.

    It could also detect motion if it were standing still. A relay race? I just thought of that. I like it....

    Ken

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


    Did you find this post helpful? Yes | No

    Unhappy 1/10 Toy level car frustration.....

    The model level car is too expensive for middle school use. It seems to be too fast for my level of software and SF05 sonar sensing. I have found a commercially available electronic speed control that has no 'smarts', but that's $50 added cost to the package.

    The 1/10 size gives me more room under the plastic car body for my solderless protokit plus an extra 4 AA battery package. This $50 toy car comes with a 7.2 volt rechargeable battery. There is still a mystery. How can the PIC detect that the RC transmitter is turned on? Presently turning on the transmitter with the trigger in a particular position stops the car in its tracks, but does not toggle to RC control.

    All this sounds soo good. But.... go look at



    It is not good. This has been frustrating. You can hear the car spin its wheels on the cement floor. I've not been able to get it to follow the wall. It turns too far when making what should be small adjustments. Could be my code. I'll share it if you want.

    On the plus side this car cost $50 retail. It is light and very robust - as you can see. All my solderless kit easily fit underneath the plastic shell with holes for the sonar sensors.

    As of right now It does seem that the model level car with the POT to adjust the speed is the way to go.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    Yes, these are the same devices. 0.1" on the spacing. They are made for breadboards. More about them here:
    http://www.schmalzhaus.com/UBW32/

    Name:  cui32.jpg
Views: 2341
Size:  37.6 KB
    Last edited by ScaleRobotics; - 7th October 2010 at 02:59.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default

    EMCelectronica's price is ok, but their shipping really gets you. The CPUStick is 49 Euros, but shipping is 52 Euros ... ouch! Of course, it could be their store is set up wrong, and shipping wouldn't really be that expensive.

    Here is one that fits your breadboard better than the other Sparkfun device:
    http://www.sparkfun.com/commerce/pro...oducts_id=8971

    I have trouble with some 44 pin devices, so I am a little scared of soldering one of these big guys. I would use an off the shelf product for testing, then if it looks like it would do the job, you could have some boards made and try some soldering.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default Are those output holes on 0.1" centers?

    Thanks for the tip. The board looks OKAY, but only if I can solder pins into those holes and plug the thing into a solderless proto board. Of course some of the pins across the bottom would not have matching holes.

    Oh, I see. The picture of the red board in your "http://www.sparkfun.com/commerce/pro...oducts_id=8971" is the same as the picture of the green board in my previous posting. True? Do you think? The price there is OKAY if shipping is reasonable.

    Ken
    Last edited by Kenjones1935; - 7th October 2010 at 02:47. Reason: My mistake

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


    Did you find this post helpful? Yes | No

    Default

    There is a link on Sparkfun's web site going here
    http://www.schmalzhaus.com/UBW32/
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default I'll buy two USB 32-Bit Whacker - PIC32MX460

    What else do I need? I am confused but very impressed by the young man in the video. I'll get the ZIGflea later.

    Ken

  22. #22
    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
    What else do I need? I am confused but very impressed by the young man in the video. I'll get the ZIGflea later.
    Yes, me too!

    That should be all you need. However, this one does not come with StickOS installed. But you can use your PicKit2 to install StickOS firmware into it. And, by doing that, you will get the latest 1.80 version. You will need to download a windows driver from this page CPUStick.inf : http://www.cpustick.com/downloads.htm

    But with that, and hyper terminal, you can start writing some code. Oh, and you won't get a manual either, so you will have to print one.

    Walter
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default

    Not a problem Ken, this is definitely the hardest part. And the manual doesn't really pull it all together for me either. Once you have a connection, you almost don't have to worry about those parts again though.

    Here is the hex file you need. I have it in a zip file attached. It also has the driver you need. You must install the driver into your computer. Right click the driver, and select install. Then hopefully when you plug the USB cord from the UBW to the computer, you hopefully will see something happen.

    We will get it going, or die trying. Hopefully the former.
    Attached Files Attached Files
    Last edited by ScaleRobotics; - 14th October 2010 at 05:08.
    http://www.scalerobotics.com

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