레이블이 Automotive인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Automotive인 게시물을 표시합니다. 모든 게시물 표시

2016년 12월 29일 목요일

CANdb(.dbc file) python으로 parsing 하기

1. 개요
차량관련 업무를 하면 차량네트워크 통신(CAN, LIN, MOST, Ethernet 등)을 사용하게 되었습니다.
실제 H/W 를 물리지 않은 상태에서 Simulation 을 해야 할 때는 필수로 Vector 사에서 제공하는 S/W 인 CANoe 로 각 Node를 구성하고, 사용하는 통신에 맞는 H/W 를 연결하게 됩니다.
그리고 그 H/W 를 통해 Message(Signal로 구성) 를 Send(Tx), Receive(Rx) 를 하기 위하여 CANdb, IG block, CAPL Block 을 사용하게 됩니다.

이중 CANdb 는 일회적인 Message만이 아닌 Network 의 전반적인 주기적 통신을 포함합니다.

.dbc 파일 CANdb++ 로 본 것
2. 본론
Vector에서 무료로 제공하는 CANdb++ 를 사용하여 내용을 이해할 수 있는데 Message가 많아질 경우 한눈에 보이지 않는 것을 느껴 평소 하는대로 엑셀(xlsx 혹은 csv)에 모든 데이터를 넣어서 참조하고 싶었습니다.

.dbc 파일 notepad 로 본 것

해당 .dbc 파일은 text 로 구성되어 있고 내용을 보면 역시 구조화가 되어 있다는 것을 볼 수 있습니다.

그래서 Parsing을 하면 되겠다 라고 생각했지만 아무래도 시간이 많이 걸릴 것 같은데다 제대로 할 수 있을지 의문이 들긴 했습니다;

그래서 Google 검색을 하니 역시 누군가가 만들어 놨더라구요.






















package Github 링크
python package download

압출을 풀면 아래 내용이 나오며
python.exe setup.py install 명령을 통해













설치하면 여러가지 파일이 생성 되지만 지금 필요한 것만 소개하면
canconvert-script.py 파일 입니다.











3. 결론
.dbc 파일을 excel 혹은 csv 로 변경하고 싶으면 command line에서
"python.exe canconvert-script.py XXX.dbc XXX.csv"
이라고 명령을 주면

XXX.csv 파일이 생성 됩니다.

그 결과 원했던 대로 .dbc 파일 내용을 .csv 형태로 볼 수 있습니다.(.xlsx 은 csv->xlsx 변경만 하면 됩니다.)


전 검색하기 편해서 좋습니다.

2016년 6월 5일 일요일

(E, K)Unified Diagnostic Services 간단한 정리

Unified Diagnostic Services (UDS) specifies data link independent requirements of automotive diagnostic services in road vehicles.[1]
UDS is codified in ISO 14229-1:2013 and allows diagnostics to control functions on an in-vehicle Electronic Control Unit (ECU).
Typical functions ECUs control are electronic fuel injection(EFI), automatic gear box, anti-lock braking system, etc.
all connected to a serial data link embedded in a road vehicle.
The Diagnostic communication over Controller Area Network (DoCAN) is specified in ISO 15765-3[2] and ISO 14229-3.

통합 진단 서비스(UDS) 는 data link independent 한 자동차의 진단 서비스를 의미합니다.
UDS는 ISO 14229-1:2013 에 명시되어 있으며, 진단 명령이 차량의 ECU 를 제어 하게 되어 있습니다.
전형적인 ECU의 기능은 연료 분사(EFI), 자동 변속기, 잠김 방지 브레이크 장치 등이 있습니다.
모두 자동차 안의 시리얼 연결로 연결되어 으며, CAN을 통한 진단 통신(DoCAN)은 ISO 15765-3[2] and ISO 14229-3에 명시되어 있습니다.

Service 리스트
Function group
Request SID
Response SID
Service
Diagnostic and
Communications Management
$10
$50
Diagnostic Session Control
$11
$51
ECU Reset
$27
$67
Security Access
$28
$68
Communication Control
$3E
$7E
Tester Present
$83
$C3
Access Timing Parameters
$84
$C4
Secured Data Transmission
$85
$C5
Control DTC Settings
$86
$C6
Response On Event
$87
$C7
Link Control
Data Transmission
$22
$62
Read Data By Identifier
$23
$63
Read Memory By Address
$24
$64
Read Scaling Data By Identifier
$2A
$6A
Read Data By Identifier Periodic
$2C
$6C
Dynamically Define Data Identifier
$2E
$6E
Write Data By Identifier
$3D
$7D
Write Memory By Address
Stored Data Transmission
$14
$54
Clear Diagnostic Information
$19
$59
Read DTC Information
Input / Output Control
$2F
$6F
Input Output Control By Identifier
Remote Activation of Routine
$31
$71
Routine Control
Upload / Download
$34
$74
Request Download
$35
$75
Request Upload
$36
$76
Transfer Data
$37
$77
Request Transfer Exit
$38
$78
Request File Transfer

Input / Output Control
This service allows an external system intervention on internal / external signals via the diagnostic interface.
By specifying a so-called option bytes additional conditions for a request can be specified, the following values are specified:
이 서비스는 외부 시스템이 진단 인터페이스를 이용하여 내부 혹은 외부 시그널에(버스에 정의된 기본 시그널을 의미 하는 듯) 접근 하는 것을 허용한다. 소위 option byte의 추가 조건 이라고 불리는 것으로 요청을 할 수 있게 된다. 아래 값들이 정의 된다.

ReturnControlToECU: The device must get back controls of the mentioned signals.
해당 장치는 언급된 시그널들로 돌아가야 한다.
ResetToDefault: The tester prompts to reset signals to the system wide default value.
시그널 들을 초기 값으로 돌아가게 만들어야 한다.
Freeze Current State: The device shall freeze the current signal value.
현재 시그널이 가진 값들을 그대로 유지하게 한다.
ShortTermAdjustment: The device shall use the provided value for the signal
장치는 제공받은 값으로 시그널을 사용해야 한다.(짧은 기간이라는 말은 일정 기간만 이라는 뜻인지)

Remote Activation of Routine
The Control service routine services of all kinds can be performed. There are three different message types:
With the start-message, a service can be initiated. It can be defined to confirm the beginning of the execution or to notify when the service is completed.
With the Stop message, a running service can be interrupted at any time.
The third option is a message to query the results of the service.
The start and stop message parameters can be specified. This makes it possible to implement every possible project-specific service.
*. 이 Control Routine 을 사용한다는 것은 해당 작업이 시작, 정지, 결과 읽기의 기본 명령들을 실행할 만한 셩격일 때 하는 것인지.



참조: 위키피디아












































2016년 5월 29일 일요일

자동차 조향장치 작동원리 - How Car Steering Works (1/2)


목적: pinion steering 의 의미를 알기 위하여 검색하였고, pinion steering 이 사용되는 Steering 전반에 대하여 정리해 두려고 합니다.

Car Steering 은 조향(자동차 방향을 조정하는 것) 을 이야기 하는 것으로 steering wheel(핸들) 을 움직임으로서 바퀴의 방향을 조정하는 것을 말합니다.


How Car Steering Works
자동차의 방향조절 원리는 무엇인가?

You know that when you turn the steering wheel in your car, the wheels turn. Cause and effect, right? But a lot of interesting stuff goes on between the steering wheel and the tires to make this happen.
당신도 이미 알겠지만 차의 핸들(steering wheel)을 돌리면, 바퀴(wheel)이 돈다. 원인이 있으니 결과가 있는 것이다. 하지만 핸들과 타이어 사이에 많은 일들이벌어진다.

In this article, we'll see how the two most common types of c­ar steering systems work: rack-and-pinion and recirculating-ball steering. Then we'll examine power steering and find out about some interesting future developments in steering systems, driven mostly by the need to increase the fuel efficiency of cars. But first, let's see what you have to do turn a car. It's not quite as simple as you might think!
이 글 에서는, 대표적인 자동차 조향장치(steering system)의 동작원리를 알아보려고 한다: '랙과 피니언(rack and pinion)' 과  '볼 순환식(recurculating-ball)' 이다. 이 둘을 알아본 다음에는 파워 스티어링(power steering)과 그 외에 개발되고 있는 장치들을 이야기할 것이다. 이 장치들의 개발은 연료의 효율성에 초점을 맞춰서 발전되고 있다. 하지만 그 전에, 어떻게 차를 돌리는지에 대하여 이야기 해 보자. 생각보다 쉽지 않을 것이다.


You might be surprised to learn that when you turn your car, your front wheels are not pointing in the same direction.
당신이 차를 회전시킬 때, 차의 앞 두 바퀴가 동일한 방향을 가리키지 않는다는것을 알면 놀랄 것이다.

For a car to turn smoothly, each wheel must follow a different circle. Since the inside wheel is following a circle with a smaller radius, it is actually making a tighter turn than the outside wheel. If you draw a line perpendicular to each wheel, the lines will intersect at the center point of the turn. The geometry of the steering linkage makes the inside wheel turn more than the outside wheel.
차가 부드럽게 회전하기 위해서는, 두 바퀴는 서로다른 원을 그려야 한다. 안쪽에 있는 바퀴가 작은 각도로 돌리 때문에, 바깥쪽 바퀴보다 작은 반경의 회전을 하게 된다. 만약에 각 바퀴의 움직임에 대한 선에 직각 선을 그린다면 회전 시에 중심지점에서 만나는 것을 알 수 있을 것이다. 기하학적으로 회전을 연결시키기 위해서 안쪽 바퀴가 바깥쪽 바퀴보다 더 많은 회전을 하게 된다.


1. Rack-and-pinion Steering

Rack-and-pinion steering is quickly becoming the most common type of steering on cars, small trucks and SUVs. It is actually a pretty simple mechanism. A rack-and-pinion gearset is enclosed in a metal tube, with each end of the rack protruding from the tube. A rod, called a tie rod, connects to each end of the rack.
랙앤피니언 은 가장 일반적인 타입의 조향장치이다. 승용차, 작은트럭, SUV에 주로 쓰인다. 동작원리는 비교적 간단하다. rack 과 pinion은 메탈 튜브로 둘로싸인 기어의 조합을 의미한다. rack의 양 끝은 튜브보다 튀어나와 있으며, tie rod 는 두 바퀴를 함께 동작하게 하기 위해 rack의 양 끝을 연결하는 역할을 한다.

The pinion gear is attached to the steering shaft. When you turn the steering wheel, the gear spins, moving the rack. The tie rod at each end of the rack connects to the steering arm on the spindle (see diagram above).
pinion gear는 steering shaft에 붙어 있다. 핸들을 돌리면, pinion gear는 회전하면서 rack을 회전시킨다. rack의 양 끝에 있는 tie rod는 spindle 위의 steering arm에 연결된다.


이후 정리될 내용
 2. Recirculating-ball Steering
 3. Power Steering
 4. Pump
 5. The Future of Power Steering

참조
http://auto.howstuffworks.com/steering.htm
차량 조향장치 링크 부분에 사용되는 부품

2016년 3월 13일 일요일

(E,K) MCU 이해 - Understanding MCU

Which micro controller could I learn about in order to have directly marketable embedded skills
어떤 마이컴을 선택해야 내 실력을 월등히 높힐 수 있나요?

This chapter will provide such people with some idea why the newbie question can't be answered in any simple way, and some useful recommendations as to which platforms you might choose for experimentation and learning purposes
이 챕터에서는 처음 공부하는 사람이 질문하는 것들이 왜 간단하게 대답될 수 없는지를 설명하면서, 어떤 마이컴을 선택하는 것이 유용할 지에 대해서도 이야기 한다.

in any case, the short answer to the "which micro should I learn for fortune and glory"
question is that learning how to work with any one particular micro-controller won't lead you directly to a job.
어떤 경우에, "어떤 마이컴을 선택하는게 가장 효율적일까요?" 에 대한 짧은 대답은 특정 하나의 마이컴을 공부한다고 해서 직업을 얻을 수는 없을 것이라는 것이다.

when you come to a new job, you're going to find a certain body of legacy technology implemented on some micro or other(probably some hoary old device you would never choose in your wild-est nightmare),
새로운 직업을 잡게 되면, 그 회사에서 기존에 개발되어 있던 예전 코드들로 일하게 될 것이다.(아마 당신이라면 절대 선택하지 않을 마이컴일 수 도 있다.)
and perhaps a newer generation based on a different family of micros and when you start working on your own completely new designs, you may choose a different family yet again.
그리고 공부했던 것과는 다른 전혀 새로운 마이컴들을 가지고 일할 수도 잇다.

on a related note: In this chapter, I mention several specific vendors and products by name, and I quite some approximate price.
이 챕터에서는 몇가지 벤더의 제품들을 이야기할 것이다.

I'm including a discussion of the 8051 in this book for two reasons and one minor reason.
인털의 8051시리즈를 언급하는 것에는 큰 2가지 이유와 작은 한가지 이유가 있다.

1. It pops up in all sorts of apparently unrelated applications - many application - specific standard products(ASSPs), for instance, have an 8051 core.
The chance that you'll run across an 8051 variant in your career is this very good indeed.
Being family with the core's capabilities, if nothing else, will help you decide how to part together your design.
2. If you can work efficiently with the 8051, you can work with anything, so it's not a terrible architecture to learn on.
3. (Minor reason) - the 8051 happens to be very efficient at task. You may find this fact useful, since the 8051 is also very cheap

1. 어디선가 8051 버전의 변형을 만날 확률이 높다.
2. 8051을 효율적으로 사용하면 어떤 것들로도 일할 수 있어진다.
3. (마이너한 것) - 실제 효율적이며, 싸다.

1st level of Understanding of MCU as SW Engineer(My Idea)
    Memory Configuration
      -> Memory address
        RAM(DRAM, SRAM)
        ROM(MASK ROM, PROM, EPROM, EEPROM)

SW 엔지니어로서 MCU 에 대해 1차로 이해해야 하는 것(내 생각)
    Memory 구성
      -> 메모리 주소
        RAM(DRAM, SRAM)
ROM(MASK ROM, PROM, EPROM, EEPROM)
    Port의 종류와 역할
        지원 통신의 종류
    사용가능 인터럽트
    그 외 자세한 기능


참조: 임베디드 엔지니어가 되고 싶다고
Reference: So You Wanna Be an Embedded Engineer, 1st Edition

2016년 3월 12일 토요일

(E, K) Robot framework, RIDE 3 - Libraries(라이브러리)

 Test libraries provide the actual testing capabilities to Robot Framework by providing keywords. There are several standard libraries that are bundled in with the framework, and galore of separately developed external libraries that can be installed based on your needs. Creating your own test libraries is a breeze.
Let us know if there are useful libraries missing from the list.

Test 라이브러리는 Robot Framework에서 실제 테스트를 키워드를 사용해서 할 수 있도록 해준다. 기본으로 설치되어 있는 라이브러리가 있고, 필요에 따라 설치할 수 있는 많은 외부 라이브러리들이 이미 개발되어 있다. 자신만의 라이브러리를 만드는 것도 쉽다.

만약 아래 리스트에 유용한 라이브러리가 빠져 있다면 알려주기 바란다.

* 한 눈에 볼 수 있도록 긴 표로 나타내었습니다.

STANDARD
Builtin
Provides a set of often needed generic keywords. Always automatically available without imports.
Dialogs
Provides means for pausing the test execution and getting input from users.
Collections
Provides a set of keywords for handling Python lists and dictionaries.
OperatingSystem
Enables various operating system related tasks to be performed
in the system where Robot Framework is running.
Remote
Special library acting as a proxy between Robot Framework and test libraries elsewhere.
Actual test libraries can be running on different machines
   and be implemented using any programming language supporting XML-RPC protocol.
Screenshot
Provides keywords to capture screenshots of the desktop.
String
Library for generating, modifying and verifying strings.
Telnet
Makes it possible to connect to Telnet servers and execute commands on the opened connections.
XML
Library for generating, modifying and verifying XML files.
Process
Library for running processes in the system. New in Robot Framework 2.8.
DateTime
Library for date and time conversions. New in Robot Framework 2.8.5.
EXTERNAL
Android library
Library for all your Android automation needs. It uses Calabash Android internally.
AnywhereLibrary
Library for testing Single-Page Apps (SPA). Uses Selenium Webdriver and Appium internally.
AppiumLibrary
Library for Android- and iOS-testing. It uses Appium internally.
Archive library
Library for handling zip- and tar-archives.
AutoItLibrary
Windows GUI testing library that uses AutoIt freeware tool as a driver.
Database Library (Java)
Java-based library for database testing. Works only with Jython.
Database Library (Python)
Python based library for database testing. Works with any Python interpreter, including Jython.
Diff Library
Library to diff two files together.
Eclipse Library
Library for testing Eclipse RCP applications using SWT widgets.
robotframework-faker
Library for Faker, a fake test data generator.
FTP library
Library for testing and using FTP server with Robot Framework.
HTTP library (livetest)
Library for HTTP level testing using livetest tool internally.
HTTP library (Requests)
Library for HTTP level testing using Request internally.
iOS library
Library for all your iOS automation needs. It uses Calabash iOS Server internally.
ImageHorizonLibrary
Cross-platform, pure Python library for GUI automation based on image recognition.
MongoDB library
Library for interacting with MongoDB using pymongo.
MQTT library
Library for testing MQTT brokers and applications.
Rammbock
Generic network protocol test library that offers easy way to specify network packets
   and inspect the results of sent and received packets.
RemoteSwingLibrary
Library for testing and connecting to a java process and using SwingLibrary,
especially Java Web Start applications.
SeleniumLibrary
Web testing library that uses popular Selenium tool internally.
Uses deprecated Selenium 1.0 and is also itself deprecated.
Selenium2Library
Web testing library that uses Selenium 2. For most parts drop-in-replacement
for old SeleniumLibrary.
Selenium2Library for Java
Java port of the Selenium2Library.
SSHLibrary
Enables executing commands on remote machines over an SSH connection.
Also supports transfering files using SFTP.
SudsLibrary
A library for functional testing of SOAP-based web services based on Suds,
a dynamic SOAP 1.1 client.
SwingLibrary
Library for testing Java applications with Swing GUI.
watir-robot
Web testing library that uses Watir tool.
OTHER
Creating test libraries
Creating test libraries section in Robot Framework User Guide.
plone.app
.robotframework
Provides resources and tools for writing functional Selenium tests for Plone CMS and its add-ons.
JavalibCore
Base for implementing larger Java based test libraries for Robot Framework.
Remote
Built-in special library acting as a proxy between Robot Framework and test libraries elsewhere.
Actual test libraries can be running on different machines and be implemented
   using any programming language supporting XML-RPC protocol.
RemoteApplications
Special test library for launching Java applications on a separate JVM
and taking other libraries into use on them.