Main > Driving & Racing Cabinets
DIY Home Steering Wheel
BadMouth:
--- Quote from: Generic Eric on May 09, 2014, 07:46:07 am ---
--- Quote from: Generic Eric on May 08, 2014, 08:21:09 pm ---The motor says 90VDC, 2174RPM 1.51AMPS 67 in/oz TORQUE
BTW, I think patents for software are dumb. Why not patent English?
--- End quote ---
I looked at a SF Rush manual and by no way saw 90 VDC. The troubleshooting section said to look for voltage around 25V.
Anyway
--- End quote ---
The machines that use the happ setup usually run 24v power supplies for the ffb motor.
I've seen anywhere from 36-90v on the motors themselves.
Of the people who were happy with the happ/servo amp hack, I know at least one had the 90v motor.
Also, they both used an older version of the Logitech driving force wheel. (the one used in Mark Shaker's original tutorial)
No idea if one or both play a role in it working better.
twistedsymphony:
I managed to salvage the code I was looking for... my memory was somewhat incorrect... the smoothing calculation wasn't used for steering as the steering was handled by a servo motor so discrete positional control was trivial.
the smoothing calculation WAS used for PWM speed control output to the drive wheels as those used normal DC motors...
Here is the relevant equation without any of the other noise:
--- Code: ---/*set up PI speed control constants*/
kp = 100;
ki = 40;
motorpw = 1;
prev_error = 0;
new_speed = 0;
/* extracted from the run loop */
desired_speed = speed_wanted(); /* calculates a number for desired speed between 0 and 90 */
if(new_speed) /* if a new speed value is available, calculate the new motorpw */
{
/* calculate pulsewidth based on comparison between desired and actual speed*/
temp_motorpw = (long int)motorpw + (long int)((ki+kp)*(desired_speed - actual_speed)) - (long int)(kp*prev_error);
if(temp_motorpw >63000) /* checks to make sure that the motorpw will not exceed 63000 */
temp_motorpw = 63000;
if(temp_motorpw<100) /* checks to make sure that the motorpw will not be less than 100 */
temp_motorpw = 100;
if(abs(motorpw-_H11TCNT)>100)
{
motorpw = temp_motorpw; /* changes pulsewidth sent to motor based on temp_motorpw */
prev_error = desired_speed - actual_speed; /* store previous error */
new_speed = 0; /* resets new_speed to zero */
}
}
--- End code ---
I'm not entirely sure how I determined the kp or ki constants nor can I remember exactly what they represent at this point but the major idea here is that when the speed is changing over time you take into consideration the previous value from the last loop (note the prev_error is saved AFTER the PW is calculated for use within the next loop.)
the other code basically works such that once the speed drops below or above a certain point it clips it allowing the motor to essentially stop or max out safely.
---------
I think it's important to note that with a 2-wire DC motor you'll never truly be able to "HOLD" the wheel in a certain position, the best you can hope for is stopping it gently in that location and turning the motor off, then re-apply force to return to that position when the user attempts to move it.
you wont be able to make this work with a multitude of motors... the characteristics of each will be different and the variables in the equation would need to be tweaked to make it work with the chosen motor.
Generic Eric:
--- Quote from: twistedsymphony on May 09, 2014, 09:31:44 am ---I managed to salvage the code I was looking for... my memory was somewhat incorrect... the smoothing calculation wasn't used for steering as the steering was handled by a servo motor so discrete positional control was trivial.
the smoothing calculation WAS used for PWM speed control output to the drive wheels as those used normal DC motors...
Here is the relevant equation without any of the other noise:
--- Code: ---/*set up PI speed control constants*/
kp = 100;
ki = 40;
motorpw = 1;
prev_error = 0;
new_speed = 0;
/* extracted from the run loop */
desired_speed = speed_wanted(); /* calculates a number for desired speed between 0 and 90 */
if(new_speed) /* if a new speed value is available, calculate the new motorpw */
{
/* calculate pulsewidth based on comparison between desired and actual speed*/
temp_motorpw = (long int)motorpw + (long int)((ki+kp)*(desired_speed - actual_speed)) - (long int)(kp*prev_error);
if(temp_motorpw >63000) /* checks to make sure that the motorpw will not exceed 63000 */
temp_motorpw = 63000;
if(temp_motorpw<100) /* checks to make sure that the motorpw will not be less than 100 */
temp_motorpw = 100;
if(abs(motorpw-_H11TCNT)>100)
{
motorpw = temp_motorpw; /* changes pulsewidth sent to motor based on temp_motorpw */
prev_error = desired_speed - actual_speed; /* store previous error */
new_speed = 0; /* resets new_speed to zero */
}
}
--- End code ---
I'm not entirely sure how I determined the kp or ki constants nor can I remember exactly what they represent at this point but the major idea here is that when the speed is changing over time you take into consideration the previous value from the last loop (note the prev_error is saved AFTER the PW is calculated for use within the next loop.)
the other code basically works such that once the speed drops below or above a certain point it clips it allowing the motor to essentially stop or max out safely.
---------
I think it's important to note that with a 2-wire DC motor you'll never truly be able to "HOLD" the wheel in a certain position, the best you can hope for is stopping it gently in that location and turning the motor off, then re-apply force to return to that position when the user attempts to move it.
you wont be able to make this work with a multitude of motors... the characteristics of each will be different and the variables in the equation would need to be tweaked to make it work with the chosen motor.
--- End quote ---
Thanks for the share
--- Quote from: twistedsymphony on May 09, 2014, 09:31:44 am ---you wont be able to make this work with a multitude of motors... the characteristics of each will be different and the variables in the equation would need to be tweaked to make it work with the chosen motor.
--- End quote ---
Anticipated that this would be the case. I mentioned it in hopes to lead to choosing a particular motor. In the mean time I'm going to do some reading about this Teensy board and see if someone has already used it to communicate to a motor controller to drive a motor.
twistedsymphony:
the motors used by San Fran rush are pretty common, that was a widely used machine, it was produced in the US I see them pop up for sale a lot and at reasonable prices too.
The Sega Motor would be another good choice for the same reasons as would the HAPP motor... despite it's cost new it IS still being made new which is worth considering.
--------
HMM I just had a thought... it's possible you could develop some code to auto configure for you motor... like a 1 time calibration. that would be pretty neat.
For now though I would just run with what you've got...
yotsuya:
I actually have a spare Happ FFB motor and FFB board, if anyone is interested. The FFB keeps blowing a fuse, but was working. Just to throw out there.
Navigation
[0] Message Index
[*] Previous page
Go to full version