Announcement

Collapse
No announcement yet.

Preset Position (runtoposition) and Manual Position (runusingencoder) Simultaneously

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Preset Position (runtoposition) and Manual Position (runusingencoder) Simultaneously

    well not exactly simultaneously but driving motor arm positions with the joystick and being able to push a button and the arm will advance to a predetermined position whereafter joystick control is regained. I

  • MikeRush
    replied
    Thanks. We are coding with blocks for now. I could not find a blocks equivalent. Do you know it if exists?

    Leave a comment:


  • Noah
    replied
    Originally posted by MikeRush View Post
    Do you know if you can read the motor mode programmatically (determine what mode a certain motor is currently in)?
    Code:
    motor.getMode()
    This will return the current mode of the motor "motor".

    Leave a comment:


  • MikeRush
    replied
    Thanks for the reply. We did figure out based on other posts that a state machine would do the trick...

    peudo code

    run the loop
    if controller button pushed then set state variable to 1
    if joystick input received then set state variable to 2
    if state = 1 then set mode to run_to_position: set desired position: set desired power (motor will run to whatever the desired position is)
    if state = 2 then set mode to run_with_encoders : set power to joystick values (motor will react to joysticks)
    loop

    basically the state will only change when the appropriate inputs are received and the run to position can be interrupted by joystick input which is what we were after.

    The operation will be push the button to get to the desired position but if something changes, joystick input will override and control will be returned to the operator.

    Do you know if you can read the motor mode programmatically (determine what mode a certain motor is currently in)?

    Leave a comment:


  • markdmatthews
    replied
    Not entirely sure how one would do this in blocks, but our team is doing something similar with a state machine that has a "closed loop" set of states (moving to predefined positions), and an "open loop" set of states (respond to human inputs). The transitions from those states are all human-initiated in the case of the "open loop" states, and some are autonomous (reached target position) and some are human initiated (stop doing what you're doing, go in some other direction) for the "closed loop" states.

    Leave a comment:


  • MikeRush
    replied
    I forgot. The team is using blocks programming

    Leave a comment:

Working...
X