|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#10
|
|||
|
|||
|
Re: Gyro PID User drive - How we did it
one way you could improve your code is remove the floats since they are very expensive to the processor and replace them with a numerator and denominator. Then when doing your math you do everything for that portion and divide last.
ex. char Kp = 5; char kpDiv = 100; pTerm = (Kp * p_error) / KpDiv; You will lose the precision of having a floating point value in the end, but with PWM values I do not think that matters anyways also I am wondering why your errors are floats? Last edited by Render : 25-02-2007 at 23:08. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PID cmd_drive can't drive straight? | gnormhurst | Programming | 4 | 18-02-2005 01:54 |
| Drive Straight C Code using Encoders without PID? | Chris_Elston | Programming | 17 | 15-02-2005 23:41 |
| How many drive motors did you use (per side) this year? | Billfred | Motors | 19 | 16-10-2004 20:27 |
| How did YOU drive your team nuts these six weeks? | archiver | 2001 | 10 | 24-06-2002 01:13 |
| How did YOU drive your team nuts these past 6 weeks? | Jessica Boucher | Chit-Chat | 35 | 16-03-2002 01:04 |