Asked — Edited
Resolved Resolved by Rich!

Parallax Hb 250 Motor Controller And Ez-B V4 Microcontroller

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.


ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

United Kingdom
#1  

Have a read of this topic.

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.

#2  

I am using the modified servo control and have played with the values which have not made it work. I wonder is the timing is the problem with the pulse. Their data says to set it at 1000, 1500 and 2000 in timing and I see no way to increase ez-b values more than 180 and 1. Am I missing something. There data sheet also says to bring the signal down low to start. I am assuming that means voltage or in their case 1500. Thanks for trying to help. Can you think of anything else.

#3  

Attached you will find the data sheet for the Parallax Motor Controller. I think the problem I am having has something to do with being brought low (whatever that means) and delay timing. I hope this helps. I have tried all the things I think would help to no avail. I am not a programmer yet but realize I may have to get back into it to make this system work. ThanksHB-25-Motor-Controller-Guide-v1.3.pdf PDF Web Link

United Kingdom
#4  

There are a fair few topics for the HB-25 in the forum so far, from what I have read in those topics the method in the first topic I linked to has worked i.e. the HB-25 works like a modified servo.

Use the forum search for more topics covering this. Also check you have it wired correctly, batteries charged etc. etc.

#5  

I have read all the post I can find and these do not answer my questions. I need to know how to change the pulse distances apart at startup.

United Kingdom
#6  

The control for Modified servo does this for you. The values entered are essentially PWM values, i.e. the pulse width.

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.

Quote:

Mode 1 Communication In this mode, a single pulse value sent to the HB-25 can control the HB-25; no refreshing is necessary, as is the case with a servo. For compatibility however, you may send the HB-25 pulses every 20 ms just like a servo and it will function the same.

If no values are working then you need to check your wiring, batteries etc.

#7  

I have done some more research. I talked to Parallax Robotics concerning the HB-25. The problem I seem to be having is initiation of the Parallax controller. The controller requires the microprocessor to check the signal pin for condition of Hi or Low condition. The condition will be high initially on the motor controller signal pin. If the microprocessor finds that it is high it must turn it to low then on the next pulse turn it back to high. What code and where do I need to write it to get it to do this.

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.

PRO
Canada
#8  

Hi @Ellis,

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:


$x = getDigital(D0)
if ($x = 0)
sleep(5)     # wait for 5mS for HB25 to initialize
servo(d0, 90) # HB25 connected to D0 set for stop value
sleep(20)     # wait for 20mS
endif

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.

United Kingdom
#9  

Darn it @Jeremie beat me to it while I was driving to work!..

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?

#10  

Good news. I got the motor controller to respond by first connecting one motor control to a modified servo and running it then switching it back to Parallax motor control and turning it on. I only have to do this for one port. I learned this trick from Parallax customer service. Once I do that both motors started working. I then adjusted the controls to 80, 140 and 110 and everything worked great except the motors are running backwards for forward and forward for backwards. I still have to figure that out. Can you give me any advice.

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.

User-inserted image

I would have written back yesterday but the community server was down.

Thanks again. Ellis

United Kingdom
#11  

Either swap the motor polarity around or swap the numbers around to correct the backward/forward issue.

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...

#12  

Thanks Rich. This should answer all my questions except where to write the motor initiation script.

Again Thanks.

United Kingdom
#13  

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.

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.

United Kingdom
#14  

You kno what, for the sake of 2 minutes to make it, here's a screenshot

User-inserted image

#15  

Thanks a million. This answers all my present question. You have been more than patient with me. I now have a robot that can move around. It is great to have people like you that take the time to help fellow roboteer.

#16  

Just wanted to let every one know that the initialization script that Jeremie wrote for the HB-25 Parallax motor control worked great at initializing the controllers. The code needs to be changed only for the port or ports you are using and stop port number. The HB-25 seem to stop at 110 not 90.

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.

United Kingdom
#17  

Something similar to the script I made for Gwen's B9's movement will work. Have a read of this topic and the project I posted in there.

While it's written for the sabertooth you can easily change the SendSerial() commands for Servo() commands.