Lowyat.NET Forums

Welcome Guest ( Log In | Register )

LYN wins Intel-Lenovo-Tangs Blogathon challenge. Thank you everybody!
 
RSS feedBump TopicReply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> PIC microcontroller simulator, help... (C)

wwhwee
post Oct 21 2009, 09:00 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #1


Getting Started
**

Group: Junior Member
Posts: 74
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Feb 2008





I am searching for the software which can load a hex file to test it.
Any recommended simulator?
I am doing my final year project, the component is very expensive, so i need to test on computer software before plug to my device.
My lecturer introduce a software called "Virtual Machine", but i search it on internet, can't get the thing i want. He tell me the software can load a hex file to the PIC microcontroller (in a software, not a real) and see the output (eg : motor running) in software also.

i already have a PIC Simulator IDE, but it is not good enough.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
dOtcO[m]
post Oct 22 2009, 10:35 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #2


Getting Started
**

Group: Junior Member
Posts: 167
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Aug 2007




can u tell why PIC simulator IDE is not good enough?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
carbonytte
post Oct 22 2009, 10:57 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #3


Casual
***

Group: Junior Member
Posts: 307
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003
From: PNG / PJ






MPLAB IDE should have sim, i think. look for it in the manufacturer's site. microchip.com biggrin.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
tgrrr
post Oct 22 2009, 12:46 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #4


On my way
****

Group: Senior Member
Posts: 600
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003
From: Penang




QUOTE(wwhwee @ Oct 21 2009, 09:00 PM)
I am searching for the software which can load a hex file to test it.
Any recommended simulator?
I am doing my final year project, the component is very expensive, so i need to test on computer software before plug to my device.
My lecturer introduce a software called "Virtual Machine", but i search it on internet, can't get the thing i want. He tell me the software can load a hex file to the PIC microcontroller (in a software, not a real) and see the output (eg : motor running) in software also.

i already have a PIC Simulator IDE, but it is not good enough.
*


You need a simulator to test your PIC, or test your external circuitry (e.g. motor)?
PIC are pretty cheap at under RM20, I don't see the need to simulate it.
Software that can simulating external analog circuitry can be very simple, or very very very expensive.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Aurora
post Oct 22 2009, 02:38 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #5


Casual
***

Group: Junior Member
Posts: 405
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003





MPLAB debbugger sim can simulate your code, in C or ASM, not hex. There are better simulator, which can simulate PIC with circuit, LED, motor, anolog/digital signal, PWM, etc... But very expensive.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
dOtcO[m]
post Oct 22 2009, 03:26 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #6


Getting Started
**

Group: Junior Member
Posts: 167
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Aug 2007




yeah u need to describe what type of simulation u wanna do. I dont think complex simulator is needed to simulate PIC.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
wwhwee
post Oct 22 2009, 11:52 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #7


Getting Started
**

Group: Junior Member
Posts: 74
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Feb 2008





Actually i am doing a self-balancing scooter.
The motor is the problem, hard to find a secondhand in malaysia, a new motor is expensive.
So i try to find a software which can see an actual output before i try it in real word.
Have any 1 know any place have sell electric wheelchair motor?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
dOtcO[m]
post Oct 23 2009, 09:08 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #8


Getting Started
**

Group: Junior Member
Posts: 167
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Aug 2007




i dont think you need PIC simulator. if u are worried about current/voltage into you motor, you should find for circuit simulator that can simulate voltage/current level.
IMHO...
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
yokatasan
post Oct 23 2009, 09:47 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #9


Getting Started
**

Group: Junior Member
Posts: 52
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2008
From: muar





PIC simulator IDE from Oshonsoft is good enuff....
However, it is trial version
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Aurora
post Oct 23 2009, 05:06 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #10


Casual
***

Group: Junior Member
Posts: 405
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003





By the way, you are using a motor controller to convert the signal from PIC, right? Why not use a oscilloscope to read the output signal and see if you get it right?

If you intend to simulate the dynamic of a self-balancing scooter with a PIC simulator, I'm afraid that is impossible. doh.gif You need external input, i.e. reading from accelerometer and gyrometer. And this 2 input depends on several mechanical/physical property of the scooter, where a PIC simulator is unable to give you those result. PIC simulator only simulate the relation (aka your code) between input and output, to verify that you get a certain output voltage/current/pulse for a given input condition.

You need a mathematical model which describe the dynamic of the scooter, then use a mathematical software to demonstrate the relationship between mechanical property. Finally you put in your feedback controller (aka your code). Matlab Simulink is the most powerful in modeling this type of problem, given that you have the right mathematical model. tongue.gif

Or use a dynamic simulator software, which is great in simulating motion, but it lack of the capability to model your controller. sweat.gif sweat.gif

You can try ask around at Jalan Pasar, they keep a lot of motors salvage from machine, like washing machine, fan, cars, players, DC/AC motor, and God knows what else they have.... rolleyes.gif And they are relatively cheap, as these are salvage motors.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
wwhwee
post Oct 31 2009, 01:53 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #11


Getting Started
**

Group: Junior Member
Posts: 74
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Feb 2008





thanks for all advise. I am trying to use power window motor which use on car window. But i dunno is it the motor is strong enough to support to human weight. Any comment about this motor?

Any 1 know where can i buy a accessories such as gear wheel, bearing, wheel? i try to search it at jalan pasar already, but can't get it. Is it this type of thing available in Malaysia?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Scud_eSpade
post Oct 31 2009, 02:58 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #12


Getting Started
**

Group: Junior Member
Posts: 242
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Dec 2004
From: B. B. Bangi






Last time i buy bearing and gear at a shop at ipoh. It is a company selling bearing. So yes, it is available in malaysia
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
wwhwee
post Oct 31 2009, 05:27 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #13


Getting Started
**

Group: Junior Member
Posts: 74
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Feb 2008





wa...ipoh o...far from me....any 1 know any this type of shop which at KL?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
tgrrr
post Oct 31 2009, 06:54 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #14


On my way
****

Group: Senior Member
Posts: 600
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003
From: Penang




QUOTE(wwhwee @ Oct 31 2009, 01:53 PM)
thanks for all advise. I am trying to use power window motor which use on car window. But i dunno is it the motor is strong enough to support to human weight. Any comment about this motor?

Any 1 know where can i buy a accessories such as gear wheel, bearing, wheel? i try to search it at jalan pasar already, but can't get it. Is it this type of thing available in Malaysia?
*


I'm no motor expert, but I seriously doubt a car power window motor can move ~60kg of human weight. Even if it could move, the performance probably will be so bad that it's not usable for your application.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
wwhwee
post Nov 7 2009, 06:23 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #15


Getting Started
**

Group: Junior Member
Posts: 74
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Feb 2008





o....My friend just try the power window already, it is really totally not strong enough...
Any 1 try auto gate motor before? is strong?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Aurora
post Nov 7 2009, 10:40 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #16


Casual
***

Group: Junior Member
Posts: 405
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003





Assuming the center of gravity for a 60kg human locate at 1m from ground up, with offset tolerance of 5deg before it stall:

60kg x 1m x sin 5 = 5.23 kg.m, or 51.3 N.m (holding torque).

For dynamic balancing and travel, depends on the acceleration and braking requirement, you may need to multiply by at least a factor of 2. And another 0.5 to 1 for friction and surface condition, and additional factor for incline and decline surface. This is the torque require at output shaft. The motor will experience substantial amount of current surge, in forward and reverse flow direction.

Power window motor is neither strong or fast enough. Probably will fail before it start. sweat.gif Auto gate motor looks promising. If it is rate for DC voltage, then maybe usable. If you google, most DIY people use at least 150W motor, that should be your basis. smile.gif If you can find a suitable metal gear, you can try take a look at hobby motor for RC helicopter or plane. They carry some very powerful motor. thumbup.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
gsrturbo86
post Nov 11 2009, 04:49 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #17


Newbie
*

Group: New Member
Posts: 2
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: May 2006






QUOTE(wwhwee @ Nov 7 2009, 06:23 PM)
o....My friend just try the power window already, it is really totally not strong enough...
Any 1 try auto gate motor before? is strong?
*



seen my seniors use a car starter motor to drive an electronic trolley carrying weights of up to 100kg. Maybe should try that
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Aurora
post Nov 11 2009, 07:52 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #18


Casual
***

Group: Junior Member
Posts: 405
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003





I never try engine starter motor before, but it sure is a powerful motor. What's ur experience with it? suitable for long run?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Bump TopicReply to this topicTopic OptionsStart new topic
 



----debug section please ignore----
Lo-Fi Version Time is now: 24th November 2009 - 09:48 AM
All Rights Reserved 2003-2009 Vijandren Ramadass (~living on a prayer~)