Shop OBEX P1 Docs P2 Docs Learn Events
Wheel and Motor Mount Kit Controller — Parallax Forums

Wheel and Motor Mount Kit Controller

TheGrueTheGrue Posts: 114
edited 2009-06-27 04:36 in Propeller 1
I recently purchased the Wheel and Motor Mount Kit [noparse][[/noparse]Item 27971] and was looking for any objects in the Object Exchange for it. I can't seem to find any objects for this kit or am I just blind and missed it somewhere?

Comments

  • LeonLeon Posts: 7,620
    edited 2009-06-18 21:47
    PWM functions are available.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • TheGrueTheGrue Posts: 114
    edited 2009-06-18 22:57
    I did a search for the PWM that you suggested and looked at the code of several objects. This does not seem to answer my questions:

    How to I set the the Default Ramp Rate on the controller? How do I reverse the second controller? How do I send the controllers the number of increments to move?

    All of the PWM objects I have viewed seem to revolve around direct control of motors. I want to control the two controllers that are connected to the two HB-25's. I can do this with the BS2 code but I want to do this with the Propeller.
  • TimmooreTimmoore Posts: 1,031
    edited 2009-06-18 23:22
    You can just use a serial port object such as the fullduplexserial.spin and send the commands using the tx routine. e.g.

    port.tx($31) would reverse motor with the id of 1.
  • TheGrueTheGrue Posts: 114
    edited 2009-06-19 17:15
    So I guess that the short answer to my question is that no one has ever posted an object for the "position controllers" and I should roll up my sleeves a get to work [noparse][[/noparse]as soon as I finish wiring the Prop Proto board].

    I thought this might be the case but it couldn't hurt to ask. Why reinvent the wheel if one is readily available? smile.gif
  • TimmooreTimmoore Posts: 1,031
    edited 2009-06-19 18:21
    Heres something I started a while ago but had to stop before it was tested but it may help to get started.
  • SeariderSearider Posts: 290
    edited 2009-06-20 02:23
    I just posted a PPC driver in the OBEX. It is called PPC Driver. (Parallax Position Controller) Let me know if it is helpful.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Searider
  • TheGrueTheGrue Posts: 114
    edited 2009-06-21 17:38
    hop.gif Awesome KEWL code! I'd love to include in TOBI

    I am still trying to wrap my mind around some of it. I see you put in the PRI sections the standard things found in Parallax's demo code and documentation.

    One question that arises is how would my Top object update the variables inside the loop of your code? Right now my Top object will read the wireless remote object, then the proximity object and would issue an update to the motors [noparse][[/noparse]as soon as I get that part going].

    Thanks in advance.
  • SeariderSearider Posts: 290
    edited 2009-06-21 20:10
    Use the MtrMove(Spd,Turn) rutine. both Spd and Turn are -128 to +128.
    To be used the way I do, that is the only data that needs to be be sent. That is not to say that you can't modifications. The speed and turn tables that I have are currently optimized for an indoor bot. I have been thinking that i could devise a way to update the tables at runtime so you could select indoor or outdoor mode.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Searider
  • TheGrueTheGrue Posts: 114
    edited 2009-06-26 07:15
    I could not get yours to work (missing object Delay.spin) but I am going create the missing object or hard wire the code around it and try to make it work. Looks too cool to pass up.

    Anyway, I just uploaded a demo object to the Object Exchange that does what the BS2 demo does "MPC_Roll_Demo.spin"
  • SeariderSearider Posts: 290
    edited 2009-06-27 04:21
    Here is the code for "Delay". I did not write it. I probably downloaded it from the forum. Very simple though.
    CON
      WMin = 381
      
    PUB PauseMSec(Duration)
    {{Pause execution in milliseconds.
      PARAMETERS: Duration = number of milliseconds to delay.
    }}
      waitcnt(((clkfreq / 1_000 * Duration - 3932) #> WMin) + cnt)                                     
      
    PUB PauseSec(Duration)
    {{Pause execution in seconds.
      PARAMETERS: Duration = number of seconds to delay.
    }}
      waitcnt(((clkfreq * Duration - 3016) #> WMin) + cnt) 
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Searider
  • SeariderSearider Posts: 290
    edited 2009-06-27 04:36
    I just updated the PPC Drvier object in the OBEX to include the "Delay" code in the driver spin file.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Searider
Sign In or Register to comment.