E Stop with Packetized Serial on Arduino
-
- Posts: 2
- Joined: Wed Aug 31, 2016 1:12 pm
E Stop with Packetized Serial on Arduino
Hello there,
I need a little assistance understanding how to implement the E-Stop functionality when in packetized serial mode. I basically want to watch the result from commands I'm sending via the arduino library.
I need a little assistance understanding how to implement the E-Stop functionality when in packetized serial mode. I basically want to watch the result from commands I'm sending via the arduino library.
If I'm using packetized serial and I receive an error condition, I want to have both channels of my controller go to the home position. How do I wire this? This has me a little confused. Should I put a HIGH(5v) or a LOW (ground) to these pins?S1, S2, S3, S4 and S5 are setup for standard servo style headers I/O(except on ST models),
+5V and GND. S1 and S2 are the control inputs for serial, analog and RC modes. S3 can be
used as a flip switch input when in RC or Analog modes. In serial mode S3, S4 and S5 can be
used as emergency stop inputs or as voltage clamp control outputs. When set as E-Stop inputs
they are active when pulled low and have internal pullups so they will not accidentally trip when
left floating. S4 and S5 can also optionally be used as home signal inputs. The pins closest to
the board edge are the I/0s, center pin is the +5V and the inside pins are ground. Some RC
receivers have their own supply and will conflict with the RoboClaw’s 5v logic supply. It may be
necessary to remove the +5V pin from the RC receivers cable in those cases.
- Basicmicro Support
- Posts: 1594
- Joined: Thu Feb 26, 2015 9:45 pm
Re: E Stop with Packetized Serial on Arduino
The E-STOP and HOME signals are active low(eg pull the pin low to e-stop/home). However e-stop is not really appropriate for you since you want to home the motors after an error. If you mean an error in the roboclaw you shouldnt be moving the motors after a Roboclaw error(Roboclaw errors are only over temp(way over) and over voltage(again way over) related. Either of which is indicating a major problem with your setup(over sized motor for the board, runing from a power supply without v-clamp for regen, running encolosed with improper airflow/cooling etc).
If you mean error as in an error you defined in your arduino code then you can just send a command to stop the motors(usually somethign like setting M1Duty to 0).
If you mean error as in an error you defined in your arduino code then you can just send a command to stop the motors(usually somethign like setting M1Duty to 0).
-
- Posts: 2
- Joined: Wed Aug 31, 2016 1:12 pm
Re: E Stop with Packetized Serial on Arduino
Thanks for the quick reply.
Here were my thoughts. I noticed that all of of the calls through the arduino lib returned with a boolean meaning that the command completed successfully. I wanted to force the controller to 0 in the case that any one of these calls returned false. My thoughts were an additional safety step to ensure that I didn't get a run away.
Here were my thoughts. I noticed that all of of the calls through the arduino lib returned with a boolean meaning that the command completed successfully. I wanted to force the controller to 0 in the case that any one of these calls returned false. My thoughts were an additional safety step to ensure that I didn't get a run away.
- Basicmicro Support
- Posts: 1594
- Joined: Thu Feb 26, 2015 9:45 pm
Re: E Stop with Packetized Serial on Arduino
I would recommend retrying the command if it failes at least some number of times. The Roboclaw arduino library currentl will only retry the command 3 times internally before giving up and I beleive the pythin library leaves retries up to the user altogether.
In the situation where you are unable to get a command throught he E-Stop would be the recommended method to stop the board but it should only be used in those kinds of situations(eg when you have lost control).
In the situation where you are unable to get a command throught he E-Stop would be the recommended method to stop the board but it should only be used in those kinds of situations(eg when you have lost control).