viernes, 12 de marzo de 2021

Potenciòmetre controlant velocitat de micromotor corrent continu amb Arduino PWM

Farem el muntatge que es mostra a la figura per tal de controlar la velocitat d'un motor a través d'un potenciòmetre que envia una senyal analògica a l'Arduino. 



En efecte, l'Arduino li assigna un valor entre 0-1023 al valor del tensió del potenciòmetre. 

Ens interessa deixar-lo entre 0-255, valors que defineixen el Duty Cycle del senyal PWM que enviem al circuit del transistor per la sortida D3 (una de les quatre sortides PWM que té Arduino). Quan més temps tinguem la senyal quadrada a nivell alt, més estona tindrem el motor alimentat. La mitjana de tensió serà més elevada. El motor girarà més ràpid.


L'esquema de blocs en l'Arduino Blocks el farem com segueix:


Fixeu-vos que hem Inicialitzat el port sèrie (a 9600, és a dir, envia 9600 bits (0 i 1) en un segon!). D'aquesta manera, si tenim l'Arduino connectat a l'ordinador, podrem veure els valors del potenciòmetre a través de la consola (l'activem on indica la fletxa).

Podeu veure el vídeo del muntatge i el funcionament.




Entrada potenciòmetre a Keystudio UNO - representació en barra horitzontal mitjançant Processing

 Programem el Keystudio UNO amb ArduinoBlocks


Ens assegurem que tanquem el port serie utilitzat per Arduino Blocks, ja que l'ha d'utilitzar el programa Processing (a l'enllaç el podeu trobar).









miércoles, 10 de marzo de 2021

càlcul si estàs fora de marges o si estàs dins

 

=if ((abs( [[02TQProf]]-average([[02TQProf]];[[02TQAlum]]))/average([[02TQProf]];[[02TQAlum]]>0.15;[[02TQProf]]; average([[02TQProf]];[[02TQAlum]]))

martes, 9 de marzo de 2021

read DXF block's data

source: https://filemonger.com/specs/dxf/wotsit.org/dxf_r14/blocks_in_dxf_files_al_u05_c.htm

the BLOCKS section of the DXF file contains all the block definitions. It contains the entities that make up the blocks used in the drawing, including anonymous blocks generated by the HATCH command and by associative dimensioning. The format of the entities in this section is identical to those in the ENTITIES section. All entities in the BLOCKS section appear between block and endblk entities. Block and endblk entities appear only in the BLOCKS section. Block definitions are never nested (that is, no block or endblk entity ever appears within another block-endblk pair), although a block definition can contain an insert entity.

External references are written in the DXF file as block definitions, except that they also include a string (group code 1) that specifies the path and file name of the external reference.

The block table handle, along with any xdata and persistent reactors, appears in each block definition immediately following the BLOCK record, which contains all of the specific information that a block table record stores. Therefore, each block definition has the following sequence of records:

The following is an example of the BLOCKS section of a DXF file:

  0
SECTION
  2
BLOCKS


Beginning of BLOCKS section



  0
BLOCK
  5
<handle>
100
AcDbEntity
  8
<layer>
100
AcDbBlockBegin
  2
<block name>
70
<flag>
10
<X value>
20
<Y value>
30
<Z value>
  3
<block name>
  1
<xref path>


Begins each block entry  
(a block entity definition)




















  0
<entity type>
.
. <data>
.


One entry for each entity definition within the block



  0
ENDBLK
  5
<handle>
100
AcDbBlockEnd


End of each block entry
(an endblk entity definition)




  0
ENDSEC


End of BLOCKS section


martes, 2 de marzo de 2021

Duración de un pulso en Arduino

https://www.arduino.cc/reference/en/language/functions/advanced-io/pulsein/?setlang=it

Comandos Autocad INGLES-ESPAÑOL

INGLÉS ESPAÑOL 3D 3d 3DARRAY 3darray 3DCLIP 3ddelim 3DCORBIT 3dorbitac 3DDISTANCE 3ddist 3DFACE 3dcara 3DMESH 3dmalla 3DORBIT 3dórbita 3DPAN 3dencuadre 3DPOLY 3dpol 3DSIN 3dsin 3DSOUT 3dsout 3DSWIVEL 3dpivotar 3DZOOM 3dzoom ABOUT acerca ACISIN acisin ACISOUT acisout ADCCLOSE cerrardc ADCENTER adcenter ADCNAVIGATE trasladadc ALIGN alinear AMECONVERT convertame APERTURE apertura APPLOAD appload ARC arco AREA área ARRAY matriz ARX arx ASSIST 2000i asist ATTDEF atrdef ATTDISP atrvis ATTEDIT atredit ATTEXT atrext ATTREDEF attredef ATTSYNC 2002 sincratr AUDIT revisión BACKGROUND fondo BASE base BATTMAN 2002 admatrb BHATCH sombcont BLIPMODE marcaaux BLOCK bloque BLOCKICON iconobloque BMPOUT salvabmp BOUNDARY contorno BOX prismarect BREAK parte BROWSER examinar CAL cal CAMERA cámara CHAMFER chaflán CHANGE cambia CHECKSTANDARDS 2002 verificarnormas CHPROP cambprop CIRCLE círculo CLOSE cerrar CLOSEALL 2000i cerrart COLOR color COMPILE compila CONE cono CONVERT covertir CONVERTCTB 2002 convertctb CONVERTPSTYLES convestilotraz COPY copia COPYBASE copiarbase COPYHIST copiahist COPYLINK copiaenlace CUSTOMIZE 2000i personalizar CUTCLIP cortapp CYLINDER cilindro DBCCLOSE dbcclose DBCONNECT conexiónbd DBLCLKEDIT 2000i dblclkedit DBLIST listdb DDEDIT ddedic DDPTYPE ddptype DDVPOINT ddvpoint DELAY retarda DIM y DIMl acota y acotal DIMALIGNED acoalineada DIMANGULAR acoángulo DIMBASELINE acolíneabase DIMCENTER acocentro DIMCONTINUE acocontinua DIMDIAMETER acodiámetro DIMDISASSOCIATE 2002 disociarcota DIMEDIT acoedic DIMLINEAR acolineal DIMORDINATE acocoordenada DIMOVERRIDE acoremplazar DIMRADIUS acoradio DIMREASSOCIATE 2002 reasociarcota DIMREGEN 2002 regencota DIMSTYLE acoestil DIMTEDIT acotedic DIST dist DIVIDE divide DONUT arandela DRAGMODE arrastre DRAWORDER ordenaobjetos DSETTINGS paramsdib DSVIEWER vistaérea DTEXT textodin DVIEW vistadin DWGPROPS propsdib DXBIN cargadxb DXFIN cargadxf DXFOUT salvadxf EATTEDIT 2002 editatr EATTEXT 2002 atrextm EDGE edge EDGESURF suplados ELEV elev ELLIPSE elipse ENDTODAY 2000i finactualidad ERASE borra ETRANSMIT 2000i etransmit EXPLODE descomp EXPORT exportar EXTEND alarga EXTRUDE extrusión FILL rellenar FILLET empalme FILTER filter FIND buscar FOG niebla GRAPHSCR pantgraf GRID rejilla GROUP grupo HATCH sombrea HATCHEDIT editsomb HELP ayuda HIDE oculta HYPERLINK hipervínculo HYPERLINKOPTIONS opcioneshv ID id IMAGE imagen IMAGEADJUST ajustarimg IMAGEATTACH enlazarimg IMAGECLIP delimitarimg IMAGEFRAME marcoimg IMAGEQUALITY calidadimg IMPORT importar INSERT insert INSERTOBJ insertobj INTERFERE interf INTERSECT intersec ISOPLANE isoplano JUSTIFYTEXT 2002 textojustif LAYER capa LAYERP 2002 capap LAYERPMODE  2002 modocapap LAYOUT presentación LAYOUTWIZARD asistpres LAYTRANS 2002 tradcapa LEADER directriz LENGTHEN longitud LIGHT luz LIMITS límites LINE línea LINETYPE tipolin LIST list LOAD carga LOGFILEOFF logfileoff LOGFILEON logfÍleon LSEDIT edpaisaje LSLIB bibpaisaje LSNEW nvpaisaje LTSCALE escalatl LWEIGHT grosorl MASSPROP propfis MATCHPROP igualarprop MATLIB bibliomat MEASURE gradúa MEETNOW 2002 reunión MENU menú MENULOAD cargarmenú MENUUNLOAD descargarmenú MINSERT insertm MIRROR simetría MIRROR3D simetría3d MLEDIT editarlm MLINE líneam MLSTYLE estilolm MODEL modelo MOVE desplaza MSLIDE sacafoto MSPACE espaciom MTEXT textom MULTIPLE múltiple MVIEW vmult MVSETUP mvsetup NEW nuevo OFFSET eqdist OLELINKS vincole OLISCALE escalaole OOPS uy OPEN abre OPTIONS opciones ORTHO orto OSNAP refent PAGESETUP preppágina PAN encuadre PARTIALLOAD cargarparcial PASTEBLOCK pegablq PASTECLIP pegapp PASTEORIG pegarorig PASTESPEC pegaesp PCINWIZARD asistentepcp PEDIT editpol PFACE pcara PLAN planta PLINE pol PLOT saltraz PLOTSTAMP 2002 selloimp PLOTSTYLE estilotraz PLOTTERMANAGER admintraz POINT punto POLYGON polígono PREVIEW previsualizar PROPERTIES propiedades PROPERTIESCLOSE cerprop PSETUPIN importconfpag PSFILL rellenaps PSOUT salvaps PSPACE espaciop PUBLISHTOWEB  2000i publicarenweb PURGE limpia QDIM acotarr QLEADER directrizr QSAVE guardarr QSELECT selecr QTEXT loctexto QUIT quita R14PENWIZARD 2000i asistplumr14 RAY rayo RECOVER recuperar RECTANG rectang REDEFINE redefine REDO rehacer REDRAW redibuja REDRAWALL redibt REFCLOSE cerref REFEDIT editref REFSET conjref REGEN regen REGENALL regent REGENAUTO regenauto REGION región REINIT reinicia RENAME renombra RENDER render RENDSCR pantr REPLAY reproducir RESUME reanuda REVOLVE revolución REVSURF suprev RMAT materialr RMLIN 2000i inrml ROTATE gira ROTATE3D gira3d RPREF prefr RSCRIPT rscript RULESURF supregla SAVE guardar SAVEAS guardarcomo SAVEIMG guardarimg SCALE escala SCALETEXT 2002 textoescala SCENE escena SCRIPT script SECTION sección SELECT designa SETUV mapeado SETVAR modivar SHADE sombra SHADEMODE modosombra SHAPE forma SHELL shell SHOWMAT mostrmat SKETCH boceto SLICE corte SNAP forzcursor SOLDRAW soldraw SOLID sólido SOLIDEDIT editsólido SOLPROF solperfil SOLVIEW solview SPACETRANS 2002 tradspacio SPELL ortografía SPHERE esfera SPLINE spline SPLINEDIT editspline STANDARDS 2002 normas STATS estadist STATUS estado STLOUT salvastl STRETCH estira STYLE estilo STYLESMANAGER adminestilos SUBTRACT diferencia SYSWINDOWS siswindows TABLET tablero TABSURF suptab TEXT texto TEXTSCR panttext TIME tiempo TODAY 2000i actualidad TOLERANCE tolerancia TOOLBAR barraherr TORUS toroide TRACE trazo TRANSPARENCY transparencia TREESTAT estadoarb TRIM recorta U h UCS scp UCSICON simbscp UCSMAN adminscp UNDEFINE anuladef UNDO deshacer UNION unión UNITS unidades VBAIDE vbaide VBALOAD vbacargar VBAMAN vbaadmin VBANEW vbanuevo VBARUN vbaejecutar VBASTMT vbaenun VBAUNLOAD vbadescargar VIEW vista VIEWRES resvista VLISP vlisp VPCLIP vgdelim VPLAYER vgcapa VPOINT ptovista VPORTS ventanas VSLIDE mirafoto WBLOCK bloquedisc WEDGE calce WHOHAS whohas WMFIN cargawmf WMFOPTS wmfops WMFOUT salvawmf XATTACH enlazarx XBIND unirx XCLIP delimitarx XLINE líneax XPLODE xplode XREF refx ZOOM zoom