Search the web
Sign In
New User? Sign Up
basicx · Discussion list for the BasicX family of microcontroller chips
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Serial communication problem   Message List  
Reply | Forward Message #23104 of 23222 |
Re: Serial communication problem

Zack,


It sounds like your robot arm is starving for current and the BX-24
is rebooting.

You need a minumum of 2amps of available current to run each hobby servo. Do you
have that? Try starting with only 1 servo connected and see what happens.


Chris



--- In basicx@yahoogroups.com, "zack.nathan" <zack.nathan@...> wrote:
>
> Ok so basically i have built a robotic arm and would like to control it from
the computer. I have done the application for the computer and it works. I have
also programmed the firmware for the bx-24 chip. However when i turn it on, all
the servo's move so the arm looks like it is having a spasm. I dont know why
this is. Could someone please check through it and tell me whats wrong, many
thanks, zack.
>
> CODE:
>
>
> Dim Data(1 To 3) As Byte ' defne variables
> Dim Com1_In(1 To 40) As Byte
> Dim Com1_Out(1 To 20) As Byte
> dim baseservo as single
> dim basejointservo as single
> dim middlejointservo as single
> dim turngripperservo as single
> dim tiltgripperservo as single
> dim gripperservo as single
> Sub Main()
> Call OpenQueue(Com1_In, 40)
> Call OpenQueue(Com1_Out, 20)
> Call OpenCom(1, 2400, Com1_In, Com1_Out)
> ' Set pins 5 - 20 to outputs
> Register.DDRA = &HFF
> Register.DDRC = &HFF
> baseservo = 0.0 ' start of with the pulses being 0, ie not moving
> basejointservo = 0.0
> middlejointservo = 0.0
> turngripperservo = 0.0
> tiltgripperservo = 0.0
> gripperservo = 0.0
> Do
> call pulseout(5, baseservo, 1) ' move joints
> call pulseout(6, basejointservo, 1)
> call pulseout(7, middlejointservo, 1)
> call pulseout(8, turngripperservo, 1)
> call pulseout(9, tiltgripperservo, 1)
> call pulseout(10, gripperservo, 1)
> If StatusQueue(Com1_In) Then
> Call GetQueue(Com1_In, Data(1), 1)
> If Data(1) = 255 Then ' if data byte is found do algorithm
> Call GetQueue(Com1_In, Data(2), 2)
> Call GetQueue(Com1_In, Data(3), 3)
> ' Write the 2 data byte to the BX-24 pins
> Register.PortA = Data(2)
> Register.PortC = Data(3)
> if (Data(2) = 1) then
> baseservo = csng(Data(3)) * 0.00001
> elseif (Data(2) = 2) then
> basejointservo = csng(Data(3)) * 0.00001
> elseif (Data(2) = 3) then
> middlejointservo = csng(Data(3)) * 0.00001
> elseif (Data(2) = 4) then
> turngripperservo = csng(Data(3)) * 0.00001
> elseif (Data(2) = 5) then
> tiltgripperservo = csng(Data(3)) * 0.00001
> elseif (Data(2) = 6) then
> gripperservo = 0.002
> elseif (Data(2) = 7) then
> gripperservo = 0.001
> elseif (Data(2) = 8) then
> exit do
> end if
> end if
> End If
> Loop
>
> End Sub
>





Fri Jul 10, 2009 8:38 pm

robotlogic
Offline Offline
Send Email Send Email

Forward
Message #23104 of 23222 |
Expand Messages Author Sort by Date

Ok so basically i have built a robotic arm and would like to control it from the computer. I have done the application for the computer and it works. I have...
zack.nathan
Offline Send Email
Jul 10, 2009
6:15 pm

Zack, It sounds like your robot arm is starving for current and the BX-24 is rebooting. You need a minumum of 2amps of available current to run each hobby...
robotlogic
Offline Send Email
Jul 10, 2009
8:38 pm

Well yes, i use a RAMB II so it should be ok. But even if it were re-booting surly the servo's shouldnt move because of the variables start of value of 0....
zack.nathan
Offline Send Email
Jul 10, 2009
9:00 pm

If I recall a pulseoout 0 still makes a pulse. I can tell you that what you have described sounds like a current issue, or the servos are being told to go out...
robotlogic
Offline Send Email
Jul 10, 2009
9:40 pm

Ill be trying 1 servo tomorrow, thanks. Yes, the batteries are normal rechargeable batteries. If 0.0 makes a pulse then that is probably the case. I'll try out...
zack.nathan
Offline Send Email
Jul 10, 2009
10:12 pm

My money is on Load Induced Processor Resets, too. Later, you might be able to condition a single supply to serve both processor and servo successfully but, at...
Tom Becker
b19063
Online Now Send Email
Jul 10, 2009
11:16 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help