Society of Robots - Robot Forum

Software => Software => Topic started by: bilals on May 03, 2010, 08:47:46 AM

Title: How many timers can i use in Webbotlib 1.16 ?
Post by: bilals on May 03, 2010, 08:47:46 AM
Hello,

My Axon II (18 servos connected) resets very often. I previously had 2 batteries connected in parallel having a total capacity of 4600mAh. Now, i have connected 2 more batteries, the new capacity is 9200mAh. However, this did not solve the problem. But I still believe that the problem lies in the servos drawing too much current, but cant help it. Only by adding delays between actsetspeed commands, i was able to prevent resetting.

I installed the new Webbot 1.16 Library, hasan999 ( a member in this forum) suggested that I use 4 banks and use timers 1 3 4 5 for the 18 servos. When I turn on the Axon, the Axon resets constantly being unable to initiate 4 or 5 servos in each bank at the same time. I do believe that if I used more timers, thus reducing the number of servos in each timer, it will solve the problem of initiating the servos.

Regarding my original problem in actsetspeed commands and having to set delays between them, its really making it difficult to program my hexapod, as sometimes I need to move 3 servos at the same time, but I cant due to resetting. I am frustrated and I dont know how to proceed. Please help.

Thanks in advance.

Title: Re: How many timers can i use in Webbotlib 1.16 ?
Post by: Webbot on May 03, 2010, 11:30:45 AM
The actSetSpeed doesn't actually send anything to the servos - it just sets an internal variable. The interrupt routines then use the current value in the variable.

What may be happening is that you are trying to move the servos too far too quickly - hence the current requirement for the servos goes up. Your 'delay' probably reduces the current requirement and hence stops the reset.

As Hassan says you can use all of the 16 bit timers: ie 1,3,4 and 5.

I suggest you add an rprintf to send something from appInitSoftware to say that the Axon has re-started. Then physically unplug all of your servo and switch on. You will probably find that the Axon only prints the message once - ie it doesn't reset. If that's the case then its not a software problem - its still a problem with your power supply being unable to supply the required current.

Title: Re: How many timers can i use in Webbotlib 1.16 ?
Post by: bilals on May 03, 2010, 11:48:08 AM
What may be happening is that you are trying to move the servos too far too quickly - hence the current requirement for the servos goes up. Your 'delay' probably reduces the current requirement and hence stops the reset.

I am using it this way :
act_setSpeed(&Leg1_servo_2,50)

I am not sure here what the 50 is. Does it specify the speed and degrees of rotation? May you please suggest a value if 50 is not suitable.


As Hassan says you can use all of the 16 bit timers: ie 1,3,4 and 5.

So, i can only use timers 1,3,4 and 5, right?

I suggest you add an rprintf to send something from appInitSoftware to say that the Axon has re-started. Then physically unplug all of your servo and switch on. You will probably find that the Axon only prints the message once - ie it doesn't reset. If that's the case then its not a software problem - its still a problem with your power supply being unable to supply the required current.

I have an rprintf command in appInitSoftware, it comes after the appInitHardware. When switching on the Axon, it resets before it reaches the rprintf command.


Thanks for your help.
Title: Re: How many timers can i use in Webbotlib 1.16 ?
Post by: Webbot on May 03, 2010, 12:14:57 PM
What may be happening is that you are trying to move the servos too far too quickly - hence the current requirement for the servos goes up. Your 'delay' probably reduces the current requirement and hence stops the reset.

I am using it this way :
act_setSpeed(&Leg1_servo_2,50)

I am not sure here what the 50 is. Does it specify the speed and degrees of rotation? May you please suggest a value if 50 is not suitable.
The second parameter, 50, can be a value between DRIVE_SPEED_MIN and DRIVE_SPEED_MAX which are -127 and +127 respectively. Its not 'degrees' as this depends on the specific servo you use.


As Hassan says you can use all of the 16 bit timers: ie 1,3,4 and 5.

So, i can only use timers 1,3,4 and 5, right?
For servos => Yes


I suggest you add an rprintf to send something from appInitSoftware to say that the Axon has re-started. Then physically unplug all of your servo and switch on. You will probably find that the Axon only prints the message once - ie it doesn't reset. If that's the case then its not a software problem - its still a problem with your power supply being unable to supply the required current.

I have an rprintf command in appInitSoftware, it comes after the appInitHardware. When switching on the Axon, it resets before it reaches the rprintf command.

If it resets before the rprintf is called then your main loop is never called - and so your servos can't be moving  ???

Perhaps you could post some code.
Title: Re: How many timers can i use in Webbotlib 1.16 ?
Post by: Admin on May 05, 2010, 11:18:48 PM
I told hasan999 a million times its very likely a power problem. I suspect the same here. :P

First, measure the voltage while its resetting. If its a voltage issue, you'll see the voltage drop below ~5.3V. Even if it happens for a millisecond, the Axon will reset.

Second, measure the current draw. You can also estimate the peak current draw by multiplying the number of analog servos that will be on at any time by 1A. So 18 servos is 18A. If its digital servos, multiple it by 2A for a peak estimate.

Also, mAh has nothing to do with the current a battery can supply at a particular point in time. The battery datasheet will list a maximum current draw (probably 15A-20A), and the voltage drop at that current draw (probably half the voltage). Four batteries is a lot . . . I'm guessing 6V NiMH type? For high current apps, NiCads are actually better.
Title: Re: How many timers can i use in Webbotlib 1.16 ?
Post by: bilals on May 06, 2010, 10:10:20 AM
I told hasan999 a million times its very likely a power problem. I suspect the same here. :P

First, measure the voltage while its resetting. If its a voltage issue, you'll see the voltage drop below ~5.3V. Even if it happens for a millisecond, the Axon will reset.

Second, measure the current draw. You can also estimate the peak current draw by multiplying the number of analog servos that will be on at any time by 1A. So 18 servos is 18A. If its digital servos, multiple it by 2A for a peak estimate.

Also, mAh has nothing to do with the current a battery can supply at a particular point in time. The battery datasheet will list a maximum current draw (probably 15A-20A), and the voltage drop at that current draw (probably half the voltage). Four batteries is a lot . . . I'm guessing 6V NiMH type? For high current apps, NiCads are actually better.

I have measured the voltage while powering the axon and when it resets with all servos connected, it hardly goes below 6V. I am having a difficulty in measuring the current draw as sometimes the axon does not power when the multimeter is connected. When it powers, it does not seem to be receiving as much current as when the multimeter is not connected.

Unfortunately there is no datasheet for the batteries I have, but they are of NiMH type. Admin, you said that the maximum current draw lies b/w 15-20A and the voltage drop would be by half. But since the voltage is not dropping below 6V, does that mean its not drawing that much current ?

I am really confused here. Why is the Axon reseting when the voltage is not dropping ? I do still believe that its a power issue.

The weight of my hexapod is about 2.5-3kg, is that a lot ? All servos seem to be working, but could a servo although its working be drawing a lot of current and its not supposed to? Is it okay to use any of the Axon pins with unregulated voltage for the servos?

Sometimes when i switch the Axon power on, the axon just seems to reset constantly (feels that no processing is going on) with the servos moving randomly (does not follow the sequence of the bank initiation commands) . So i switch it off and on a couple of times,  it continues to reset,but it is then clear that it is processing and trying to run the program with the servos moving, being in order to that i used in the banks ( bank 1 --> bank 2--> etc..). I don't know what's that about. Do you have any idea ?

Now, if we assume that its a power issue and has to do with the batteries I am using, then what should I do ?
Title: Re: How many timers can i use in Webbotlib 1.16 ?
Post by: TrickyNekro on May 06, 2010, 10:22:18 AM
You actually need a scope to see that... multimeters are just two slow for this....
Because the have a in software low pass filter, sharp peaks are cut out.... again multimeters are for
getting an accurate value not to see what is happening...
Only very small portion of multimeters are fast enough to get a millisecond lasting peak... and they 're usually more than just expensive.... Get a scope to see that...

It's more than possible that Admin has enabled the blown out fuse which will reset the Axon with any voltage lower than 4.5V at the IC power line or Vpp

Also multi batteries in parallel aren't really the way... best if you get a big enough switching regulator and power the servos from there....

That's it folks...
Title: Re: How many timers can i use in Webbotlib 1.16 ?
Post by: Admin on May 06, 2010, 10:45:44 AM
Quote
Unfortunately there is no datasheet for the batteries I have, but they are of NiMH type. Admin, you said that the maximum current draw lies b/w 15-20A and the voltage drop would be by half. But since the voltage is not dropping below 6V, does that mean its not drawing that much current ?
Well, you have four batteries in parallel, so if you're doin 20A, then thats 5A per battery. A bit high, but shouldn't be a problem. What servos are you using? And for what?

I recommend going through all the advice we gave hasan999. For example, remove all of your servos and see if the reset still occurs. This will show whether its a hardware or software issue.
(yea, its a pain to remove so many servos and keep track of what goes where, but its the only way)

As Tricky was saying, only a scope will really let you be sure for voltage.

As for measuring current, it sounds like your multimeter has a current limitation. Instead, measure the current coming from just one battery, but still have all four in parallel. It'll tell you what 1/4th your current is (just multiply by 4 to get the total).

Quote
It's more than possible that Admin has enabled the blown out fuse which will reset the Axon with any voltage lower than 4.5V at the IC power line or Vpp
Yeap, the brown (not blown) out fuse is set to 4.3V. I set the fuse by default so that EEPROM works without any problems. The voltage regulator will stop functioning properly if you go below 5V, anyway.
Title: Re: How many timers can i use in Webbotlib 1.16 ?
Post by: KurtEck on May 06, 2010, 11:18:00 AM
Personally the other thing I would do is change the Axon2 to the two battery configuration, plug in something like a simple 9v battery to the logic side and see if it still resets.  That is normally how I run all of my larger robots, like hexapods and the like.  It is easier on the Lynxmotion Bot Board 2s to do this as you simply remove a jumper and screw the battery wires into the battery terminals.  But the Axon2 does provide this capability.

Kurt
Title: Re: How many timers can i use in Webbotlib 1.16 ?
Post by: Admin on May 06, 2010, 11:43:22 AM
Personally the other thing I would do is change the Axon2 to the two battery configuration, plug in something like a simple 9v battery to the logic side and see if it still resets.  That is normally how I run all of my larger robots, like hexapods and the like.
I second this. My ERP also runs on two separate batteries.