Mick Cliffe Posted May 6, 2014 Report Posted May 6, 2014 Hi, I have converted a real RMI to use stepper motors and it is run through SIOC. It all works correctly, I use the *360/(65536*65536) equation on offset $0580 i get a 3 digit heading from -180 to +180 as I should. This means my stepper motors move every degree, but during slow turns this looks quite jerky. What I want is for the heading to be a 4 digit number, such as 263 & 1/2 degrees would read 2635. How should the equation look if i want it to read -1800 to +1800? This will give me 10x the resolution and make the movement smoother The Stepper motor card uses a value of 0 to 36000 for the position of the motor. My motors have 2048 steps for a full circle. Cheers.
Pete Dowson Posted May 6, 2014 Report Posted May 6, 2014 It all works correctly, I use the *360/(65536*65536) equation on offset $0580 i get a 3 digit heading from -180 to +180 as I should. This means my stepper motors move every degree, but during slow turns this looks quite jerky. What I want is for the heading to be a 4 digit number, such as 263 & 1/2 degrees would read 2635. How should the equation look if i want it to read -1800 to +1800? The Stepper motor card uses a value of 0 to 36000 for the position of the motor. My motors have 2048 steps for a full circle. Basic arithmetic. The heading provided by the offset you are reading is in units of 4,294,967,296ths of a full circle. That number is more easily remembered as 65536 x 65536. Nothing magic about that. You convert to whatever units you want. Obviously your should have units of 36,000ths of a circle, so you need to do the computation as (unsigned value from offset)*36000/(65536 * 65536) By using unsigned you get 0-35999. Do the computation in floating point then take the integer part of the result. Then you can use the value directly. Pete
Mick Cliffe Posted May 7, 2014 Author Report Posted May 7, 2014 Cheers Pete. I had tried that earlier, but was getting strange heading readings. I have since realized that i needed to do the same change of calculation for the Magnetic variation. ii have now fixed that, and also both the VOR and ADF relative bearings, and it all works beautifully. Thanks mate
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now