User Tools

Site Tools


delta:software

This is an old revision of the document!


Software

Control System

To get to know all the possibilites and functions which the control system provides please have a look into the Control System described on the eeros wiki.

Control System of the Delta roboter

Lets start with the blue boxes at the centered bottom of the diagramm. This boxes represent the motor package, included the motor, the encoder and the gear. The encoders of the motor packages are defined as “Peripheral Input”. This “Peripheral Inputs” are described in the HAL configuration file. To initialze the encoder inputs, you'll have to call the constructor of the “Peripheral Input” and add the respective “signalId” from the HAL file as parameter, e.g.

eeros::control::PeripheralInput<double> encoder1("enc1");

Because the HAL is configured correctly, we get the current position in radian of each encoder. Next up, the “Mux” collects the four encoder values and puts them into a “AxisVector”. “AxisVector” is defined as

using AxisVector = eeros::math::Matrix<4, 1>;

The “Direct Kinematic” converts the current radian positions of the encoders into cartesian coordinates. The output AxisVector now contains the x, y, z and phi value of the TCP.
Now we switch to the left. We got two possible input types. The “Mouse Input” gets the movement of the mouse and all the buttons attached to it, we use this block to manually control the Delta robot. The output of the “Mouse Input” is an AxisVector containing x, y, z and phi values. X and y change with the mouse movement. Z changes when scrolling up or down on the mouse wheel. Phi changes when pressing the mouse wheel to left or to right. To initialize the “Mouse Input” you have to add the input device as parameter to the constructor, e.g.

eeros::control::MouseInput mouse("/dev/input/event1");

Do not use “/dev/input/mice” or “/dev/input/mouse0” as parameter. The “Mouse” of EEROS uses mouse events.
The “PathPlanner”, as the name says, plans the path to the next point. This is used for auto moving of the Delta robot.

Safety System

To get more informations and details how the Safety System works, please have a look into the Safety System described on the eeros wiki. Safety System of the Delta roboter

Sequencer & Sequences

For more informations how Sequences and the Sequencer work, have a look into Sequencer on the eeros wiki. Sequences of the Delta roboter

HAL

To get more information about the Hardware Abstraction Layer and how it works, please have a look into the HAL described on the eeros wiki.
EEROS for the Beagle Bone Blue is using the robotis_cape_library. You'll find the wrapper and its functions in the bbblue-eeros folder.

Configure the motors

If you want to run a motor with EEROS you need to define a Peripheral Output with the respective “signalId” used in the HAL-Configuration file. As you can see in the HAL-Configuration file for the Delta roboter in “subdevice2” the type for the motors is set to “AnalogOut”. In this subdevice section the 4 motors are configured to match the functions of the robotics_cape_library. In the EEROS application for the Delta roboter you can set a motor voltage of -8.0V to 8.0V. The HAL gets this values and wraps it to match the values of the robotics_cape_library which then runs the motors with the desired voltage. HAL-Configuration for the motors

Configure the encoders

The Delta roboter has two different motors with different encoders and gears. You'll find the datasheets of the two types here.

Calculate the Axis Motor

The Axis Motor is equipped with gear with gear ration 76:1 and with the encoder ieh2-4096, which provides 4096 lines per revolution ( =16384 counts per revolution). So for one full turn on the gear axis, the encoder sends 16384*76 = 1245184 counts. This is the input value for the HAL.
In the EEROS application we don't want to calculate everytime the respective radian value from this counts, so we do this in the HAL. To do that, we need to add some “blocks”.
Start with the gear:
one full turn on the gear axis (=2*PI) equals to 76 turns of the motor axis. Next up, for one revolution of the motor axis, the encoder sends 4096 lines. So if we turn the gear axis for one revolution, the motor axis turns 76 times and the encoder sends 76*4096 = 311296 lines. The last block is the FQD. It converts the lines of the encoder into single counts. One line equals to 4 counts.
HAL config for ieh2 encoder

HAL-Configuration file for the Delta roboter

{
	"device0": {
		"library": "libbbblueeeros.so",
		"devHandle": "dummy",
		"subdevice0": {
			"type": "DigOut",
			"channel0": {
			        "signalId": "onBoardGreen"
			},
			"channel1": {
				"signalId": "ledBlue"
			},
			"channel49": {
				"signalId": "ledRed"
			},
			"channel116": {
				"signalId": "onBoardRed"
			},
			"channel98": {
				"signalId": "emag"
			}
		},
		"subdevice1": {
			"type": "DigIn",
			"channel0": {
				"signalId": "buttonMode"
			},
			"channel1": {
			        "signalId": "buttonPause"
			},
			"channel97": {
				"signalId": "buttonBlue"
			},
			"channel57": {
				"signalId": "buttonRed"
			},
			"channel113": {
				"signalId": "buttonGreen"
			}
		},
		"subdevice2": {
			"type": "AnalogOut",
			"channel1": {
				"signalId": "motor1",
				"scale": [ { "id" : "dac",
							"minIn": 	-1.0, 	"maxIn": 	1.0,
							"minOut": 	-8.0, 	"maxOut": 	8.0 }

					 ],
				"range": [ { "id" : "dac",
						      "minIn": 		-0.75,	"maxIn": 	0.75,
							"minOut": 	-6.0, 	"maxOut": 	6.0 }
					 ],
				"unit": "V"
			},
			"channel2": {
				"signalId": "motor2",
				"scale": [ { "id" : "dac",
							"minIn": 	-1.0, 	"maxIn": 	1.0,
							"minOut": 	-8.0, 	"maxOut": 	8.0 }
					 ],
				"range": [ { "id" : "dac",
						      "minIn": 		-0.75,	"maxIn": 	0.75,
							"minOut": 	-6.0, 	"maxOut": 	6.0 }
					 ],
				"unit": "V"
			},
			"channel3": {
				"signalId": "motor3",
				"scale": [ { "id" : "dac",
							"minIn": 	-1.0, 	"maxIn": 	1.0,
							"minOut": 	-8.0, 	"maxOut": 	8.0 }
					 ],
				"range": [ { "id" : "dac",
						      "minIn": 		-0.75,	"maxIn": 	0.75,
							"minOut": 	-6.0, 	"maxOut": 	6.0 }
					 ],
				"unit": "V"
			},
			"channel4": {
				"signalId": "motor4",
				"scale": [ { "id" : "dac",
							"minIn": 	-1.0, 	"maxIn": 	1.0,
							"minOut": 	-6.0, 	"maxOut": 	6.0 }
							
					 ],
				"range": [ { "id" : "dac",
						      "minIn": 		-1,	"maxIn": 	1,
							"minOut": 	-6.0, 	"maxOut": 	6.0 }
					 ],
				"unit": "V"
			}
		},
		"subdevice3": {
			"type": "Fqd",
			"channel1": {
				"signalId": "enc1",
				"scale": [ { "id" : "gear",
							"minIn": 	0, "maxIn": 6.283185307,
							"minOut":	0, "maxOut": 477.522083346 },
					   { "id" : "enc",
							"minIn": 	0, "maxIn": 477.522083346,
							"minOut":	0, "maxOut": 311296},
					   { "id" : "fqd",
							"minIn":	0, "maxIn": 311296,
							"minOut":	0, "maxOut": 1245184}
					 ],
				"range": [ { "id" : "gear",
							"minIn": 	0, "maxIn": 6.283185307,
							"minOut":	0, "maxOut": 477.522083346 },
					   { "id" : "enc",
							"minIn": 	0, "maxIn": 477.522083346,
							"minOut":	0, "maxOut": 311296},
					   { "id" : "fqd",
							"minIn":	0, "maxIn": 311296,
							"minOut":	0, "maxOut": 1245184}
					 ],
				"unit": "rad"
			},
			"channel2": {
				"signalId": "enc2",
				"scale": [ { "id" : "gear",
							"minIn": 	0, "maxIn": 6.283185307,
							"minOut":	0, "maxOut": 477.522083346 },
					   { "id" : "enc",
							"minIn": 	0, "maxIn": 477.522083346,
							"minOut":	0, "maxOut": 311296},
					   { "id" : "fqd",
							"minIn":	0, "maxIn": 311296,
							"minOut":	0, "maxOut": 1245184}
					 ],
				"range": [ { "id" : "gear",
							"minIn": 	0, "maxIn": 6.283185307,
							"minOut":	0, "maxOut": 477.522083346 },
					   { "id" : "enc",
							"minIn": 	0, "maxIn": 477.522083346,
							"minOut":	0, "maxOut": 311296},
					   { "id" : "fqd",
							"minIn":	0, "maxIn": 311296,
							"minOut":	0, "maxOut": 1245184}
					 ],
				"unit": "rad"
			},
			"channel3": {
				"signalId": "enc3",
				"scale": [ { "id" : "gear",
							"minIn": 	0, "maxIn": 6.283185307,
							"minOut":	0, "maxOut": 477.522083346 },
					   { "id" : "enc",
							"minIn": 	0, "maxIn": 477.522083346,
							"minOut":	0, "maxOut": 311296},
					   { "id" : "fqd",
							"minIn":	0, "maxIn": 311296,
							"minOut":	0, "maxOut": 1245184}
					 ],
				"range": [ { "id" : "gear",
							"minIn": 	0, "maxIn": 6.283185307,
							"minOut":	0, "maxOut": 477.522083346 },
					   { "id" : "enc",
							"minIn": 	0, "maxIn": 477.522083346,
							"minOut":	0, "maxOut": 311296},
					   { "id" : "fqd",
							"minIn":	0, "maxIn": 311296,
							"minOut":	0, "maxOut": 1245184}
					 ],
				"unit": "rad"
			},
			"channel4": {
				"signalId": "enc4",
				"scale": [ { "id" : "gear",
							"minIn": 	0, "maxIn": 5.8,
							"minOut":	0, "maxOut": 670.206432766 },
					   { "id" : "enc",
							"minIn": 	0, "maxIn": 753.982236862,
							"minOut":	0, "maxOut": 30720},
					   { "id" : "fqd",
							"minIn":	0, "maxIn": 30720,
							"minOut":	0, "maxOut": 122880}
					 ],
				"range":  [ { "id" : "gear",
							"minIn": 	0, "maxIn": 6.283185307,
							"minOut":	0, "maxOut": 753.982236862 },
					   { "id" : "enc",
							"minIn": 	0, "maxIn": 753.982236862,
							"minOut":	0, "maxOut": 30720},
					   { "id" : "fqd",
							"minIn":	0, "maxIn": 30720,
							"minOut":	0, "maxOut": 122880}
					 ],
				"unit": "rad"
			}
		}
	}
}

delta/software.1534065905.txt.gz · Last modified: 2018/08/12 11:25 (external edit)