The never complete autopilot.

NOTES 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Bugs
  2. ====
  3. 1. The servo output is noisy.
  4. Not too bad, but you can hear the servo dithering and see it on the
  5. scope. Not surprising as it's interrupt derrived.
  6. 2. The rover side halts after ~30s.
  7. Seems to have cleared after changing the serial port read to all
  8. bytes instead of 1 by 1.
  9. Nope, still present. Perhaps noise causing a break or other error?
  10. Added a watchdog to see if it's the inputs
  11. Checked against pyserial. Match fine.
  12. 3. FIXED: Communication is unreliable until reflashed.
  13. Running avrdude flash makes all frames come through. Before that
  14. only short ones do. Could be the port settings or AVR speed.
  15. 4. FIXED: Lacking logging.
  16. Log all the inputs and outputs. Was turned down due to #2.
  17. Fixes
  18. =====
  19. 3.
  20. Loading calibrate and putting the scope on shows 902.7 us for 9
  21. bits. Suggests FCPU = 8.31 MHz. So the divisor should be good,
  22. suggesting the mode is not.
  23. After running rover, stty says:
  24. speed 38400 baud; line = 0;
  25. min = 1; time = 0;
  26. -brkint -imaxbel
  27. -opost
  28. -isig -icanon -echo -echoe
  29. After flashing, stty says:
  30. speed 19200 baud; line = 0;
  31. min = 1; time = 0;
  32. ignbrk -brkint -icrnl -imaxbel
  33. -opost -onlcr
  34. -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
  35. 1:0:8bf:0:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
  36. And running stty with this clears the fault.
  37. Diff:
  38. ignbrk -icrnl
  39. -onlcr
  40. -iexten -echok -echoctl -echoke
  41. Shouldn't matter: ignbrk
  42. FIXED: goserial was pulling in the (broken) serial_posix.go. Fix the
  43. build selectors.
  44. Thoughts on Go
  45. ==============
  46. No generics is messy:
  47. 1. Can't have a min/max/abs that work on any numeric types.
  48. 2. Can't easily pick float32 vs float64 based on the application as
  49. you have to redo everything else.
  50. I'd like nullable types for things like inputs that may be missing.
  51. Having no generics makes implementing an alternative harder.
  52. No default argument values. I'd like to do a 'CheckClose(a, b,
  53. epsilon=0.01)' but you either need to supply epsilon everywhere or do
  54. a CheckClose and CheckClose2.
  55. No operator overloading.
  56. Built in types are special. You can do len(MyOwnType) and instead
  57. need MyOwnType.Len().
  58. Explicit casting. This is OK, but it's weird to need to cast an int
  59. to a float to multiply it by another float.
  60. select across channels is nice.
  61. The %+v struct-with-field-names formatter is nice.
  62. No easy test for 'x in map'.
  63. Strings are a funny mix of bytes and runes. Most work on bytes, but
  64. range works on runes. Popping a rune from a string is messy.
  65. The built-in types are good and generic and do things like return
  66. specific polymorphisim. You can't do that on anything else.