hexagon logo

Can we deactivate a motor during simulation? I'm running the simulation through an ACF file and would like to deactivate the motor once a sensor gets triggered.

Can we deactivate a motor during simulation? I'm running the simulation through an ACF file and would like to deactivate the motor once a sensor gets triggered.
Parents
  • There is a couple of ways of doing this. I assume that your motor is modeled as an SForce, producing a torque.
    The "classic way" would be to simply define the sensor as a stop-and-go action (return to command level). Then your acf would look something like this:
    sim/tra, end=42, dtout=0.025
    decativate/sforce, id=991
    sim/tra, end=42, dtout=0.025
    I.e. start the simulation. When the sensor stops the current level, deactivate the sforce and continue to the end-time. You might also have to deactivate the sensor itself.
     
    A more "modern" approach is to use the sensor evaluation value (SENVAL). In this case, you don't have to do anything in the acf.
    Multiply your sforce function with (1-SENVAL(sensor_name))
    Define the sensor evaluate function = 1.
    Before the sensor is triggered the first time, the SENVAL function returns 0. Once the sensor triggered and evaluated, the function returns 1. In other words, before the sensor is triggered, your sforce is (1-0)*function(). After the sensor triggered, the sforce function is (1-1)*function().
     
     
     
Reply
  • There is a couple of ways of doing this. I assume that your motor is modeled as an SForce, producing a torque.
    The "classic way" would be to simply define the sensor as a stop-and-go action (return to command level). Then your acf would look something like this:
    sim/tra, end=42, dtout=0.025
    decativate/sforce, id=991
    sim/tra, end=42, dtout=0.025
    I.e. start the simulation. When the sensor stops the current level, deactivate the sforce and continue to the end-time. You might also have to deactivate the sensor itself.
     
    A more "modern" approach is to use the sensor evaluation value (SENVAL). In this case, you don't have to do anything in the acf.
    Multiply your sforce function with (1-SENVAL(sensor_name))
    Define the sensor evaluate function = 1.
    Before the sensor is triggered the first time, the SENVAL function returns 0. Once the sensor triggered and evaluated, the function returns 1. In other words, before the sensor is triggered, your sforce is (1-0)*function(). After the sensor triggered, the sforce function is (1-1)*function().
     
     
     
Children
No Data