User Tools

Site Tools


product:usb2lds:parameters

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
product:usb2lds:parameters [2014/06/09 19:14]
xevel
product:usb2lds:parameters [2016/09/29 13:12] (current)
xevel [Commands]
Line 9: Line 9:
 To set the parameters, the USB2LDS has to be in setup mode. To set the parameters, the USB2LDS has to be in setup mode.
  
-  * Start a serial terminal application (like [[http://​www.chiark.greenend.org.uk/​~sgtatham/​putty/!PuTTY]] or Arduino Serial Monitor) +  * Start a serial terminal application (like [[http://​www.putty.org/|PuTTY]] or Arduino Serial Monitor) 
-  * Open the Virtual serial port with a baud rate of //9600// (was //​1337// ​with first protos).+  * Open the Virtual serial port with a baud rate of //9600// (or //​1337// ​in the first prototypes).
   * Send '​a'​ to get back an overview of the current setup.   * Send '​a'​ to get back an overview of the current setup.
  
Line 17: Line 17:
  
 All the setup can be managed with single-character commands. All the setup can be managed with single-character commands.
 +
 +All parameters are applied immediately,​ so it is possible to tune them live while the LDS is turning.
  
 ^ Command ^ Description ^ ^ Command ^ Description ^
Line 29: Line 31:
 | + | Set delta to the upper decade (delta*=10) |  | + | Set delta to the upper decade (delta*=10) | 
 | - | Set delta to the lower decade (delta/=10) |  | - | Set delta to the lower decade (delta/=10) | 
-| r | Decrease ​RPM setpoint by 64 (RPM-=64) |  +| r | Decrease ​turn rate setpoint by 64 (RPM-=64) |  
-| R | Increase ​RPM setpoint by 64 (RPM+=64) | +| R | Increase ​turn rate setpoint by 64 (RPM+=64) | 
 | 0 | Set Feedforward mode to NONE |  | 0 | Set Feedforward mode to NONE | 
 | 1 | Set Feedforward mode to FIXED |  | 1 | Set Feedforward mode to FIXED | 
Line 44: Line 46:
 | G | Set Display mode to GRAPH (Not Implemented Yet) |  | G | Set Display mode to GRAPH (Not Implemented Yet) | 
 | v | Set Display mode to VALUES |  | v | Set Display mode to VALUES | 
-| ' ' (space) | Set PWM to 200 to make the motor spin whatever ​the computation. Useful to reset the turn rate to a known value when parameters made it go too fast or too slow for the PID to stabilize.  ​|+| ' ' (space) | Set PWM to 200 to make the motor spin whatever the PID controller output ​|
  
  
Line 59: Line 61:
   * Save => RAM to EEPROM   * Save => RAM to EEPROM
   * Load default => FLASH to RAM   * Load default => FLASH to RAM
 +
 +=== Delta ===
 +
 +For most numerical values, there is a common "​delta"​ parameter that is used to make it easy to adjust very different ranges. It's like selecting the digit you want to go up or down in the number (in decimal) you are adjusting, and it can go all the way up (>10000) or down(<​0.0001).
  
  
Line 65: Line 71:
   * P, I and D cannot be negative and are limited to 0.   * P, I and D cannot be negative and are limited to 0.
  
-Default are FIXME+ 
 +Default are Kp=0.05000, Ki=0.00010, Kd=0.00010 
 + 
 +=== Turn rate setpoint === 
 + 
 +The desired turn rate of the LDS can be selected by adjusting the turn rate setpoint. Its unit is in RPM *64, meaning that a setpoint value of 19200 will be interpreted as 300 RPM (300*64 = 19200) or 5 rotation per second (5*60*64=19200). 
 + 
 +Refer to [[http://​xv11hacking.wikispaces.com/​LIDAR+Sensor| LDS documentation,​ section "​Gotchas"​]] for info on what values are best. 
 + 
 +Default is 19200 (=300 rpm, =5 rps, = 5Hz)
  
 === Feedforward === === Feedforward ===
Line 75: Line 90:
   * PROPORTIONAL : feedforward is a percentage of the RPM setpoint (adjusted with '​c'​and '​C'​) ​   * PROPORTIONAL : feedforward is a percentage of the RPM setpoint (adjusted with '​c'​and '​C'​) ​
  
-Default is FIXME+Default is PROPORTIONAL with a coef of 100.0.\\ 
 +Fixed feedforward default is 190. 
 + 
 +=== Motor === 
 + 
 +The motor can be turned ON or OFF with '​M'​ or '​m'​. The command of the motor is then computed using the PID algorithm and the current parameters. 
 + 
 +In some cases, badly tuned PID parameters can lead to instability. Given that the PID algorithm needs information on the actual turn rate of the sensor, and that the sensor only gives this information if it's turning, it is sometimes necessary to help the system to bet back to normal operation by giving the motor a little push. While this can be done physically by turning the sensor by hand, there is a command that briefly forces the motor to run (space). It might be necessary to send a lot of these commands at once (keep the key pressed) for the system to actually get back up. 
 + 
 +By default, the motor starts to turn whenever the serial port is open. 
 + 
 +=== Display === 
 + 
 +To make it easier to tune the parameters live, data from the PID can be displayed. 
 + 
 +  * NONE: no output. 
 +  * GRAPH: not yet implemented. 
 +  * VALUES: prints the following values: Current RPM*64 value; error (setpoint - current RPM*64 value); output (PWM output sent to the motor, before clamping between 0 and 255). 
product/usb2lds/parameters.1402334090.txt.gz · Last modified: 2014/06/09 19:14 by xevel