.net barcode scanner sdk P0 P1 5 Volts Ground ground for encoder connected P2 Xavien 1 P3 Xavien 2 P4 Xavien 3 P19 in Software

Painting Denso QR Bar Code in Software P0 P1 5 Volts Ground ground for encoder connected P2 Xavien 1 P3 Xavien 2 P4 Xavien 3 P19

P0 P1 5 Volts Ground ground for encoder connected P2 Xavien 1 P3 Xavien 2 P4 Xavien 3 P19
QR Recognizer In None
Using Barcode Control SDK for Software Control to generate, create, read, scan barcode image in Software applications.
QR Code JIS X 0510 Maker In None
Using Barcode encoder for Software Control to generate, create QR image in Software applications.
LCD on the usual P8..P18 The values read are based on a 13.5 volts power supply for the motor. (Table in book) }} OBJ Encoder : "Quadrature Encoder" LCD : "LCDRoutines4" 'for the LCD methods UTIL : "Utilities" 'for general methods CON _CLKMODE=XTAL1+ PLL2X _XINFREQ = 5_000_000 VAR long long long long long long long
Scan QR Code 2d Barcode In None
Using Barcode decoder for Software Control to read, scan read, scan image in Software applications.
Generate QR Code ISO/IEC18004 In Visual C#.NET
Using Barcode encoder for Visual Studio .NET Control to generate, create QR Code ISO/IEC18004 image in .NET applications.
'The system clock spec
Create QR Code In VS .NET
Using Barcode encoder for ASP.NET Control to generate, create QR image in ASP.NET applications.
Making Denso QR Bar Code In Visual Studio .NET
Using Barcode printer for Visual Studio .NET Control to generate, create Quick Response Code image in Visual Studio .NET applications.
Pos[3] stack2[25] stack3[25] stack4[25] stack5[25] pulswidth speed
QR Code 2d Barcode Drawer In VB.NET
Using Barcode generation for VS .NET Control to generate, create QR Code 2d barcode image in .NET applications.
Paint UCC - 12 In None
Using Barcode creator for Software Control to generate, create UPC Symbol image in Software applications.
'Create buffer for encoder 'space for Cog_LCD 'space for Cog_SetMotorPower 'space for Cog_RunMotor 'space for Cog_FigureGain ' ' (continued)
Encode Data Matrix 2d Barcode In None
Using Barcode creation for Software Control to generate, create Data Matrix image in Software applications.
EAN13 Drawer In None
Using Barcode printer for Software Control to generate, create UPC - 13 image in Software applications.
Running DC MotoRs with AttACheD inCReMentAl enCoDeRs
USS Code 128 Drawer In None
Using Barcode maker for Software Control to generate, create ANSI/AIM Code 128 image in Software applications.
Painting Barcode In None
Using Barcode encoder for Software Control to generate, create bar code image in Software applications.
Program 28-9 Creating a Motor Speed vs. Motor Power Table. Gain for Each Reading Controlled Manually with a Potentiometer. (continued)
Print USD - 8 In None
Using Barcode generator for Software Control to generate, create USD8 image in Software applications.
Data Matrix ECC200 Generator In Objective-C
Using Barcode maker for iPad Control to generate, create Data Matrix ECC200 image in iPad applications.
long start long end
Print Bar Code In Java
Using Barcode creator for BIRT Control to generate, create bar code image in BIRT reports applications.
Bar Code Scanner In Visual Basic .NET
Using Barcode Control SDK for Visual Studio .NET Control to generate, create, read, scan barcode image in VS .NET applications.
PUB Go cognew(cog_LCD, @stack2) cognew(SetMotorPower, @stack3) cognew(RunMotor(3),@Stack4) cognew(FigureCounts, @stack5) Encoder.Start(0, 1, 0, @Pos) PUB SetMotorPower dira[2..4]~~ repeat PulsWidth:=Util.Read3202_0/16 PRI cog_LCD LCD.INITIALIZE_LCD repeat LCD.POSITION (1,1) LCD.PRINT(STRING("Speed=" )) LCD.PRINT_DEC(Speed) LCD.SPACE(3) LCD.POSITION (2,1) LCD.PRINT(STRING("Gain =" )) LCD.PRINT_DEC(pulswidth) LCD.SPACE(3)
Data Matrix Maker In Visual C#.NET
Using Barcode generator for Visual Studio .NET Control to generate, create Data Matrix image in .NET applications.
Paint Data Matrix ECC200 In Java
Using Barcode encoder for BIRT Control to generate, create Data Matrix 2d barcode image in Eclipse BIRT applications.
'Read the encoder position
Printing Bar Code In None
Using Barcode generator for Excel Control to generate, create bar code image in Office Excel applications.
Draw Data Matrix 2d Barcode In .NET
Using Barcode encoder for .NET Control to generate, create Data Matrix ECC200 image in .NET framework applications.
'These pins control the motor amp 'loop 'read the 4095 pot position to a byte 'manage the LCD 'initialize the 'LCD loop 'Go to 1st line 'Error 'print error 'erase over old 'Go to 2nd line 'Potentiometer 'print the 'erase over old
LCD 1st space
data 1st space pot reading data
PUB RunMotor(Pin)|Cycle_time,period ' toggle the output line, set dira[2..4]~~ ' the three amplifier lines ctra[30..26]:=%00100 'Set this cog's "A Counter" to run PWM ctra[5..0]:=Pin 'Set the "A pin" of this cog to Pin frqa:=1 'Set this counter's frqa value to 1 PulsWidth:=0 'Start with position=0 Cycle_time:=clkfreq/100 'Set the pulse width to 10 ms period:=cnt 'Store the current value of the counter repeat 'power PWM routine. phsa:=-PulsWidth*24*16 ' high pulse for Pulsewidth counts period:=period+Cycle_time 'Calculate cycle time waitcnt(period) 'Wait for the cycle time PUB FigureCounts repeat start:=Pos[0] waitcnt(clkfreq+cnt) end:=Pos[0] speed:=(end-start) 'encoder counts 'loop 'read encoder 'pause 1 sec 'read encoder 'counts moved
holDing the MotoR Position
note Speed is in encoder counts per second; 42-slot encoder, four counts per slot. Supply voltage is 13.5 volts; gain is in parts of the 255 full gain. (The results for your motor will not be the same as mine.)
With the information in Table 28-1, we can define the friction components and decide on the approximate proportional gain factors as we develop more sophisticated control algorithms.
tAble 28-1 PoweR/gAin vs. MotoR sPeeD in enCoDeR Counts/seConD
Gain 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 30 35
SpEED 0 11 23 85 142 152 320 400 460 560 640 710 800 850 940 1010 1080 1160 1200 1300 1370 1450 1540 1630 1660 2000 2400
Gain 40 45 50 55 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 230 240 250
SpEED 2720 3055 3386 3660 4700 5200 6100 6800 7400 8200 8800 9800 10700 11700 12500 13700 14600 15600 16700 17900 18800 19800 21000 21100 21200 21300
Running DC MotoRs with AttACheD inCReMentAl enCoDeRs
Figure 28-5 Two-potentiometer setup motor-control diagram
Let s add the potentiometers so that we can vary two variables as we play with our programs. The wiring diagram for a setup with two potentiometers is shown in Figure 28-5.
Ramping
First, let s design a simplified but very crude ramp where we learn to run the motor at a couple of speeds under program control. In this situation, the motor follows the following scheme:
1. Stopped. 2. Run at a slow speed (0.5 seconds). 3. Run at a fast speed (1 second). 4. Run at a slow speed (0.5 seconds). 5. Stop for 1 second. 6. Repeat last four steps.
Let s divide the moves into 1/100-second segments so that we will run slow for 50 segments, run fast for 100 segments, run slow for 50 segments, and then stop. This is done by managing the gain over a two-second timeframe. Let s look at just the part of the program that manages the gain (see Program 28-10).
RAMPing
Program 28-10
Program Segment to Figure Gains
PUB FigureGain repeat Case time 0..50: gain:=20 51..150: gain:=100 151..200: gain:=20 201..300: gain:=0 waitcnt(120_000+cnt) time:=time+1 if time==300 time:=0
'power to motor 'loop 'base the gain on the time segment number 'first 50 segments 'slow speed 'next 100 segments 'fast speed 'next 50 segments 'slow speed 'next 100 segments 'Gain=0 means stop for a while 'define length of each time segment as 0.1 secs 'add to time segment number 'check top time value 'reset time counter
The complete program listing incorporating this gain algorithm is shown in Program 28-11.
Program 28-11 Run Motor Slow/Fast/Slow/Stop and Then Repeat under Computer Control (No Human Intervention)
{{{4 Sep 09 Harprit Sandhu MotorSloFstSlo.Spini Propeller Tool Version 1.2.6 28 Program 11 This program moves the motor in a slow, fast,slow, stop sequence to demonstrate the control of the speed over a period of equal time segments. This is an absolutely minimal ramping demonstration. Only two speeds are used. This could be expanded to a very complicated algorithm with lots of gains and speed specifications. We are not using the encoder or the potentiometers in this program. Connections are Amplifier brake P2 Amplifier PWM P3 Amplifier direction P4 Potentiometer P19 LCD on the usual P12..P18 4 bit mode Revisions }} (continued)
Copyright © OnBarcode.com . All rights reserved.