
Ellis

I am trying to run two Parallax HB 25 motor controllers and Parallax Motor Mount and Wheel Kit 28962 with an EZ-B v4 micro-controller. The HB 25 data sheet says that the motor controller needs a standard pwm servo signal to operate. I am using a regulated 7.2 vdc for EZ-B and 12 vdc for motors. When I hook it up to a standard servo it works and when I hook it up to the motor controllers it doesn't. I have tried everything I can think of to get it EZ-Bo work to no avail. Help
Also the Motor Mount and Wheel Kit comes with a encoder to establish position. Can the EZ-B use this information. If yes what do I need to do.
Use the Modified servo control and it should work once you set up the required "positions" in the config, there may be some trial and error in setting up the correct values but it shouldn't take long to work it out.
PDF Web Link
Use the forum search for more topics covering this. Also check you have it wired correctly, batteries charged etc. etc.
Servos expect to see a pulse every 20ms. The length of the pulse determines the servo position, or in the case of a modified servo, the speed and direction at which it's moving.
The pulse distances are the pulse width, which are the values in the config for the modified servo control or the PWM control.
The userguide for the controller confirms that servo PWMs are accepted.
If no values are working then you need to check your wiring, batteries etc.
This is their initiation code:
' -----[ Initialization ]--------------------------------------------------
Startup:
IF HB25 = 0 THEN Startup ' Wait For HB-25 Power Up
LET DIRS = %00000001 ' Set PIN0 To Output
PAUSE 5 ' Wait For HB-25 To Initialize
PULSOUT HB25, 150 ' Stop Motor
PAUSE 20 ' Wait 20 mS
They told me to attach a servo to the microprocessor and turn the servo on then unplug it from the servo and plug it into the motor controller and then turn the motor controller on the wheels will start up. They did, so it seems like I need to write an initiation code for the EZ-B v4 microprocessor.
If I use the modified control panel and push forward both wheels go forward. If I push left left motor will stop and right motor will run forward. Right works the same only reverse wheels. If I push stop nothing happens the selected motors continue to run. if I push reverse the both motors stop. They will start again if I push forward, right or left. Neither motor will run in reverse. I am happy to see the motors finally running but want them to run without plugging a modified servo in each time and I want them to run in reverse. I do not know why this is happening but it must be a communications problem between the microprocessor and the parallax motor controller. Most likely it will require some code modification.
It seems like you'll have to adjust the servo values in the Modified servo panel please see this thread for some details on how to adjust those values.
For the initialization code I can try and give you an untested sample. Here's an EZ-Script equivalent:
Code:
This example will do a single sample on D0 to see if it is low, then if it is it will proceed to send a servo stop value to D0. In the case of the HB25 it seems like the stop value might be lower, maybe in the value of 50 or lower range.
However, I'd like to know how many motor controllers you are using and how they have been wired up. Can you post a photo or a quick schematic?
I still need to add the initiation script to keep from having to run a standard servo first to initiate the motor controls. Where to I put the EZ-Script you wrote so it will work before I turn the motors on?
Also I tried to use the vertical control but it doesn't look anything like the one in the tutorial. It does not have a slide like the one in the video. I do not know how to make it work.
I am including a picture for you to look at my robot.
Rich and Jeremie you were both great help.
I would have written back yesterday but the community server was down.
Thanks again.
Ellis
It sounds like you are watching very old videos, the slide was replaced over a year ago. It's still a slide of sorts, click and hold where the number is in the control and move the mouse. Here are a couple of examples I made a while back...
Again Thanks.
Then you should have some options such as 0 connection established cmd: with an empty box to the right of it and to the right of that a small pencil icon.
Click the pencil icon to the right of 0 Connection Established cmd: and you should get a script dialogue window pop up.
This is where you put the init code.
Once written click save (bottom left), then save again in the previous window, then save your project.
If you need a screenshot let me know.
You will also need to set the parameters in the modified servo panel for the motors. Trial and error seems to work. If it is two high or low the motors will not run.
Here is where to put the initialization code:
On the Connection control (top left as default) there is a small gear icon, click it.
Then you should have some options such as 0 connection established cmd: with an empty box to the right of it and to the right of that a small pencil icon.
Click the pencil icon to the right of 0 Connection Established cmd: and you should get a script dialogue window pop up.
Non of this came from me but from working with the guys helping in this post. Thanks again the motors are working great.
One thing I would like to do is ramp the motors if possible so they are smoother at start up. They seem very jerky because they go from stop to fast immediately. Any suggestions? I still want to use them with the joystick and modified motor control panel.
While it's written for the sabertooth you can easily change the SendSerial() commands for Servo() commands.