Multiple Servo Axis and Timed INT flowcode block
Posted: Tue Jun 19, 2007 9:19 pm
Hi,
Still trying to figure out servos and have read a great deal about them. Now I need to know if I understand them, and how timed INT factors in to the equation.
Servo's operate by sending a pulsed output to them, which tells them what position to go to. Hitec typically is 1100us for -45, 1500 for 0, 1900us for +45.
Down and dirty code would be.....
turn on output
delay 1.9ms (go to +45)
turn off output
delay 20ms
repeat to hold
Servo's require this pulse be sent every 20ms or less to hold position, less time is OK, longer == not held in position.
Is the above correct?
If it is.......
How does INT block work in flowcode since flowcharts are inherently sequential by design. I place my INT block as the second block of the flowchart, just below a decision block that is waiting for Switch to go ON to start my sequence of motions.
Since switch has not been pressed yet, are INT macros running?
Does the INT routines run in "parallel" with the "sequential" solving logic?
I want to be able to have "sequential" logic solve, pneumatic motions that can take several seconds to complete or time delay logic while I count down extended time delay BUT still have the servos move or hold a position while doing these other things.
Will the INT logic solve even if I am sitting in a decision block waiting for an input to go on OR at a delay block while waiting for the 8 seconds to end?
Assuming the INT macros do solve in parallel with the sequential logic can I have several INT blocks in a row using the same TIMER, trigger different macros, each controlling a particular servo?
This way my "sequential" logic solves, but all the connected servos will move to and/or hold position?
Is this correct?
I realize that servos are not the responsibility of this forum, I am hoping to figure out how to use standard flowcode logic blocks to create multi axis servo control.
Next thing is how do I count in micro-seconds using standard flocode blocks?
Thanks
Ron
Still trying to figure out servos and have read a great deal about them. Now I need to know if I understand them, and how timed INT factors in to the equation.
Servo's operate by sending a pulsed output to them, which tells them what position to go to. Hitec typically is 1100us for -45, 1500 for 0, 1900us for +45.
Down and dirty code would be.....
turn on output
delay 1.9ms (go to +45)
turn off output
delay 20ms
repeat to hold
Servo's require this pulse be sent every 20ms or less to hold position, less time is OK, longer == not held in position.
Is the above correct?
If it is.......
How does INT block work in flowcode since flowcharts are inherently sequential by design. I place my INT block as the second block of the flowchart, just below a decision block that is waiting for Switch to go ON to start my sequence of motions.
Since switch has not been pressed yet, are INT macros running?
Does the INT routines run in "parallel" with the "sequential" solving logic?
I want to be able to have "sequential" logic solve, pneumatic motions that can take several seconds to complete or time delay logic while I count down extended time delay BUT still have the servos move or hold a position while doing these other things.
Will the INT logic solve even if I am sitting in a decision block waiting for an input to go on OR at a delay block while waiting for the 8 seconds to end?
Assuming the INT macros do solve in parallel with the sequential logic can I have several INT blocks in a row using the same TIMER, trigger different macros, each controlling a particular servo?
This way my "sequential" logic solves, but all the connected servos will move to and/or hold position?
Is this correct?
I realize that servos are not the responsibility of this forum, I am hoping to figure out how to use standard flowcode logic blocks to create multi axis servo control.
Next thing is how do I count in micro-seconds using standard flocode blocks?
Thanks
Ron