Emergency stop simulation on robotstudio
Amjed
✭
in RobotStudio
I am a student and i am working on Emergency stop simulation on RobotStudio. Actually my purpose is to compare the emergency stop distance in reality and the emergency stop distance on RobotStudio. Is it possible to simulate that on RobotStudio ?
Thank you a lot and have a nice day.
Best regards,
Thank you a lot and have a nice day.
Best regards,
0
Comments
-
Hi Amjed,
There is a lot of useful info in this old forum post: https://forums.robotstudio.com/discussion/4969/simulate-emergency-stop#latest
Also, there is two types of emergency stops, Category 1 and Category 0.
You cannot rely on the data from the robot controller after emergency stop has been issued, therefore it is hard to say if the end pose is accurate compared to the real world.
Best Regards
Oskar
1 -
Hi everybody,
For those who are interested in the simulation of the emergency stop category 0 and category 1. Using the signal analyzer, i tried to verify if the controler is able to save data after pushing the ES1 button. the controler stopped directly and there is no data saved after the order of stopping. Next step, i will try create an add-in which stops the robot mechanically ( mechanical brake) not the controler. If anybody wants to participate to help in this work, you are really welcome.
Regards,
/Amjed
0 -
Hi Amjed
You will not be able to activate the brakes in any other way than to issue a category0 stop (the controller will be involved).
Though maybe it is possible to log testsignals from the controller even after an emergency stop and in that way follow the stop pose.
Here are some known testsignals: https://forums.robotstudio.com/discussion/10562/test-signal-number
Testsignal subscriptions are a bit difficult to setup from the RobotStudio API(you need to implement the abstract class DataRecordersinkBase2), here is my implementation, hope it can be of use.class SinkBaseImplementation : DataRecorderSinkBase2 { private SimulationDataRecorder connectedRecorder; private DataRecorderSignal signalSubscribedTo = null; public SinkBaseImplementation(string sinkId, IList<DataRecorderSignal> signals) : base(sinkId, signals) { } public event EventHandler<EventArgs> NewDataEvent; public void SubscribeToSignal(RsIrc5Controller controller, RsMechanicalUnit mech, int joint, int testsignal) { if (signalSubscribedTo != null) throw new Exception("SinkBaseImplementation: I'm already subscribed to a signal!"); var signalInfo = new DataRecorderSignalInfo(SignalDataType.Number, SignalInterpolationType.Discrete, BuiltInControllerSourceSignals.MotionSignalTag); signalSubscribedTo = StationsHelper.GetMotionSignal(controller, mech.Name, joint, testsignal, signalInfo, ""); this.Signals.Add(signalSubscribedTo); } protected override void OnData(double time, DataRecorderSignal signal, object value) { NewDataEvent(value, new EventArgs()); } protected override void OnSignalsDisabled(double time, IEnumerable<DataRecorderSignal> signals) { //ignore for now } protected override void OnSignalsEnabled(double time, IEnumerable<DataRecorderSignal> signals) { //Do nothing. } public bool Dispose() { if(this.Signals.Contains(signalSubscribedTo)) this.Signals.Remove(signalSubscribedTo); var removed = RemoveMeFromSimulationDataRecorder(connectedRecorder); return removed; } private bool RemoveMeFromSimulationDataRecorder(SimulationDataRecorder dataRec) { if (dataRec.Sinks.Contains(this)) return dataRec.Sinks.Remove(this); else return false; } public bool TryAddMeToSimulationDataRecorder(SimulationDataRecorder dataRec) { bool success = false; if (!dataRec.Sinks.Contains(this)) { connectedRecorder = dataRec; connectedRecorder.Sinks.Add(this); success = true; } return success; } }<br>
/Oskar
0 -
And this is how I use it:
public static SinkBaseImplementation InitDataRecorder(string sinkId, EventHandler<EventArgs> newDataHandler) { var sinkBase = new SinkBaseImplementation(sinkId, new List<DataRecorderSignal>()); sinkBase.NewDataEvent += newDataHandler; if (sinkBase.TryAddMeToSimulationDataRecorder(Simulator.DataRecorder)) return sinkBase; else throw new Exception("could not add data recorder"); }
0 -
Thank you Oskar ^^ the code you put above must be written on Visual Studio isn't it ? Can you please tell me where i find a document that helps me to create a program used on robotstudio because i don't know how to create a link between robotstudio and visual studio.
Regards,
/Amjed0 -
Hi Amjed
Yes it is C# code, you can use it by creating a RobotStudio Add-In:
http://developercenter.robotstudio.com/blobproxy/devcenter/RobotStudio/html/08a465af-bdcc-4f65-a647-764c14005d00.htm
An Add-In is runned by RobotStudio and does not neccesarily have any connection with a robot controller at all, meanwhile RAPID code is executed on the robot controller.
It is possible to read testsignals from RAPID as well
http://developercenter.robotstudio.com/BlobProxy/manuals/RapidIFDTechRefManual/doc471.html
0
Categories
- All Categories
- 5.5K RobotStudio
- 395 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings