Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: DIY Home Steering Wheel  (Read 31445 times)

0 Members and 1 Guest are viewing this topic.

BadMouth

  • Moderator
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 03:56:14 pm
  • ...
Re: DIY Home Steering Wheel
« Reply #40 on: May 09, 2014, 08:57:09 am »
The motor says 90VDC, 2174RPM 1.51AMPS 67 in/oz TORQUE


BTW, I think patents for software are dumb.  Why not patent English?

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

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

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 584
  • Last login:February 03, 2024, 11:13:51 pm
  • Play stupid games... win stupid prizes.
    • solid-orange.com
    • CollectorsEdition.org
Re: DIY Home Steering Wheel
« Reply #41 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: [Select]
/*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 */
}
}


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

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4520
  • Last login:July 15, 2024, 09:18:25 pm
  • Restore! Don't maim for MAME, build from scratch!
    • forum.arcadecontrols.com/index.php/topic,143226.0.html
Re: DIY Home Steering Wheel
« Reply #42 on: May 09, 2014, 10:20:07 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: [Select]
/*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 */
}
}


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.

Thanks for the share

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.

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

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 584
  • Last login:February 03, 2024, 11:13:51 pm
  • Play stupid games... win stupid prizes.
    • solid-orange.com
    • CollectorsEdition.org
Re: DIY Home Steering Wheel
« Reply #43 on: May 09, 2014, 10:48:16 am »
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

  • Trade Count: (+21)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19960
  • Last login:July 17, 2025, 10:00:30 pm
  • 2014 UCA Winner, 2014, 2015, 2016 ZapCon Winner
    • forum.arcadecontrols.com/index.php/topic,137636.msg1420628.html
Re: DIY Home Steering Wheel
« Reply #44 on: May 09, 2014, 02:41:35 pm »
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.
***Build what you dig, bro. Build what you dig.***