Does OnFwd use regulation

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
gloomyandy
Posts: 323
Joined: 29 Sep 2010, 05:03

Does OnFwd use regulation

Post by gloomyandy »

Quick NXC question... When you use OnFwd in NXC will the resultant motor output be using any form of speed regulation or does it simply set a power level for the motor? I had a quick look at the doc, but the answer wasn't obvious (to me at least)...
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Does OnFwd use regulation

Post by afanofosc »

OnFwd winds up generating this code:

Code: Select all

setout _ports, Power, _pwr, OutputMode, OUT_MODE_MOTORON+OUT_MODE_BRAKE, RegMode, OUT_REGMODE_IDLE, RunState, OUT_RUNSTATE_RUNNING, TurnRatio, 0, TachoLimit, 0, RegPValue, _p, RegIValue, _i, RegDValue, _d, UpdateFlags, UF_UPDATE_TACHO_LIMIT+UF_UPDATE_MODE+UF_UPDATE_SPEED+UF_UPDATE_PID_VALUES+_reset
Based on this I would say that it is without regulation (OUT_REGMODE_IDLE).

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Does OnFwd use regulation

Post by mattallen37 »

No PID, just a PWM speed control.

Edit: sorry, John already said that.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
gloomyandy
Posts: 323
Joined: 29 Sep 2010, 05:03

Re: Does OnFwd use regulation

Post by gloomyandy »

Thanks, I thought that was probably the case (I was looking at some nxc code and trying to work out what it did), but wasn't 100% sure...

Andy
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 11 guests