## 32 Reputation

11 years, 18 days

## Weird...

I rebuilt my system, exactly as I had it before. I tried my custom component (both round and trunc) and it works now (although it takes a long time to compute). I have no idea why. This software can be very fickle.

But anyway, I did have a revolute joint. Instead of measuring the angle from 0-360, I wanted to measure from 0-180, then -180 to 0 again. It's an inverted pendulum model, so I wanted displacements from the vertical to be opposite sign for opposite direction (-2 degrees opposed to 358 degrees). I'm including this precision limit, as well as a unit delay, to incorporate the effects of sensor precision and microcontroller calculation time, to determine which components are needed.

## Weird...

I rebuilt my system, exactly as I had it before. I tried my custom component (both round and trunc) and it works now (although it takes a long time to compute). I have no idea why. This software can be very fickle.

But anyway, I did have a revolute joint. Instead of measuring the angle from 0-360, I wanted to measure from 0-180, then -180 to 0 again. It's an inverted pendulum model, so I wanted displacements from the vertical to be opposite sign for opposite direction (-2 degrees opposed to 358 degrees). I'm including this precision limit, as well as a unit delay, to incorporate the effects of sensor precision and microcontroller calculation time, to determine which components are needed.

## Yes...

The model works without the precision subsystem. I am sensing the angle using the freebody Absolute Rotation, then an Extract Signal block to take out the correct rotation matrix element, then an inverse sine function to get the angle. This seems a bit drawn out, but it gives a positive angle for one direction and a negative angle for the other. This is useful for my control system.

I've also tried making an algebraic equation custom component. I've tried:

y=P*round(x/P)

y=P*trunc(x/P)

Where P is the desired precision. But neither work!

From the error messages I'm thinking the problem could be with the PID controller I'm using ("problem creating integrator"). I've tried using my angle sensing system with the precision subsystem and it works. Including the control system seems to be whats causing the errors.

## Yes...

The model works without the precision subsystem. I am sensing the angle using the freebody Absolute Rotation, then an Extract Signal block to take out the correct rotation matrix element, then an inverse sine function to get the angle. This seems a bit drawn out, but it gives a positive angle for one direction and a negative angle for the other. This is useful for my control system.

I've also tried making an algebraic equation custom component. I've tried:

y=P*round(x/P)

y=P*trunc(x/P)

Where P is the desired precision. But neither work!

From the error messages I'm thinking the problem could be with the PID controller I'm using ("problem creating integrator"). I've tried using my angle sensing system with the precision subsystem and it works. Including the control system seems to be whats causing the errors.

 Page 1 of 1
﻿