10-11-2019 09:45 AM
Hello! I have a motor Odometer reading decreasing when turned opposite direction, which I do NOT want to happen. Anyone know how program a reading to increase instead of decreasing regardless of the direction of the motor?
Thanks for any help
Solved! Go to Solution.
10-11-2019 10:13 AM
If you'd attached some code, it would have been a little easier to make some suggestion, but perhaps you can do the following - take a current measurement of the reading (some number that goes up or down, i.e. represents position?) and then compare with the previous measurement.
Add to a shift register each iteration the absolute value of the previous calculation.
Hopefully this shows what I mean:
Here the absolute value is always 1, but in your case I expect that is not true!
10-11-2019 10:56 AM - edited 10-11-2019 11:08 AM
@musicguy2112 wrote:
Hello! I have a motor Odometer reading decreasing when turned opposite direction, which I do NOT want to happen. Anyone know how program a reading to increase instead of decreasing regardless of the direction of the motor?
An odometer is an indicator. How does it get the speed information from the motor and how is the motor controlled?
If you want the value to always be positive, use the absolute value function right before the indicator.
(If you are reading an angle sensor repeatedly, you need to ensure that the sampling frequency is sufficient, else you might read an alias frequency (or speed), which will be wrong and might be negative. Similar to a movie of a wheel that seems to turn backwards even if the car goes forward)
10-11-2019 10:57 AM
@musicguy2112 wrote:
Hello! I have a motor Odometer reading decreasing when turned opposite direction, which I do NOT want to happen. Anyone know how program a reading to increase instead of decreasing regardless of the direction of the motor?
Thanks for any help
WOW that's a big order for someone who did not post any code or circuit diagram...
Without seeing that or knowing anything about your program or circuit, sensors, motor, etc.
All I can say is ignore the direction the motor is spinning and just count revolutions
10-11-2019 12:06 PM
@RTSLVU wrote:
@musicguy2112 wrote:
Hello! I have a motor Odometer reading decreasing when turned opposite direction, which I do NOT want to happen. Anyone know how program a reading to increase instead of decreasing regardless of the direction of the motor?
Thanks for any help
WOW that's a big order for someone who did not post any code or circuit diagram...
Without seeing that or knowing anything about your program or circuit, sensors, motor, etc.
All I can say is ignore the direction the motor is spinning and just count revolutions
An odometer implies a car engine. In all my life, I have never known an automobile engine to (purposely) operate in a manner backwards from what is normal. Is this a simulated odometer? Or, by "motor", do you mean "transmission tail shaft"? THAT can reverse direction if you put the car in reverse.
Sounds like homework to me.
10-11-2019 12:33 PM
@billko wrote:
@RTSLVU wrote:
@musicguy2112 wrote:
Hello! I have a motor Odometer reading decreasing when turned opposite direction, which I do NOT want to happen. Anyone know how program a reading to increase instead of decreasing regardless of the direction of the motor?
Thanks for any help
WOW that's a big order for someone who did not post any code or circuit diagram...
Without seeing that or knowing anything about your program or circuit, sensors, motor, etc.
All I can say is ignore the direction the motor is spinning and just count revolutions
An odometer implies a car engine. In all my life, I have never known an automobile engine to (purposely) operate in a manner backwards from what is normal. Is this a simulated odometer? Or, by "motor", do you mean "transmission tail shaft"? THAT can reverse direction if you put the car in reverse.
Sounds like homework to me.
Well I am (again) guessing that a car odometer is probably not exactly what is in question, as a car engine does not turn the opposite direction when moving in reverse.
But then again: Who knows? The OP did not provide any relevant information.
10-11-2019 12:58 PM
@musicguy2112 wrote:
Hello! I have a motor Odometer reading decreasing when turned opposite direction, which I do NOT want to happen....
That is technically illegal if we do it on purpose but if that is true...
Share some code and someone should be able to tell you were to put the absolute value node.
Ben
10-11-2019 01:00 PM
@RTSLVU wrote:
@billko wrote:
@RTSLVU wrote:
@musicguy2112 wrote:
Hello! I have a motor Odometer reading decreasing when turned opposite direction, which I do NOT want to happen. Anyone know how program a reading to increase instead of decreasing regardless of the direction of the motor?
Thanks for any help
WOW that's a big order for someone who did not post any code or circuit diagram...
Without seeing that or knowing anything about your program or circuit, sensors, motor, etc.
All I can say is ignore the direction the motor is spinning and just count revolutions
An odometer implies a car engine. In all my life, I have never known an automobile engine to (purposely) operate in a manner backwards from what is normal. Is this a simulated odometer? Or, by "motor", do you mean "transmission tail shaft"? THAT can reverse direction if you put the car in reverse.
Sounds like homework to me.
Well I am (again) guessing that a car odometer is probably not exactly what is in question, as a car engine does not turn the opposite direction when moving in reverse.
But then again: Who knows? The OP did not provide any relevant information.
Sorry, that was directed at the OP. 😉
10-11-2019 05:19 PM
thank you!!! and sorry I didnt provide a code. But this actually helped!