oplet write - abdullin/Dexter GitHub Wiki
The Write (w
) oplet writes low level values to the FPGA / Gateware and in some cases also sets variables in the firmware. This is the lower case 'w'; the upper case 'W' is Write to Robot. The second parameter (the value) is written to the address of the FPGA specified by the first parameter. e.g. w 42 64
writes the value 64 into the address 42 in the FPGA. Some addresses are also "tracked" by the C firmware (DexRun) for example, w 5 6516872
writes a new value to FPGA register #5, ACCELERATION_MAXSPEED but the maxSpeed and coupledAcceleration variables in DexRun will also be updated. For higher level settings in the Firmware, see the 'S' oplet
Note: This represents the "virtual" address list as used by the 'w' command. The actual FPGA addresses have been changed since 2018.05.29 to use a "keyhole window" to reduce the number of mapped addresses used by the FPGA. In the keyhole system, one address in a block will select what the next address actually changes. DexRun.c still interprets 'w' commands with the original addresses when the function has not been converted to a keyhole system via the array "OldMemMapInderection". Items which have been struck out below are not available via 'w' and must be set via other commands which are linked here.
Addr | Name | Description |
---|---|---|
0 | BASE_POSITION_AT | |
1 | END_POSITION_AT | |
2 | PIVOT_POSITION_AT | |
3 | ANGLE_POSITION_AT |
|
4 | ROT_POSITION_AT | |
5 | ACCELERATION_MAXSPEED | Acceleration [20:31] and max speed [0:19] (shared register). Use the oplet S AngularAcceleration and Use oplet S AngularSpeed |
6 | BASE_SIN_CENTER | |
7 | BASE_COS_CENTER |
|
8 | END_SIN_CENTER |
|
9 | END_COS_CENTER | |
10 | PIVOT_SIN_CENTER | |
11 | PIVOT_COS_CENTER | |
12 | ANGLE_SIN_CENTER | |
13 | ANGLE_COS_CENTER | |
14 | ROT_SIN_CENTER | |
15 | ROT_COS_CENTER | |
16 | PID_DELTATNOT | |
17 | PID_DELTAT | |
18 | PID_D | |
19 | PID_I | |
20 | PID_P | PID Proportional Term in Floating point. Use SetParameter oplet S J#PID_P |
21 | PID_ADDRESS | Sets the joint number for the above PID_ settings to be written into. |
22 | BOUNDRY_BASE | |
23 | BOUNDRY_END | |
24 | BOUNDRY_PIVOT | |
25 | BOUNDRY_ANGLE | |
26 | BOUNDRY_ROT |
|
27 | SPEED_FACTORA | Multiplier (coefficient / master gain) for the force calculator. Allows quick adjustments. |
28 |
|
Was SPEED_FACTORB, now BETA_XYZ: Reactivity of the boundary for Joints 1-3. Resistance to movement will be like a marshmallow vs brick wall. See also DIFF_FORCE_BETA |
29 | FRICTION_BASE | |
30 | FRICTION_END | |
31 | FRICTION_PIVOT |
|
32 | FRICTION_ANGLE | |
33 | FRICTION_ROT | |
34 | MOVE_TRHESHOLD | Maximum force before joint 1,2,3 position starts changing. See follow mode. |
35 | F_FACTOR | Like SPEED_FACTORA, but for PID controller. Affects all joints at once. |
36 | MAX_ERROR | Speed limit for PID controller. Clips the velocity of the step signals going to the motor. eg. w, 36, (2000 ^ (PID_max_speed_degrees * 312))
|
37 | FORCE_BIAS_BASE | |
38 | FORCE_BIAS_END | |
39 | FORCE_BIAS_PIVOT |
|
40 | FORCE_BIAS_ANGLE | |
41 | FORCE_BIAS_ROT | |
42 | COMMAND_REG | control state register. Bits: 0 CMD_CAPCAL_BASE 1 1 CMD_CAPCAL_END 2 2 CMD_CAPCAL_PIVOT 4 3 CMD_MOVEEN 8 4 CMD_MOVEGO 16 5 CMD_ENABLE_LOOP 32 6 CMD_CLEAR_LOOP 64 7 CMD_CALIBRATE_RUN 128 8 CMD_RESET_POSITION 256 9 CMD_RESET_FORCE 512 10 CMD_CAPCAL_ANGLE 1024 11 CMD_CAPCAL_ROT 2048 12 CMD_ANGLE_ENABLE 4096 13 CMD_ROT_ENABLE 8196 see cmd calc |
43 | DMA_CONTROL | Used to read and write tables and other large data objects. Bits: 0 DMA_WRITE_ENQUEUE 1 1 DMA_WRITE_INITIATE 2 2 DMA_READ_DEQUEUE 4 3 DMA_READ_BLOCK 8 4 DMA_RESET_ALL 16 |
44 | DMA_WRITE_DATA | |
45 | DMA_WRITE_PARAMS | |
46 | DMA_WRITE_ADDRESS | |
47 | DMA_READ_PARAMS | |
48 | DMA_READ_ADDRESS | |
49 | REC_PLAY_CMD | Bits: 0 CMD_RESET_RECORD 1 1 CMD_RECORD 2 2 CMD_RESET_PLAY 4 3 CMD_PLAYBACK 8 4 CMD_RESET_PLAY_POSITION |
50 | REC_PLAY_TIMEBASE | |
51 |
|
|
52 | DIFF_FORCE_BETA | Reactivity of the boundary for the differential. Resistance to movement will be like a marshmallow vs brick wall. See also XYZ_BETA |
53 | DIFF_FORCE_MOVE_THRESHOLD | Maximum force before joint 4, 5 position starts changing. See follow mode. |
54 | DIFF_FORCE_MAX_SPEED | Maximum speed the force calculator can generate. Like MAX_ERROR (but for force, not PID) |
55 | DIFF_FORCE_SPEED_FACTOR_ANGLE | Multiplier (coefficient / master gain) for the force calculator on J4. Like SPEED_FACTORA |
56 | DIFF_FORCE_SPEED_FACTOR_ROT | Multiplier (coefficient / master gain) for the force calculator on J5. Like SPEED_FACTORA |
57 |
|
make_ins("w", 57, 300001) //Spin backwards at speed 300000 make_ins("w", 57, 300000) //Spin forward at speed 300000 make_ins("w", 57, 0) //Stops A good range is 50000 (slow) to 500000 (fast). Odd speeds are backwards, even are forwards. It spins until speed is set to 0 so position based control is not supported. Coordinated with other joints, so a move all joints (a) command is required after. |
58 | FINE_ADJUST_BASE | |
59 | FINE_ADJUST_END | |
60 | FINE_ADJUST_PIVOT | |
61 | FINE_ADJUST_ANGLE |
|
62 | FINE_ADJUST_ROT | |
63 | RECORD_LENGTH | |
64 | END_EFFECTOR_IO | Controls the configuration of the bits that go to the end effector. See End-Effectors, Issue 73 |
65 | SERVO_SETPOINT_A | PWM value in PWM mode on end effector pins. |
66 | SERVO_SETPOINT_B | " See Issue 73 |
67 | BASE_FORCE_DECAY | How hard the joint tries to return to the commanded position when the position. |
68 | END_FORCE_DECAY | has been changed to avoid exceeding the maximum force. |
69 | PIVOT_FORCE_DECAY | Subtracts out the offset introduced by the force controller. |
70 | ANGLE_FORCE_DECAY | See Protect mode |
71 | ROTATE_FORCE_DECAY | " |
72 | PID_SCHEDULE_INDEX | |
73 | GRIPPER_MOTOR_CONTROL | PWM output from 7 pin SIL connector on the side (near bottom) of the motor board. Just the first bit is used to enable / disable. |
74 | GRIPPER_MOTOR_OFF_WIDTH | " Use oplet S GripperMotor |
75 | GRIPPER_MOTOR_ON_WIDTH | " See Issue 73 |
76 | START_SPEED |
|
77 | ANGLE_END_RATIO | |
78 | RESET_PID_AND_FLUSH_QUEUE | bit 0 resets PID_DELTA. Bit 1 is E_STOP? Set to all zero for normal operation. |
79 | XYZ_FORCE_TIMEBASE | Timebase Divisor |
80 | DIFFERENTIAL_FORCE_TIMEBASE | Timebase Divisor |
81 | PID_TIMEBASE | Timebase Divisor |