Shop OBEX P1 Docs P2 Docs Learn Events
Need help with the Motor mount #27971 — Parallax Forums

Need help with the Motor mount #27971

hank van burenhank van buren Posts: 57
edited 2008-06-26 17:37 in BASIC Stamp
Hi, I am still looking for sample code I can use to r/c control· the motor mound and wheel kit (27971) from Parallax. I have tried many ways to make it work but without success. The code include with the unit works very well but there is no mentioning of r/c control. Thanks Hank

Comments

  • Tom CTom C Posts: 461
    edited 2008-05-25 13:44
    Hi hank van buren,

    I can feel your frustration as I have been looking at R/C controlling the motor mount\wheel kit myself and have not really been able to determine exactly how to do it using the Position Controller input.

    I suspect that the videos of the motor mount\wheel kit powered robot did not use the Position Controller and drove the HB-25s directly from an R/C receiver which is a well documented process.

    I have also used a BS2 as an interface between the R/C receiver and the HB-25s with great success.

    Hopefully Ken will come out with some PBasic code that will demonstrate how to use the Position Controllers to make turns which is, at the moment, not obvious to me, anyhow.

    The Position Controllers will make the motor mount\wheel kit move forwards or backwards in a straight line for a set distance which is a good start. However, how do you get the Position Controller to cause the motor mount\wheel kit to make a turn? The only way I can see to do this, at the moment, is to reduce the max speed of one of the wheels on the fly in the direction of the turn and then set it back to its original value to go straight again. Otherwise, I guess that you could go straight for a given number of counts, stop, rotate using just one wheel, and then go straight again to the next turning point.

    Comments?

    Regards,
    TCIII

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
  • hank van burenhank van buren Posts: 57
    edited 2008-05-25 14:15
    Hi Tom C,
    This is very frustrating to say the least. I purchase the Wheel Mount 3 weeks ago. I wrote tech support on trying to get a sample of the code used in the video,·I was told this was·preprogrammed. I think you are right eliminate the position controllers and go with driving direct true 2 speed controllers. I only hope I did not make a mistake by purchasing the unit. Hank
  • Tom CTom C Posts: 461
    edited 2008-05-25 15:32
    Hi Hank,

    I do not believe that you made a mistake purchasing this motor\wheel mount combination as I am sure that Parallax will get with the program (hear that Ken)·to provide some programming examples in the near future.

    I know that some of you want to get this combo going right away, but in a lot of cases, software always lags the hardware.

    I suggest that you control the HB-25s directly with the R/C receiver and get some experience using the combo until Parallax provides programming examples for use with the Position Controller.

    Regards,

    TCIII

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
  • FranklinFranklin Posts: 4,747
    edited 2008-05-25 15:49
    It looks to me that the position controller is not designed to work with standard hobby radio controllers. You will probably need to send commands to an onboard stamp/propeller/sx using some form of serial over radio to get it to work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • hank van burenhank van buren Posts: 57
    edited 2008-05-25 16:13
    Hi Tom C,
    I know what you are saying The wheel mount is very nicely made and I will purchase 2 HB-25. I have bought from Parallax for more then 18 years and never got hurt, matter of fact I have a instruction manual for the BS2 describing the use of MS-DOS 2.0 to program the BS2 I use as a reference. Hank
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-05-26 16:32
    Hank,

    I apologize for not catching your message sooner. I recall one of the Techs asking me about the code for the robot so that must be when you called in. I don’t think he realized what you were asking for because the code in the one video with the wooden version of the robot was R/C and we have published that code on here several times. The second video where the robot chassis (second edition) is running around inside was a set of pre-programmed sequences that were designed to test/show the maneuverability of the robot using those wheels. Bear in mind that these were both done before the Wheel Encoders were actually made. The Wheel Encoders change things slightly. They add a whole bunch of features and the ability to track distance but they are also serial communication. Therefore the original code written to talk to the HB-25 directly will not work directly on the Wheel Encoder controllers. It would have to be converted. We have not yet done this. I will ask this week if there are any plans for this.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Kevin McCulloughKevin McCullough Posts: 62
    edited 2008-05-28 01:45
    Hi Hank and Tom,

    When using the Motor Mount and Wheel kit on an RC controlled robot where speed will be continually variable, it is best to control the speed of the motors directly rather than using Position Controllers as middle-men. Nevertheless, Position Controllers are still very useful as a means of gathering speed and position information even when not being used to control motor drivers.

    The advantages of Position Controllers really stand out more when using them in autonomous or semi-autonomous applications where a microcontroller is already being taxed by other operations. The idea is that you can give Position Controllers a command to go a certain distance and they will take care of ramping up the speed and traveling that distance, while the main microcontroller can concentrate on something else like reading sensors or communicating with other devices. If you are less interested in traveling a certain distance, and more interested in continuously varying the wheel's speed, then it would be easier just to send commands directly to the motor controller (HB-25).

    A possible analogy of this idea would be cruise control in a car. It is a super-useful feature that makes highway driving a lot easier and relieves the driver from having to continually monitor and adjust foot pressure on the gas pedal to maintain a constant speed. The cruise control module adjusts the throttle position automatically so the user doesn't have to. However, when driving on windy country roads or in city traffic where the driver needs to continually adjust speed based on the current surroundings, it is much easier for the user to just take control of the throttle directly. Additionally, just because cruise control may or may not be used on the windy country roads, does not make the speedometer and trip-odometer any less useful as sensory feedback.

    My next question (and I assume yours as well) would be, what if I sometimes want to use the Position Controller to control the speed automatically, and other times I want to have direct continuous control over the speed? What is the easiest way to setup both methods simultaneously in hardware, and be able to switch back and forth between them in software?

    All that is necessary is a few logic gates. It can be done using NAND gates (as shown in the attached file) or an equivalent NOR gate circuit. Essentially, this circuit allows an override enable line to control which signal reaches the HB-25 Motor Controller. The override enable line should be driven high or low by an I/O pin on the Basic Stamp. When held low, the pulse signals from the Position Controller are passed through to the HB-25. When the override enable line is driven high, the pulse signal from the Basic Stamp (generated by the user's code) is passed through to the HB-25. It is most likely that two Position Controllers & HB-25s are being used (right and left motors), so the circuit should be duplicated for each side (and both override enable lines should be tied to the same I/O pin). Of course, if you want to use the Basic Stamp to control HB-25's exclusively, you don't need the logic gates and the pulses from the BS2 can be directly fed into the HB-25. Keep in mind that when controlling the motors manually, it is best to bring the motors to a stop and clear the Position Controllers before switching control of the motors back to the Position Controllers.

    Hope this helps! smile.gif
    -Kevin
  • hank van burenhank van buren Posts: 57
    edited 2008-06-26 17:37
    Hi Kevin
    I am taking your advice I want to retain the capability of maintaining constant speed and torque. I have installed a "override" with some success. The main problem I encountered is a premature stop I have used a number of >32000 in "distance" but I have to push reset on the stamp to get a other cycle started is there a number or sign I could use to prevent this. On page 11 of the manual (motor mount and wheel kit) \

    Command Set Summary The Position Controller’s command set is grouped by category as query commands, configuration commands, and action commands. Query commands request information from a specific individual Position Controller board and generate a reply. Action commands affect the output of the Position Controller when it is being used to control an HB-25 motor controller, and do not generate a reply. Configuration commands set certain parameters in one or more Position Controller boards and also do not generate a reply. Any variables modified by configuration commands are reset to default when the device loses power.

    I like to know how this is being done are there any exemplas available
    Any help would be greatly appriciated. Regards Hank van Buuren
Sign In or Register to comment.