tag:blogger.com,1999:blog-4774014561040227748.post8834002779083323480..comments2024-03-22T10:42:05.161-06:00Comments on KA7OEI's blog: Electrically driving a mechanical speedometer from a remote wheel sensor using a motor and PID loopUnknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-4774014561040227748.post-34360136875986683012021-01-20T14:04:22.526-07:002021-01-20T14:04:22.526-07:00Thank you for your comments: Your comment made me...Thank you for your comments: Your comment made me look at the equation and I found that I'd made a typo - so I corrected it so that Kd=(Kp*Pu)/8 - just as it appeared in Reference #2, which is where I started with the initial values.<br /><br />The Speedometer calibration "check" was done simply by powering the drive motor from a variable DC power supply and correlating the rotational speed to what the speedometer said. In doing this, we noticed that - as it typical with mechanical speedometers - there is a bit of nonlinearity, but this simply means that at some point - if it is bothersome - that a simple lookup/correction table will be added to the code.<br /><br />While the 4-wheeler has been driven around the neighborhood and the speedometer was observed to go up and down and indicate something sensible, it's not yet at the point where it will be taken out into the wild and driven. When that happens, my friend will make note of the speedometer readings and the actual speed (as read from a GPS receiver) and come to me with that information and we'll make the corrections as necessary.<br />KA7OEIhttps://www.blogger.com/profile/01153508130273704727noreply@blogger.comtag:blogger.com,1999:blog-4774014561040227748.post-38155714009884497632021-01-20T12:45:49.308-07:002021-01-20T12:45:49.308-07:00Thank you for posting about using PID to control a...Thank you for posting about using PID to control a speedometer. I have a motor connected to a speedometer and it works o.k. so far. I would like to use PID for smoother operation and your description is easy to understand. <br />I have found that there is a motor torque curve and a speedometer spring tension curve. If I set the motor to start at the predetermined input frequency, and reach maximum speed at the correct frequency, the values between min and max are off, not linear. I corrected that by using an equation determined by the curve.<br />I am using a signal from the vehicle generated from a reluctor ring and converted to 2000 pulses per mile. I use that 2000ppm frequency to determine a PWM from an Arduino. I created a chart in excel and inserted a trendline to find the regression model of the torque curve equation. I then use this equation with the 2kppm to get the PWM. <br />My motor has an optical disk.To use the PID, I will use the optical disk for the actual speed, and the 2kppm to determine the desired speed. <br />I have created a spreadsheet with the 2kppm frequency and my measured optical disk at each frequency. Create a chart from the two datasets, and insert trendline to find the regression model equation. Use that equation with the 2kppm to find the desired speed. <br />How do you determine the desired_speed for the 4wheeler speedo? I figured out an equation to convert the control frequency to match the optical disk frequency. It is close but not exact.<br />My speedometer is running smoother with the PI code, and pretty acurate too! I wanted to add the D, but got confused with your equations. Because you listed a reference, I checked the Ziegler-Nichols method and found the Kd=(Kp*Pu)/8 for PID where your equation shows Kd=(Kd*Pu)/8. The equations are a bit confusing, some that you list look like the PI type on the Ziegler-Nichols chart.<br />Thanks again for posting this easy to understand version of using PID to run a speedometer with a motor. Is the 4wheeler on the road yet?<br />metalangsthttps://www.blogger.com/profile/01488563391096827456noreply@blogger.com