loading
 
Sero movment rates and Query servo position
Robert from China  [6 posts]
6 years
Hi there,

I was sifting through some code on the forums.  I came across  this:

  ' adjust rate
  diff = GetVariable("servo_1_pos") - GetVariable("end_servo_1_pos")
  if diff < 0 then diff = - diff
  if diff < 1000 then
    SetVariable "channel_1_rate", 3000
  elseif diff < 500 then
    SetVariable "channel_1_rate", 2000
  elseif diff < 100 then
    SetVariable "channel_1_rate", 100
  end if

But It leaves me with a few questions.
1.  diff = GetVariable("servo_1_pos") - GetVariable("end_servo_1_pos")

I take it that GetVariable("servo_1_pos") can be had from my set variable for the x servo commanded position from the COG_X variable, but  GetVariable("end_servo_1_pos") leaves me wondering where that is taken from.

I have been searching for the last 3 days trying to figure out how to get that number.

I tried to use that code Like it was but not only could I not find end_servo_1_pos. I also could not get the rate to change in the SSC-32 module.

2.  So just how do I go about reading it end position and setting the actual servo movenent rate?


Thanks,

Robert
Robert from China  [6 posts] 6 years
OK correct me if I'm wrong here, I was checking out the module and COG_X.
I unplugged my pan servo then watched COG_X.  It would seem to me that COG_X is the real "end_servo_1_pos" variable.

so I should be able to assign COG_X to the "end_servo_1_pos" variable
would that be correct?

That being said then that just leaves me with how to query the servos current position and how to change the rate.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index